From 31de61a22bb5b8980341a4734cc077abda43547f Mon Sep 17 00:00:00 2001 From: Ivan Shumkov Date: Wed, 9 Apr 2025 06:47:26 +0700 Subject: [PATCH 01/15] refactor: move proof retrival to Drive ABCI --- packages/dapi-grpc/.gitignore | 1 + packages/dapi-grpc/build.rs | 40 +- .../drive/v0/nodejs/DrivePromiseClient.js | 111 + .../clients/drive/v0/nodejs/drive_pbjs.js | 68482 ++++++++++++++++ .../clients/drive/v0/nodejs/drive_protoc.js | 420 + .../clients/drive/v0/web/drive_pb.d.ts | 56 + .../clients/drive/v0/web/drive_pb.js | 420 + .../drive/v0/web/drive_pb_service.d.ts | 63 + .../clients/drive/v0/web/drive_pb_service.js | 61 + .../dash/platform/dapi/v0/PlatformGrpc.java | 136 +- .../v0/nodejs/PlatformPromiseClient.js | 39 - .../platform/v0/nodejs/platform_pbjs.js | 3122 - .../platform/v0/nodejs/platform_protoc.js | 3076 - .../platform/v0/objective-c/Platform.pbobjc.h | 370 - .../platform/v0/objective-c/Platform.pbobjc.m | 907 - .../platform/v0/objective-c/Platform.pbrpc.h | 13 - .../platform/v0/objective-c/Platform.pbrpc.m | 20 - .../platform/v0/python/platform_pb2.py | 1847 +- .../platform/v0/python/platform_pb2_grpc.py | 33 - .../clients/platform/v0/web/platform_pb.d.ts | 403 - .../clients/platform/v0/web/platform_pb.js | 3076 - .../platform/v0/web/platform_pb_service.d.ts | 19 - .../platform/v0/web/platform_pb_service.js | 40 - .../dapi-grpc/protos/drive/v0/drive.proto | 18 + .../protos/platform/v0/platform.proto | 85 +- packages/dapi-grpc/scripts/build.sh | 38 + .../dapi-grpc/scripts/patch-protobuf-js.sh | 3 +- .../fetchProofForStateTransitionFactory.js | 305 +- ...tForStateTransitionResultHandlerFactory.js | 8 +- .../rs-drive-abci/src/query/proofs/mod.rs | 43 +- .../rs-drive-abci/src/query/proofs/v0/mod.rs | 436 +- .../drive_abci_query_versions/mod.rs | 2 +- .../drive_abci_query_versions/v1.rs | 6 +- .../src/version/mocks/v2_test.rs | 6 +- 34 files changed, 70739 insertions(+), 12966 deletions(-) create mode 100644 packages/dapi-grpc/clients/drive/v0/nodejs/DrivePromiseClient.js create mode 100644 packages/dapi-grpc/clients/drive/v0/nodejs/drive_pbjs.js create mode 100644 packages/dapi-grpc/clients/drive/v0/nodejs/drive_protoc.js create mode 100644 packages/dapi-grpc/clients/drive/v0/web/drive_pb.d.ts create mode 100644 packages/dapi-grpc/clients/drive/v0/web/drive_pb.js create mode 100644 packages/dapi-grpc/clients/drive/v0/web/drive_pb_service.d.ts create mode 100644 packages/dapi-grpc/clients/drive/v0/web/drive_pb_service.js create mode 100644 packages/dapi-grpc/protos/drive/v0/drive.proto diff --git a/packages/dapi-grpc/.gitignore b/packages/dapi-grpc/.gitignore index e8aa2e11061..b9dcba2ebcb 100644 --- a/packages/dapi-grpc/.gitignore +++ b/packages/dapi-grpc/.gitignore @@ -1,2 +1,3 @@ src/core/*/ src/platform/*/ +src/drive/*/ diff --git a/packages/dapi-grpc/build.rs b/packages/dapi-grpc/build.rs index 95c6a3682b6..5a922bdf36f 100644 --- a/packages/dapi-grpc/build.rs +++ b/packages/dapi-grpc/build.rs @@ -47,6 +47,16 @@ fn generate_code(typ: ImplType) { .generate() .expect("generate platform proto"); + let drive = MappingConfig::new( + PathBuf::from("protos/drive/v0/drive.proto"), + PathBuf::from("src/drive"), + &typ, + ); + + configure_drive(drive) + .generate() + .expect("generate platform proto"); + println!("cargo:rerun-if-changed=./protos"); println!("cargo:rerun-if-env-changed=CARGO_FEATURE_SERDE"); println!("cargo:rerun-if-env-changed=CARGO_CFG_TARGET_ARCH"); @@ -63,7 +73,7 @@ fn configure_platform(mut platform: MappingConfig) -> MappingConfig { // Derive features for versioned messages // // "GetConsensusParamsRequest" is excluded as this message does not support proofs - const VERSIONED_REQUESTS: [&str; 40] = [ + const VERSIONED_REQUESTS: [&str; 39] = [ "GetDataContractHistoryRequest", "GetDataContractRequest", "GetDataContractsRequest", @@ -78,7 +88,6 @@ fn configure_platform(mut platform: MappingConfig) -> MappingConfig { "GetIdentityByPublicKeyHashRequest", "GetIdentityKeysRequest", "GetIdentityRequest", - "GetProofsRequest", "WaitForStateTransitionResultRequest", "GetProtocolVersionUpgradeStateRequest", "GetProtocolVersionUpgradeVoteStatusRequest", @@ -111,7 +120,7 @@ fn configure_platform(mut platform: MappingConfig) -> MappingConfig { // - "GetStatusResponse" // // "GetEvonodesProposedEpochBlocksResponse" is used for 2 Requests - const VERSIONED_RESPONSES: [&str; 39] = [ + const VERSIONED_RESPONSES: [&str; 38] = [ "GetDataContractHistoryResponse", "GetDataContractResponse", "GetDataContractsResponse", @@ -126,7 +135,6 @@ fn configure_platform(mut platform: MappingConfig) -> MappingConfig { "GetIdentityByPublicKeyHashResponse", "GetIdentityKeysResponse", "GetIdentityResponse", - "GetProofsResponse", "WaitForStateTransitionResultResponse", "GetEpochsInfoResponse", "GetProtocolVersionUpgradeStateResponse", @@ -210,6 +218,22 @@ fn configure_platform(mut platform: MappingConfig) -> MappingConfig { platform } +fn configure_drive(drive: MappingConfig) -> MappingConfig { + let platform_proto_path = abs_path(&PathBuf::from("protos/platform/v0")); + + drive + .message_attribute(".", r#"#[derive( ::dapi_grpc_macros::Mockable)]"#) + .type_attribute( + ".", + r#"#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))]"#, + ) + .type_attribute( + ".", + r#"#[cfg_attr(feature = "serde", serde(rename_all = "snake_case"))]"#, + ) + .includes(&[platform_proto_path]) +} + /// Check for duplicate messages in the list. fn check_unique(messages: &[&'static str]) -> Result<(), String> { let mut hashset: HashSet<&'static str> = HashSet::new(); @@ -322,6 +346,14 @@ impl MappingConfig { self } + #[allow(unused)] + fn includes(mut self, includes: &[PathBuf]) -> Self { + for include in includes { + self.proto_includes.push(abs_path(include)); + } + self + } + #[allow(unused)] fn field_attribute(mut self, path: &str, attribute: &str) -> Self { self.builder = self.builder.field_attribute(path, attribute); diff --git a/packages/dapi-grpc/clients/drive/v0/nodejs/DrivePromiseClient.js b/packages/dapi-grpc/clients/drive/v0/nodejs/DrivePromiseClient.js new file mode 100644 index 00000000000..eb6932d5a75 --- /dev/null +++ b/packages/dapi-grpc/clients/drive/v0/nodejs/DrivePromiseClient.js @@ -0,0 +1,111 @@ +const grpc = require('@grpc/grpc-js'); +const { promisify } = require('util'); + +const { + convertObjectToMetadata, + utils: { + isObject, + }, + client: { + interceptors: { + jsonToProtobufInterceptorFactory, + }, + converters: { + jsonToProtobufFactory, + protobufToJsonFactory, + }, + }, +} = require('@dashevo/grpc-common'); + +const { URL } = require('url'); +const { + org: { + dash: { + platform: { + drive: { + v0: { + GetProofsRequest: PBJSGetProofsRequest, + GetProofsResponse: PBJSGetProofsResponse, + }, + }, + }, + }, + }, +} = require('./drive_pbjs'); + +const { + GetProofsResponse: ProtocGetProofsResponse, +} = require('./drive_protoc'); + +const getPlatformDefinition = require('../../../../lib/getPlatformDefinition'); + +const PlatformNodeJSClient = getPlatformDefinition(0); + +class PlatformPromiseClient { + /** + * @param {string} hostname + * @param {?Object} credentials + * @param {?Object} options + */ + constructor(hostname, credentials, options = {}) { + if (credentials !== undefined) { + throw new Error('"credentials" option is not supported yet'); + } + + const url = new URL(hostname); + const { protocol, host: strippedHostname } = url; + + // See this issue https://github.com/nodejs/node/issues/3176 + // eslint-disable-next-line no-param-reassign + credentials = protocol.replace(':', '') === 'https' ? grpc.credentials.createSsl() : grpc.credentials.createInsecure(); + + this.client = new PlatformNodeJSClient(strippedHostname, credentials, options); + + this.client.getProofs = promisify( + this.client.getProofs.bind(this.client), + ); + + this.protocolVersion = undefined; + } + + /** + * + * @param {!GetProofsRequest} request + * @param {?Object} metadata + * @param {CallOptions} [options={}] + * @returns {Promise} + */ + getProofs(request, metadata = {}, options = {}) { + if (!isObject(metadata)) { + throw new Error('metadata must be an object'); + } + + return this.client.getProofs( + request, + convertObjectToMetadata(metadata), + { + interceptors: [ + jsonToProtobufInterceptorFactory( + jsonToProtobufFactory( + ProtocGetProofsResponse, + PBJSGetProofsResponse, + ), + protobufToJsonFactory( + PBJSGetProofsRequest, + ), + ), + ], + ...options, + }, + ); + } + + /** + * @param {string} protocolVersion + */ + setProtocolVersion(protocolVersion) { + this.setProtocolVersion = protocolVersion; + } +} + +module.exports = PlatformPromiseClient; diff --git a/packages/dapi-grpc/clients/drive/v0/nodejs/drive_pbjs.js b/packages/dapi-grpc/clients/drive/v0/nodejs/drive_pbjs.js new file mode 100644 index 00000000000..00f1383ee3d --- /dev/null +++ b/packages/dapi-grpc/clients/drive/v0/nodejs/drive_pbjs.js @@ -0,0 +1,68482 @@ +/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ +"use strict"; + +var $protobuf = require("@dashevo/protobufjs/minimal"); + +// Common aliases +var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; + +// Exported root namespace +var $root = $protobuf.roots.platform_root || ($protobuf.roots.platform_root = {}); + +$root.org = (function() { + + /** + * Namespace org. + * @exports org + * @namespace + */ + var org = {}; + + org.dash = (function() { + + /** + * Namespace dash. + * @memberof org + * @namespace + */ + var dash = {}; + + dash.platform = (function() { + + /** + * Namespace platform. + * @memberof org.dash + * @namespace + */ + var platform = {}; + + platform.drive = (function() { + + /** + * Namespace drive. + * @memberof org.dash.platform + * @namespace + */ + var drive = {}; + + drive.v0 = (function() { + + /** + * Namespace v0. + * @memberof org.dash.platform.drive + * @namespace + */ + var v0 = {}; + + v0.DriveInternal = (function() { + + /** + * Constructs a new DriveInternal service. + * @memberof org.dash.platform.drive.v0 + * @classdesc Represents a DriveInternal + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function DriveInternal(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (DriveInternal.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = DriveInternal; + + /** + * Creates new DriveInternal service using the specified rpc implementation. + * @function create + * @memberof org.dash.platform.drive.v0.DriveInternal + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {DriveInternal} RPC service. Useful where requests and/or responses are streamed. + */ + DriveInternal.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link org.dash.platform.drive.v0.DriveInternal#getProofs}. + * @memberof org.dash.platform.drive.v0.DriveInternal + * @typedef getProofsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.drive.v0.GetProofsResponse} [response] GetProofsResponse + */ + + /** + * Calls getProofs. + * @function getProofs + * @memberof org.dash.platform.drive.v0.DriveInternal + * @instance + * @param {org.dash.platform.drive.v0.IGetProofsRequest} request GetProofsRequest message or plain object + * @param {org.dash.platform.drive.v0.DriveInternal.getProofsCallback} callback Node-style callback called with the error, if any, and GetProofsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DriveInternal.prototype.getProofs = function getProofs(request, callback) { + return this.rpcCall(getProofs, $root.org.dash.platform.drive.v0.GetProofsRequest, $root.org.dash.platform.drive.v0.GetProofsResponse, request, callback); + }, "name", { value: "getProofs" }); + + /** + * Calls getProofs. + * @function getProofs + * @memberof org.dash.platform.drive.v0.DriveInternal + * @instance + * @param {org.dash.platform.drive.v0.IGetProofsRequest} request GetProofsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return DriveInternal; + })(); + + v0.GetProofsRequest = (function() { + + /** + * Properties of a GetProofsRequest. + * @memberof org.dash.platform.drive.v0 + * @interface IGetProofsRequest + * @property {Uint8Array|null} [stateTransition] GetProofsRequest stateTransition + */ + + /** + * Constructs a new GetProofsRequest. + * @memberof org.dash.platform.drive.v0 + * @classdesc Represents a GetProofsRequest. + * @implements IGetProofsRequest + * @constructor + * @param {org.dash.platform.drive.v0.IGetProofsRequest=} [properties] Properties to set + */ + function GetProofsRequest(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]]; + } + + /** + * GetProofsRequest stateTransition. + * @member {Uint8Array} stateTransition + * @memberof org.dash.platform.drive.v0.GetProofsRequest + * @instance + */ + GetProofsRequest.prototype.stateTransition = $util.newBuffer([]); + + /** + * Creates a new GetProofsRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.drive.v0.GetProofsRequest + * @static + * @param {org.dash.platform.drive.v0.IGetProofsRequest=} [properties] Properties to set + * @returns {org.dash.platform.drive.v0.GetProofsRequest} GetProofsRequest instance + */ + GetProofsRequest.create = function create(properties) { + return new GetProofsRequest(properties); + }; + + /** + * Encodes the specified GetProofsRequest message. Does not implicitly {@link org.dash.platform.drive.v0.GetProofsRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.drive.v0.GetProofsRequest + * @static + * @param {org.dash.platform.drive.v0.IGetProofsRequest} message GetProofsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetProofsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.stateTransition != null && Object.hasOwnProperty.call(message, "stateTransition")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.stateTransition); + return writer; + }; + + /** + * Encodes the specified GetProofsRequest message, length delimited. Does not implicitly {@link org.dash.platform.drive.v0.GetProofsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.drive.v0.GetProofsRequest + * @static + * @param {org.dash.platform.drive.v0.IGetProofsRequest} message GetProofsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetProofsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetProofsRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.drive.v0.GetProofsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.drive.v0.GetProofsRequest} GetProofsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetProofsRequest.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.org.dash.platform.drive.v0.GetProofsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.stateTransition = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetProofsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.drive.v0.GetProofsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.drive.v0.GetProofsRequest} GetProofsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetProofsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetProofsRequest message. + * @function verify + * @memberof org.dash.platform.drive.v0.GetProofsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetProofsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.stateTransition != null && message.hasOwnProperty("stateTransition")) + if (!(message.stateTransition && typeof message.stateTransition.length === "number" || $util.isString(message.stateTransition))) + return "stateTransition: buffer expected"; + return null; + }; + + /** + * Creates a GetProofsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.drive.v0.GetProofsRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.drive.v0.GetProofsRequest} GetProofsRequest + */ + GetProofsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.drive.v0.GetProofsRequest) + return object; + var message = new $root.org.dash.platform.drive.v0.GetProofsRequest(); + if (object.stateTransition != null) + if (typeof object.stateTransition === "string") + $util.base64.decode(object.stateTransition, message.stateTransition = $util.newBuffer($util.base64.length(object.stateTransition)), 0); + else if (object.stateTransition.length >= 0) + message.stateTransition = object.stateTransition; + return message; + }; + + /** + * Creates a plain object from a GetProofsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.drive.v0.GetProofsRequest + * @static + * @param {org.dash.platform.drive.v0.GetProofsRequest} message GetProofsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetProofsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if (options.bytes === String) + object.stateTransition = ""; + else { + object.stateTransition = []; + if (options.bytes !== Array) + object.stateTransition = $util.newBuffer(object.stateTransition); + } + if (message.stateTransition != null && message.hasOwnProperty("stateTransition")) + object.stateTransition = options.bytes === String ? $util.base64.encode(message.stateTransition, 0, message.stateTransition.length) : options.bytes === Array ? Array.prototype.slice.call(message.stateTransition) : message.stateTransition; + return object; + }; + + /** + * Converts this GetProofsRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.drive.v0.GetProofsRequest + * @instance + * @returns {Object.} JSON object + */ + GetProofsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetProofsRequest; + })(); + + v0.GetProofsResponse = (function() { + + /** + * Properties of a GetProofsResponse. + * @memberof org.dash.platform.drive.v0 + * @interface IGetProofsResponse + * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetProofsResponse proof + * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetProofsResponse metadata + */ + + /** + * Constructs a new GetProofsResponse. + * @memberof org.dash.platform.drive.v0 + * @classdesc Represents a GetProofsResponse. + * @implements IGetProofsResponse + * @constructor + * @param {org.dash.platform.drive.v0.IGetProofsResponse=} [properties] Properties to set + */ + function GetProofsResponse(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]]; + } + + /** + * GetProofsResponse proof. + * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof + * @memberof org.dash.platform.drive.v0.GetProofsResponse + * @instance + */ + GetProofsResponse.prototype.proof = null; + + /** + * GetProofsResponse metadata. + * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata + * @memberof org.dash.platform.drive.v0.GetProofsResponse + * @instance + */ + GetProofsResponse.prototype.metadata = null; + + /** + * Creates a new GetProofsResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.drive.v0.GetProofsResponse + * @static + * @param {org.dash.platform.drive.v0.IGetProofsResponse=} [properties] Properties to set + * @returns {org.dash.platform.drive.v0.GetProofsResponse} GetProofsResponse instance + */ + GetProofsResponse.create = function create(properties) { + return new GetProofsResponse(properties); + }; + + /** + * Encodes the specified GetProofsResponse message. Does not implicitly {@link org.dash.platform.drive.v0.GetProofsResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.drive.v0.GetProofsResponse + * @static + * @param {org.dash.platform.drive.v0.IGetProofsResponse} message GetProofsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetProofsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetProofsResponse message, length delimited. Does not implicitly {@link org.dash.platform.drive.v0.GetProofsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.drive.v0.GetProofsResponse + * @static + * @param {org.dash.platform.drive.v0.IGetProofsResponse} message GetProofsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetProofsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetProofsResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.drive.v0.GetProofsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.drive.v0.GetProofsResponse} GetProofsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetProofsResponse.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.org.dash.platform.drive.v0.GetProofsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); + break; + case 2: + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetProofsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.drive.v0.GetProofsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.drive.v0.GetProofsResponse} GetProofsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetProofsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetProofsResponse message. + * @function verify + * @memberof org.dash.platform.drive.v0.GetProofsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetProofsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.proof != null && message.hasOwnProperty("proof")) { + var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); + if (error) + return "proof." + error; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a GetProofsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.drive.v0.GetProofsResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.drive.v0.GetProofsResponse} GetProofsResponse + */ + GetProofsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.drive.v0.GetProofsResponse) + return object; + var message = new $root.org.dash.platform.drive.v0.GetProofsResponse(); + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".org.dash.platform.drive.v0.GetProofsResponse.proof: object expected"); + message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".org.dash.platform.drive.v0.GetProofsResponse.metadata: object expected"); + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a GetProofsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.drive.v0.GetProofsResponse + * @static + * @param {org.dash.platform.drive.v0.GetProofsResponse} message GetProofsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetProofsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.proof = null; + object.metadata = null; + } + if (message.proof != null && message.hasOwnProperty("proof")) + object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this GetProofsResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.drive.v0.GetProofsResponse + * @instance + * @returns {Object.} JSON object + */ + GetProofsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetProofsResponse; + })(); + + return v0; + })(); + + return drive; + })(); + + platform.dapi = (function() { + + /** + * Namespace dapi. + * @memberof org.dash.platform + * @namespace + */ + var dapi = {}; + + dapi.v0 = (function() { + + /** + * Namespace v0. + * @memberof org.dash.platform.dapi + * @namespace + */ + var v0 = {}; + + v0.Platform = (function() { + + /** + * Constructs a new Platform service. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a Platform + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Platform(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Platform.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Platform; + + /** + * Creates new Platform service using the specified rpc implementation. + * @function create + * @memberof org.dash.platform.dapi.v0.Platform + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Platform} RPC service. Useful where requests and/or responses are streamed. + */ + Platform.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#broadcastStateTransition}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef broadcastStateTransitionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.BroadcastStateTransitionResponse} [response] BroadcastStateTransitionResponse + */ + + /** + * Calls broadcastStateTransition. + * @function broadcastStateTransition + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IBroadcastStateTransitionRequest} request BroadcastStateTransitionRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.broadcastStateTransitionCallback} callback Node-style callback called with the error, if any, and BroadcastStateTransitionResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.broadcastStateTransition = function broadcastStateTransition(request, callback) { + return this.rpcCall(broadcastStateTransition, $root.org.dash.platform.dapi.v0.BroadcastStateTransitionRequest, $root.org.dash.platform.dapi.v0.BroadcastStateTransitionResponse, request, callback); + }, "name", { value: "broadcastStateTransition" }); + + /** + * Calls broadcastStateTransition. + * @function broadcastStateTransition + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IBroadcastStateTransitionRequest} request BroadcastStateTransitionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getIdentity}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef getIdentityCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.GetIdentityResponse} [response] GetIdentityResponse + */ + + /** + * Calls getIdentity. + * @function getIdentity + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetIdentityRequest} request GetIdentityRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.getIdentityCallback} callback Node-style callback called with the error, if any, and GetIdentityResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.getIdentity = function getIdentity(request, callback) { + return this.rpcCall(getIdentity, $root.org.dash.platform.dapi.v0.GetIdentityRequest, $root.org.dash.platform.dapi.v0.GetIdentityResponse, request, callback); + }, "name", { value: "getIdentity" }); + + /** + * Calls getIdentity. + * @function getIdentity + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetIdentityRequest} request GetIdentityRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getIdentityKeys}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef getIdentityKeysCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.GetIdentityKeysResponse} [response] GetIdentityKeysResponse + */ + + /** + * Calls getIdentityKeys. + * @function getIdentityKeys + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetIdentityKeysRequest} request GetIdentityKeysRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.getIdentityKeysCallback} callback Node-style callback called with the error, if any, and GetIdentityKeysResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.getIdentityKeys = function getIdentityKeys(request, callback) { + return this.rpcCall(getIdentityKeys, $root.org.dash.platform.dapi.v0.GetIdentityKeysRequest, $root.org.dash.platform.dapi.v0.GetIdentityKeysResponse, request, callback); + }, "name", { value: "getIdentityKeys" }); + + /** + * Calls getIdentityKeys. + * @function getIdentityKeys + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetIdentityKeysRequest} request GetIdentityKeysRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getIdentitiesContractKeys}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef getIdentitiesContractKeysCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse} [response] GetIdentitiesContractKeysResponse + */ + + /** + * Calls getIdentitiesContractKeys. + * @function getIdentitiesContractKeys + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetIdentitiesContractKeysRequest} request GetIdentitiesContractKeysRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.getIdentitiesContractKeysCallback} callback Node-style callback called with the error, if any, and GetIdentitiesContractKeysResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.getIdentitiesContractKeys = function getIdentitiesContractKeys(request, callback) { + return this.rpcCall(getIdentitiesContractKeys, $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest, $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse, request, callback); + }, "name", { value: "getIdentitiesContractKeys" }); + + /** + * Calls getIdentitiesContractKeys. + * @function getIdentitiesContractKeys + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetIdentitiesContractKeysRequest} request GetIdentitiesContractKeysRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getIdentityNonce}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef getIdentityNonceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.GetIdentityNonceResponse} [response] GetIdentityNonceResponse + */ + + /** + * Calls getIdentityNonce. + * @function getIdentityNonce + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetIdentityNonceRequest} request GetIdentityNonceRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.getIdentityNonceCallback} callback Node-style callback called with the error, if any, and GetIdentityNonceResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.getIdentityNonce = function getIdentityNonce(request, callback) { + return this.rpcCall(getIdentityNonce, $root.org.dash.platform.dapi.v0.GetIdentityNonceRequest, $root.org.dash.platform.dapi.v0.GetIdentityNonceResponse, request, callback); + }, "name", { value: "getIdentityNonce" }); + + /** + * Calls getIdentityNonce. + * @function getIdentityNonce + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetIdentityNonceRequest} request GetIdentityNonceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getIdentityContractNonce}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef getIdentityContractNonceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.GetIdentityContractNonceResponse} [response] GetIdentityContractNonceResponse + */ + + /** + * Calls getIdentityContractNonce. + * @function getIdentityContractNonce + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetIdentityContractNonceRequest} request GetIdentityContractNonceRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.getIdentityContractNonceCallback} callback Node-style callback called with the error, if any, and GetIdentityContractNonceResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.getIdentityContractNonce = function getIdentityContractNonce(request, callback) { + return this.rpcCall(getIdentityContractNonce, $root.org.dash.platform.dapi.v0.GetIdentityContractNonceRequest, $root.org.dash.platform.dapi.v0.GetIdentityContractNonceResponse, request, callback); + }, "name", { value: "getIdentityContractNonce" }); + + /** + * Calls getIdentityContractNonce. + * @function getIdentityContractNonce + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetIdentityContractNonceRequest} request GetIdentityContractNonceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getIdentityBalance}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef getIdentityBalanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.GetIdentityBalanceResponse} [response] GetIdentityBalanceResponse + */ + + /** + * Calls getIdentityBalance. + * @function getIdentityBalance + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetIdentityBalanceRequest} request GetIdentityBalanceRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.getIdentityBalanceCallback} callback Node-style callback called with the error, if any, and GetIdentityBalanceResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.getIdentityBalance = function getIdentityBalance(request, callback) { + return this.rpcCall(getIdentityBalance, $root.org.dash.platform.dapi.v0.GetIdentityBalanceRequest, $root.org.dash.platform.dapi.v0.GetIdentityBalanceResponse, request, callback); + }, "name", { value: "getIdentityBalance" }); + + /** + * Calls getIdentityBalance. + * @function getIdentityBalance + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetIdentityBalanceRequest} request GetIdentityBalanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getIdentitiesBalances}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef getIdentitiesBalancesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse} [response] GetIdentitiesBalancesResponse + */ + + /** + * Calls getIdentitiesBalances. + * @function getIdentitiesBalances + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetIdentitiesBalancesRequest} request GetIdentitiesBalancesRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.getIdentitiesBalancesCallback} callback Node-style callback called with the error, if any, and GetIdentitiesBalancesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.getIdentitiesBalances = function getIdentitiesBalances(request, callback) { + return this.rpcCall(getIdentitiesBalances, $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest, $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse, request, callback); + }, "name", { value: "getIdentitiesBalances" }); + + /** + * Calls getIdentitiesBalances. + * @function getIdentitiesBalances + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetIdentitiesBalancesRequest} request GetIdentitiesBalancesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getIdentityBalanceAndRevision}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef getIdentityBalanceAndRevisionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse} [response] GetIdentityBalanceAndRevisionResponse + */ + + /** + * Calls getIdentityBalanceAndRevision. + * @function getIdentityBalanceAndRevision + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetIdentityBalanceAndRevisionRequest} request GetIdentityBalanceAndRevisionRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.getIdentityBalanceAndRevisionCallback} callback Node-style callback called with the error, if any, and GetIdentityBalanceAndRevisionResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.getIdentityBalanceAndRevision = function getIdentityBalanceAndRevision(request, callback) { + return this.rpcCall(getIdentityBalanceAndRevision, $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest, $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse, request, callback); + }, "name", { value: "getIdentityBalanceAndRevision" }); + + /** + * Calls getIdentityBalanceAndRevision. + * @function getIdentityBalanceAndRevision + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetIdentityBalanceAndRevisionRequest} request GetIdentityBalanceAndRevisionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getEvonodesProposedEpochBlocksByIds}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef getEvonodesProposedEpochBlocksByIdsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse} [response] GetEvonodesProposedEpochBlocksResponse + */ + + /** + * Calls getEvonodesProposedEpochBlocksByIds. + * @function getEvonodesProposedEpochBlocksByIds + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetEvonodesProposedEpochBlocksByIdsRequest} request GetEvonodesProposedEpochBlocksByIdsRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.getEvonodesProposedEpochBlocksByIdsCallback} callback Node-style callback called with the error, if any, and GetEvonodesProposedEpochBlocksResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.getEvonodesProposedEpochBlocksByIds = function getEvonodesProposedEpochBlocksByIds(request, callback) { + return this.rpcCall(getEvonodesProposedEpochBlocksByIds, $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest, $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse, request, callback); + }, "name", { value: "getEvonodesProposedEpochBlocksByIds" }); + + /** + * Calls getEvonodesProposedEpochBlocksByIds. + * @function getEvonodesProposedEpochBlocksByIds + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetEvonodesProposedEpochBlocksByIdsRequest} request GetEvonodesProposedEpochBlocksByIdsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getEvonodesProposedEpochBlocksByRange}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef getEvonodesProposedEpochBlocksByRangeCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse} [response] GetEvonodesProposedEpochBlocksResponse + */ + + /** + * Calls getEvonodesProposedEpochBlocksByRange. + * @function getEvonodesProposedEpochBlocksByRange + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetEvonodesProposedEpochBlocksByRangeRequest} request GetEvonodesProposedEpochBlocksByRangeRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.getEvonodesProposedEpochBlocksByRangeCallback} callback Node-style callback called with the error, if any, and GetEvonodesProposedEpochBlocksResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.getEvonodesProposedEpochBlocksByRange = function getEvonodesProposedEpochBlocksByRange(request, callback) { + return this.rpcCall(getEvonodesProposedEpochBlocksByRange, $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest, $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse, request, callback); + }, "name", { value: "getEvonodesProposedEpochBlocksByRange" }); + + /** + * Calls getEvonodesProposedEpochBlocksByRange. + * @function getEvonodesProposedEpochBlocksByRange + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetEvonodesProposedEpochBlocksByRangeRequest} request GetEvonodesProposedEpochBlocksByRangeRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getDataContract}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef getDataContractCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.GetDataContractResponse} [response] GetDataContractResponse + */ + + /** + * Calls getDataContract. + * @function getDataContract + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetDataContractRequest} request GetDataContractRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.getDataContractCallback} callback Node-style callback called with the error, if any, and GetDataContractResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.getDataContract = function getDataContract(request, callback) { + return this.rpcCall(getDataContract, $root.org.dash.platform.dapi.v0.GetDataContractRequest, $root.org.dash.platform.dapi.v0.GetDataContractResponse, request, callback); + }, "name", { value: "getDataContract" }); + + /** + * Calls getDataContract. + * @function getDataContract + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetDataContractRequest} request GetDataContractRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getDataContractHistory}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef getDataContractHistoryCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.GetDataContractHistoryResponse} [response] GetDataContractHistoryResponse + */ + + /** + * Calls getDataContractHistory. + * @function getDataContractHistory + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetDataContractHistoryRequest} request GetDataContractHistoryRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.getDataContractHistoryCallback} callback Node-style callback called with the error, if any, and GetDataContractHistoryResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.getDataContractHistory = function getDataContractHistory(request, callback) { + return this.rpcCall(getDataContractHistory, $root.org.dash.platform.dapi.v0.GetDataContractHistoryRequest, $root.org.dash.platform.dapi.v0.GetDataContractHistoryResponse, request, callback); + }, "name", { value: "getDataContractHistory" }); + + /** + * Calls getDataContractHistory. + * @function getDataContractHistory + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetDataContractHistoryRequest} request GetDataContractHistoryRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getDataContracts}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef getDataContractsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.GetDataContractsResponse} [response] GetDataContractsResponse + */ + + /** + * Calls getDataContracts. + * @function getDataContracts + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetDataContractsRequest} request GetDataContractsRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.getDataContractsCallback} callback Node-style callback called with the error, if any, and GetDataContractsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.getDataContracts = function getDataContracts(request, callback) { + return this.rpcCall(getDataContracts, $root.org.dash.platform.dapi.v0.GetDataContractsRequest, $root.org.dash.platform.dapi.v0.GetDataContractsResponse, request, callback); + }, "name", { value: "getDataContracts" }); + + /** + * Calls getDataContracts. + * @function getDataContracts + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetDataContractsRequest} request GetDataContractsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getDocuments}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef getDocumentsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.GetDocumentsResponse} [response] GetDocumentsResponse + */ + + /** + * Calls getDocuments. + * @function getDocuments + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetDocumentsRequest} request GetDocumentsRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.getDocumentsCallback} callback Node-style callback called with the error, if any, and GetDocumentsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.getDocuments = function getDocuments(request, callback) { + return this.rpcCall(getDocuments, $root.org.dash.platform.dapi.v0.GetDocumentsRequest, $root.org.dash.platform.dapi.v0.GetDocumentsResponse, request, callback); + }, "name", { value: "getDocuments" }); + + /** + * Calls getDocuments. + * @function getDocuments + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetDocumentsRequest} request GetDocumentsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getIdentityByPublicKeyHash}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef getIdentityByPublicKeyHashCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse} [response] GetIdentityByPublicKeyHashResponse + */ + + /** + * Calls getIdentityByPublicKeyHash. + * @function getIdentityByPublicKeyHash + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetIdentityByPublicKeyHashRequest} request GetIdentityByPublicKeyHashRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.getIdentityByPublicKeyHashCallback} callback Node-style callback called with the error, if any, and GetIdentityByPublicKeyHashResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.getIdentityByPublicKeyHash = function getIdentityByPublicKeyHash(request, callback) { + return this.rpcCall(getIdentityByPublicKeyHash, $root.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest, $root.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse, request, callback); + }, "name", { value: "getIdentityByPublicKeyHash" }); + + /** + * Calls getIdentityByPublicKeyHash. + * @function getIdentityByPublicKeyHash + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetIdentityByPublicKeyHashRequest} request GetIdentityByPublicKeyHashRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#waitForStateTransitionResult}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef waitForStateTransitionResultCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse} [response] WaitForStateTransitionResultResponse + */ + + /** + * Calls waitForStateTransitionResult. + * @function waitForStateTransitionResult + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IWaitForStateTransitionResultRequest} request WaitForStateTransitionResultRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.waitForStateTransitionResultCallback} callback Node-style callback called with the error, if any, and WaitForStateTransitionResultResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.waitForStateTransitionResult = function waitForStateTransitionResult(request, callback) { + return this.rpcCall(waitForStateTransitionResult, $root.org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest, $root.org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse, request, callback); + }, "name", { value: "waitForStateTransitionResult" }); + + /** + * Calls waitForStateTransitionResult. + * @function waitForStateTransitionResult + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IWaitForStateTransitionResultRequest} request WaitForStateTransitionResultRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getConsensusParams}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef getConsensusParamsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.GetConsensusParamsResponse} [response] GetConsensusParamsResponse + */ + + /** + * Calls getConsensusParams. + * @function getConsensusParams + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetConsensusParamsRequest} request GetConsensusParamsRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.getConsensusParamsCallback} callback Node-style callback called with the error, if any, and GetConsensusParamsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.getConsensusParams = function getConsensusParams(request, callback) { + return this.rpcCall(getConsensusParams, $root.org.dash.platform.dapi.v0.GetConsensusParamsRequest, $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse, request, callback); + }, "name", { value: "getConsensusParams" }); + + /** + * Calls getConsensusParams. + * @function getConsensusParams + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetConsensusParamsRequest} request GetConsensusParamsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getProtocolVersionUpgradeState}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef getProtocolVersionUpgradeStateCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse} [response] GetProtocolVersionUpgradeStateResponse + */ + + /** + * Calls getProtocolVersionUpgradeState. + * @function getProtocolVersionUpgradeState + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetProtocolVersionUpgradeStateRequest} request GetProtocolVersionUpgradeStateRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.getProtocolVersionUpgradeStateCallback} callback Node-style callback called with the error, if any, and GetProtocolVersionUpgradeStateResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.getProtocolVersionUpgradeState = function getProtocolVersionUpgradeState(request, callback) { + return this.rpcCall(getProtocolVersionUpgradeState, $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest, $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse, request, callback); + }, "name", { value: "getProtocolVersionUpgradeState" }); + + /** + * Calls getProtocolVersionUpgradeState. + * @function getProtocolVersionUpgradeState + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetProtocolVersionUpgradeStateRequest} request GetProtocolVersionUpgradeStateRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getProtocolVersionUpgradeVoteStatus}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef getProtocolVersionUpgradeVoteStatusCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse} [response] GetProtocolVersionUpgradeVoteStatusResponse + */ + + /** + * Calls getProtocolVersionUpgradeVoteStatus. + * @function getProtocolVersionUpgradeVoteStatus + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetProtocolVersionUpgradeVoteStatusRequest} request GetProtocolVersionUpgradeVoteStatusRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.getProtocolVersionUpgradeVoteStatusCallback} callback Node-style callback called with the error, if any, and GetProtocolVersionUpgradeVoteStatusResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.getProtocolVersionUpgradeVoteStatus = function getProtocolVersionUpgradeVoteStatus(request, callback) { + return this.rpcCall(getProtocolVersionUpgradeVoteStatus, $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest, $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse, request, callback); + }, "name", { value: "getProtocolVersionUpgradeVoteStatus" }); + + /** + * Calls getProtocolVersionUpgradeVoteStatus. + * @function getProtocolVersionUpgradeVoteStatus + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetProtocolVersionUpgradeVoteStatusRequest} request GetProtocolVersionUpgradeVoteStatusRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getEpochsInfo}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef getEpochsInfoCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.GetEpochsInfoResponse} [response] GetEpochsInfoResponse + */ + + /** + * Calls getEpochsInfo. + * @function getEpochsInfo + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetEpochsInfoRequest} request GetEpochsInfoRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.getEpochsInfoCallback} callback Node-style callback called with the error, if any, and GetEpochsInfoResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.getEpochsInfo = function getEpochsInfo(request, callback) { + return this.rpcCall(getEpochsInfo, $root.org.dash.platform.dapi.v0.GetEpochsInfoRequest, $root.org.dash.platform.dapi.v0.GetEpochsInfoResponse, request, callback); + }, "name", { value: "getEpochsInfo" }); + + /** + * Calls getEpochsInfo. + * @function getEpochsInfo + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetEpochsInfoRequest} request GetEpochsInfoRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getContestedResources}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef getContestedResourcesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.GetContestedResourcesResponse} [response] GetContestedResourcesResponse + */ + + /** + * Calls getContestedResources. + * @function getContestedResources + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetContestedResourcesRequest} request GetContestedResourcesRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.getContestedResourcesCallback} callback Node-style callback called with the error, if any, and GetContestedResourcesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.getContestedResources = function getContestedResources(request, callback) { + return this.rpcCall(getContestedResources, $root.org.dash.platform.dapi.v0.GetContestedResourcesRequest, $root.org.dash.platform.dapi.v0.GetContestedResourcesResponse, request, callback); + }, "name", { value: "getContestedResources" }); + + /** + * Calls getContestedResources. + * @function getContestedResources + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetContestedResourcesRequest} request GetContestedResourcesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getContestedResourceVoteState}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef getContestedResourceVoteStateCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse} [response] GetContestedResourceVoteStateResponse + */ + + /** + * Calls getContestedResourceVoteState. + * @function getContestedResourceVoteState + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetContestedResourceVoteStateRequest} request GetContestedResourceVoteStateRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.getContestedResourceVoteStateCallback} callback Node-style callback called with the error, if any, and GetContestedResourceVoteStateResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.getContestedResourceVoteState = function getContestedResourceVoteState(request, callback) { + return this.rpcCall(getContestedResourceVoteState, $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest, $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse, request, callback); + }, "name", { value: "getContestedResourceVoteState" }); + + /** + * Calls getContestedResourceVoteState. + * @function getContestedResourceVoteState + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetContestedResourceVoteStateRequest} request GetContestedResourceVoteStateRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getContestedResourceVotersForIdentity}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef getContestedResourceVotersForIdentityCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse} [response] GetContestedResourceVotersForIdentityResponse + */ + + /** + * Calls getContestedResourceVotersForIdentity. + * @function getContestedResourceVotersForIdentity + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetContestedResourceVotersForIdentityRequest} request GetContestedResourceVotersForIdentityRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.getContestedResourceVotersForIdentityCallback} callback Node-style callback called with the error, if any, and GetContestedResourceVotersForIdentityResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.getContestedResourceVotersForIdentity = function getContestedResourceVotersForIdentity(request, callback) { + return this.rpcCall(getContestedResourceVotersForIdentity, $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest, $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse, request, callback); + }, "name", { value: "getContestedResourceVotersForIdentity" }); + + /** + * Calls getContestedResourceVotersForIdentity. + * @function getContestedResourceVotersForIdentity + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetContestedResourceVotersForIdentityRequest} request GetContestedResourceVotersForIdentityRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getContestedResourceIdentityVotes}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef getContestedResourceIdentityVotesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse} [response] GetContestedResourceIdentityVotesResponse + */ + + /** + * Calls getContestedResourceIdentityVotes. + * @function getContestedResourceIdentityVotes + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetContestedResourceIdentityVotesRequest} request GetContestedResourceIdentityVotesRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.getContestedResourceIdentityVotesCallback} callback Node-style callback called with the error, if any, and GetContestedResourceIdentityVotesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.getContestedResourceIdentityVotes = function getContestedResourceIdentityVotes(request, callback) { + return this.rpcCall(getContestedResourceIdentityVotes, $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest, $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse, request, callback); + }, "name", { value: "getContestedResourceIdentityVotes" }); + + /** + * Calls getContestedResourceIdentityVotes. + * @function getContestedResourceIdentityVotes + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetContestedResourceIdentityVotesRequest} request GetContestedResourceIdentityVotesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getVotePollsByEndDate}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef getVotePollsByEndDateCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse} [response] GetVotePollsByEndDateResponse + */ + + /** + * Calls getVotePollsByEndDate. + * @function getVotePollsByEndDate + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetVotePollsByEndDateRequest} request GetVotePollsByEndDateRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.getVotePollsByEndDateCallback} callback Node-style callback called with the error, if any, and GetVotePollsByEndDateResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.getVotePollsByEndDate = function getVotePollsByEndDate(request, callback) { + return this.rpcCall(getVotePollsByEndDate, $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest, $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse, request, callback); + }, "name", { value: "getVotePollsByEndDate" }); + + /** + * Calls getVotePollsByEndDate. + * @function getVotePollsByEndDate + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetVotePollsByEndDateRequest} request GetVotePollsByEndDateRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getPrefundedSpecializedBalance}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef getPrefundedSpecializedBalanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse} [response] GetPrefundedSpecializedBalanceResponse + */ + + /** + * Calls getPrefundedSpecializedBalance. + * @function getPrefundedSpecializedBalance + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetPrefundedSpecializedBalanceRequest} request GetPrefundedSpecializedBalanceRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.getPrefundedSpecializedBalanceCallback} callback Node-style callback called with the error, if any, and GetPrefundedSpecializedBalanceResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.getPrefundedSpecializedBalance = function getPrefundedSpecializedBalance(request, callback) { + return this.rpcCall(getPrefundedSpecializedBalance, $root.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest, $root.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse, request, callback); + }, "name", { value: "getPrefundedSpecializedBalance" }); + + /** + * Calls getPrefundedSpecializedBalance. + * @function getPrefundedSpecializedBalance + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetPrefundedSpecializedBalanceRequest} request GetPrefundedSpecializedBalanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getTotalCreditsInPlatform}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef getTotalCreditsInPlatformCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse} [response] GetTotalCreditsInPlatformResponse + */ + + /** + * Calls getTotalCreditsInPlatform. + * @function getTotalCreditsInPlatform + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetTotalCreditsInPlatformRequest} request GetTotalCreditsInPlatformRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.getTotalCreditsInPlatformCallback} callback Node-style callback called with the error, if any, and GetTotalCreditsInPlatformResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.getTotalCreditsInPlatform = function getTotalCreditsInPlatform(request, callback) { + return this.rpcCall(getTotalCreditsInPlatform, $root.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest, $root.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse, request, callback); + }, "name", { value: "getTotalCreditsInPlatform" }); + + /** + * Calls getTotalCreditsInPlatform. + * @function getTotalCreditsInPlatform + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetTotalCreditsInPlatformRequest} request GetTotalCreditsInPlatformRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getPathElements}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef getPathElementsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.GetPathElementsResponse} [response] GetPathElementsResponse + */ + + /** + * Calls getPathElements. + * @function getPathElements + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetPathElementsRequest} request GetPathElementsRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.getPathElementsCallback} callback Node-style callback called with the error, if any, and GetPathElementsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.getPathElements = function getPathElements(request, callback) { + return this.rpcCall(getPathElements, $root.org.dash.platform.dapi.v0.GetPathElementsRequest, $root.org.dash.platform.dapi.v0.GetPathElementsResponse, request, callback); + }, "name", { value: "getPathElements" }); + + /** + * Calls getPathElements. + * @function getPathElements + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetPathElementsRequest} request GetPathElementsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getStatus}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef getStatusCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.GetStatusResponse} [response] GetStatusResponse + */ + + /** + * Calls getStatus. + * @function getStatus + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetStatusRequest} request GetStatusRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.getStatusCallback} callback Node-style callback called with the error, if any, and GetStatusResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.getStatus = function getStatus(request, callback) { + return this.rpcCall(getStatus, $root.org.dash.platform.dapi.v0.GetStatusRequest, $root.org.dash.platform.dapi.v0.GetStatusResponse, request, callback); + }, "name", { value: "getStatus" }); + + /** + * Calls getStatus. + * @function getStatus + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetStatusRequest} request GetStatusRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getCurrentQuorumsInfo}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef getCurrentQuorumsInfoCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse} [response] GetCurrentQuorumsInfoResponse + */ + + /** + * Calls getCurrentQuorumsInfo. + * @function getCurrentQuorumsInfo + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetCurrentQuorumsInfoRequest} request GetCurrentQuorumsInfoRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.getCurrentQuorumsInfoCallback} callback Node-style callback called with the error, if any, and GetCurrentQuorumsInfoResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.getCurrentQuorumsInfo = function getCurrentQuorumsInfo(request, callback) { + return this.rpcCall(getCurrentQuorumsInfo, $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest, $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse, request, callback); + }, "name", { value: "getCurrentQuorumsInfo" }); + + /** + * Calls getCurrentQuorumsInfo. + * @function getCurrentQuorumsInfo + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetCurrentQuorumsInfoRequest} request GetCurrentQuorumsInfoRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getIdentityTokenBalances}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef getIdentityTokenBalancesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse} [response] GetIdentityTokenBalancesResponse + */ + + /** + * Calls getIdentityTokenBalances. + * @function getIdentityTokenBalances + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetIdentityTokenBalancesRequest} request GetIdentityTokenBalancesRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.getIdentityTokenBalancesCallback} callback Node-style callback called with the error, if any, and GetIdentityTokenBalancesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.getIdentityTokenBalances = function getIdentityTokenBalances(request, callback) { + return this.rpcCall(getIdentityTokenBalances, $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest, $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse, request, callback); + }, "name", { value: "getIdentityTokenBalances" }); + + /** + * Calls getIdentityTokenBalances. + * @function getIdentityTokenBalances + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetIdentityTokenBalancesRequest} request GetIdentityTokenBalancesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getIdentitiesTokenBalances}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef getIdentitiesTokenBalancesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse} [response] GetIdentitiesTokenBalancesResponse + */ + + /** + * Calls getIdentitiesTokenBalances. + * @function getIdentitiesTokenBalances + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetIdentitiesTokenBalancesRequest} request GetIdentitiesTokenBalancesRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.getIdentitiesTokenBalancesCallback} callback Node-style callback called with the error, if any, and GetIdentitiesTokenBalancesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.getIdentitiesTokenBalances = function getIdentitiesTokenBalances(request, callback) { + return this.rpcCall(getIdentitiesTokenBalances, $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest, $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse, request, callback); + }, "name", { value: "getIdentitiesTokenBalances" }); + + /** + * Calls getIdentitiesTokenBalances. + * @function getIdentitiesTokenBalances + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetIdentitiesTokenBalancesRequest} request GetIdentitiesTokenBalancesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getIdentityTokenInfos}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef getIdentityTokenInfosCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse} [response] GetIdentityTokenInfosResponse + */ + + /** + * Calls getIdentityTokenInfos. + * @function getIdentityTokenInfos + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetIdentityTokenInfosRequest} request GetIdentityTokenInfosRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.getIdentityTokenInfosCallback} callback Node-style callback called with the error, if any, and GetIdentityTokenInfosResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.getIdentityTokenInfos = function getIdentityTokenInfos(request, callback) { + return this.rpcCall(getIdentityTokenInfos, $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest, $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse, request, callback); + }, "name", { value: "getIdentityTokenInfos" }); + + /** + * Calls getIdentityTokenInfos. + * @function getIdentityTokenInfos + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetIdentityTokenInfosRequest} request GetIdentityTokenInfosRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getIdentitiesTokenInfos}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef getIdentitiesTokenInfosCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse} [response] GetIdentitiesTokenInfosResponse + */ + + /** + * Calls getIdentitiesTokenInfos. + * @function getIdentitiesTokenInfos + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetIdentitiesTokenInfosRequest} request GetIdentitiesTokenInfosRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.getIdentitiesTokenInfosCallback} callback Node-style callback called with the error, if any, and GetIdentitiesTokenInfosResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.getIdentitiesTokenInfos = function getIdentitiesTokenInfos(request, callback) { + return this.rpcCall(getIdentitiesTokenInfos, $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest, $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse, request, callback); + }, "name", { value: "getIdentitiesTokenInfos" }); + + /** + * Calls getIdentitiesTokenInfos. + * @function getIdentitiesTokenInfos + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetIdentitiesTokenInfosRequest} request GetIdentitiesTokenInfosRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getTokenStatuses}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef getTokenStatusesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.GetTokenStatusesResponse} [response] GetTokenStatusesResponse + */ + + /** + * Calls getTokenStatuses. + * @function getTokenStatuses + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetTokenStatusesRequest} request GetTokenStatusesRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.getTokenStatusesCallback} callback Node-style callback called with the error, if any, and GetTokenStatusesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.getTokenStatuses = function getTokenStatuses(request, callback) { + return this.rpcCall(getTokenStatuses, $root.org.dash.platform.dapi.v0.GetTokenStatusesRequest, $root.org.dash.platform.dapi.v0.GetTokenStatusesResponse, request, callback); + }, "name", { value: "getTokenStatuses" }); + + /** + * Calls getTokenStatuses. + * @function getTokenStatuses + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetTokenStatusesRequest} request GetTokenStatusesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getTokenPreProgrammedDistributions}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef getTokenPreProgrammedDistributionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse} [response] GetTokenPreProgrammedDistributionsResponse + */ + + /** + * Calls getTokenPreProgrammedDistributions. + * @function getTokenPreProgrammedDistributions + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetTokenPreProgrammedDistributionsRequest} request GetTokenPreProgrammedDistributionsRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.getTokenPreProgrammedDistributionsCallback} callback Node-style callback called with the error, if any, and GetTokenPreProgrammedDistributionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.getTokenPreProgrammedDistributions = function getTokenPreProgrammedDistributions(request, callback) { + return this.rpcCall(getTokenPreProgrammedDistributions, $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest, $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse, request, callback); + }, "name", { value: "getTokenPreProgrammedDistributions" }); + + /** + * Calls getTokenPreProgrammedDistributions. + * @function getTokenPreProgrammedDistributions + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetTokenPreProgrammedDistributionsRequest} request GetTokenPreProgrammedDistributionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getTokenTotalSupply}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef getTokenTotalSupplyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse} [response] GetTokenTotalSupplyResponse + */ + + /** + * Calls getTokenTotalSupply. + * @function getTokenTotalSupply + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetTokenTotalSupplyRequest} request GetTokenTotalSupplyRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.getTokenTotalSupplyCallback} callback Node-style callback called with the error, if any, and GetTokenTotalSupplyResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.getTokenTotalSupply = function getTokenTotalSupply(request, callback) { + return this.rpcCall(getTokenTotalSupply, $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest, $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse, request, callback); + }, "name", { value: "getTokenTotalSupply" }); + + /** + * Calls getTokenTotalSupply. + * @function getTokenTotalSupply + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetTokenTotalSupplyRequest} request GetTokenTotalSupplyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getGroupInfo}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef getGroupInfoCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.GetGroupInfoResponse} [response] GetGroupInfoResponse + */ + + /** + * Calls getGroupInfo. + * @function getGroupInfo + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetGroupInfoRequest} request GetGroupInfoRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.getGroupInfoCallback} callback Node-style callback called with the error, if any, and GetGroupInfoResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.getGroupInfo = function getGroupInfo(request, callback) { + return this.rpcCall(getGroupInfo, $root.org.dash.platform.dapi.v0.GetGroupInfoRequest, $root.org.dash.platform.dapi.v0.GetGroupInfoResponse, request, callback); + }, "name", { value: "getGroupInfo" }); + + /** + * Calls getGroupInfo. + * @function getGroupInfo + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetGroupInfoRequest} request GetGroupInfoRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getGroupInfos}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef getGroupInfosCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.GetGroupInfosResponse} [response] GetGroupInfosResponse + */ + + /** + * Calls getGroupInfos. + * @function getGroupInfos + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetGroupInfosRequest} request GetGroupInfosRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.getGroupInfosCallback} callback Node-style callback called with the error, if any, and GetGroupInfosResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.getGroupInfos = function getGroupInfos(request, callback) { + return this.rpcCall(getGroupInfos, $root.org.dash.platform.dapi.v0.GetGroupInfosRequest, $root.org.dash.platform.dapi.v0.GetGroupInfosResponse, request, callback); + }, "name", { value: "getGroupInfos" }); + + /** + * Calls getGroupInfos. + * @function getGroupInfos + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetGroupInfosRequest} request GetGroupInfosRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getGroupActions}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef getGroupActionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse} [response] GetGroupActionsResponse + */ + + /** + * Calls getGroupActions. + * @function getGroupActions + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetGroupActionsRequest} request GetGroupActionsRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.getGroupActionsCallback} callback Node-style callback called with the error, if any, and GetGroupActionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.getGroupActions = function getGroupActions(request, callback) { + return this.rpcCall(getGroupActions, $root.org.dash.platform.dapi.v0.GetGroupActionsRequest, $root.org.dash.platform.dapi.v0.GetGroupActionsResponse, request, callback); + }, "name", { value: "getGroupActions" }); + + /** + * Calls getGroupActions. + * @function getGroupActions + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetGroupActionsRequest} request GetGroupActionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getGroupActionSigners}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef getGroupActionSignersCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.GetGroupActionSignersResponse} [response] GetGroupActionSignersResponse + */ + + /** + * Calls getGroupActionSigners. + * @function getGroupActionSigners + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetGroupActionSignersRequest} request GetGroupActionSignersRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.getGroupActionSignersCallback} callback Node-style callback called with the error, if any, and GetGroupActionSignersResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.getGroupActionSigners = function getGroupActionSigners(request, callback) { + return this.rpcCall(getGroupActionSigners, $root.org.dash.platform.dapi.v0.GetGroupActionSignersRequest, $root.org.dash.platform.dapi.v0.GetGroupActionSignersResponse, request, callback); + }, "name", { value: "getGroupActionSigners" }); + + /** + * Calls getGroupActionSigners. + * @function getGroupActionSigners + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetGroupActionSignersRequest} request GetGroupActionSignersRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Platform; + })(); + + v0.Proof = (function() { + + /** + * Properties of a Proof. + * @memberof org.dash.platform.dapi.v0 + * @interface IProof + * @property {Uint8Array|null} [grovedbProof] Proof grovedbProof + * @property {Uint8Array|null} [quorumHash] Proof quorumHash + * @property {Uint8Array|null} [signature] Proof signature + * @property {number|null} [round] Proof round + * @property {Uint8Array|null} [blockIdHash] Proof blockIdHash + * @property {number|null} [quorumType] Proof quorumType + */ + + /** + * Constructs a new Proof. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a Proof. + * @implements IProof + * @constructor + * @param {org.dash.platform.dapi.v0.IProof=} [properties] Properties to set + */ + function Proof(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]]; + } + + /** + * Proof grovedbProof. + * @member {Uint8Array} grovedbProof + * @memberof org.dash.platform.dapi.v0.Proof + * @instance + */ + Proof.prototype.grovedbProof = $util.newBuffer([]); + + /** + * Proof quorumHash. + * @member {Uint8Array} quorumHash + * @memberof org.dash.platform.dapi.v0.Proof + * @instance + */ + Proof.prototype.quorumHash = $util.newBuffer([]); + + /** + * Proof signature. + * @member {Uint8Array} signature + * @memberof org.dash.platform.dapi.v0.Proof + * @instance + */ + Proof.prototype.signature = $util.newBuffer([]); + + /** + * Proof round. + * @member {number} round + * @memberof org.dash.platform.dapi.v0.Proof + * @instance + */ + Proof.prototype.round = 0; + + /** + * Proof blockIdHash. + * @member {Uint8Array} blockIdHash + * @memberof org.dash.platform.dapi.v0.Proof + * @instance + */ + Proof.prototype.blockIdHash = $util.newBuffer([]); + + /** + * Proof quorumType. + * @member {number} quorumType + * @memberof org.dash.platform.dapi.v0.Proof + * @instance + */ + Proof.prototype.quorumType = 0; + + /** + * Creates a new Proof instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.Proof + * @static + * @param {org.dash.platform.dapi.v0.IProof=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.Proof} Proof instance + */ + Proof.create = function create(properties) { + return new Proof(properties); + }; + + /** + * Encodes the specified Proof message. Does not implicitly {@link org.dash.platform.dapi.v0.Proof.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.Proof + * @static + * @param {org.dash.platform.dapi.v0.IProof} message Proof message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Proof.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.grovedbProof != null && Object.hasOwnProperty.call(message, "grovedbProof")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.grovedbProof); + if (message.quorumHash != null && Object.hasOwnProperty.call(message, "quorumHash")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.quorumHash); + if (message.signature != null && Object.hasOwnProperty.call(message, "signature")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.signature); + if (message.round != null && Object.hasOwnProperty.call(message, "round")) + writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.round); + if (message.blockIdHash != null && Object.hasOwnProperty.call(message, "blockIdHash")) + writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.blockIdHash); + if (message.quorumType != null && Object.hasOwnProperty.call(message, "quorumType")) + writer.uint32(/* id 6, wireType 0 =*/48).uint32(message.quorumType); + return writer; + }; + + /** + * Encodes the specified Proof message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.Proof.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.Proof + * @static + * @param {org.dash.platform.dapi.v0.IProof} message Proof message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Proof.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Proof message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.Proof + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.Proof} Proof + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Proof.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.org.dash.platform.dapi.v0.Proof(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.grovedbProof = reader.bytes(); + break; + case 2: + message.quorumHash = reader.bytes(); + break; + case 3: + message.signature = reader.bytes(); + break; + case 4: + message.round = reader.uint32(); + break; + case 5: + message.blockIdHash = reader.bytes(); + break; + case 6: + message.quorumType = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Proof message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.Proof + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.Proof} Proof + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Proof.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Proof message. + * @function verify + * @memberof org.dash.platform.dapi.v0.Proof + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Proof.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.grovedbProof != null && message.hasOwnProperty("grovedbProof")) + if (!(message.grovedbProof && typeof message.grovedbProof.length === "number" || $util.isString(message.grovedbProof))) + return "grovedbProof: buffer expected"; + if (message.quorumHash != null && message.hasOwnProperty("quorumHash")) + if (!(message.quorumHash && typeof message.quorumHash.length === "number" || $util.isString(message.quorumHash))) + return "quorumHash: 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"; + if (message.round != null && message.hasOwnProperty("round")) + if (!$util.isInteger(message.round)) + return "round: integer expected"; + if (message.blockIdHash != null && message.hasOwnProperty("blockIdHash")) + if (!(message.blockIdHash && typeof message.blockIdHash.length === "number" || $util.isString(message.blockIdHash))) + return "blockIdHash: buffer expected"; + if (message.quorumType != null && message.hasOwnProperty("quorumType")) + if (!$util.isInteger(message.quorumType)) + return "quorumType: integer expected"; + return null; + }; + + /** + * Creates a Proof message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.Proof + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.Proof} Proof + */ + Proof.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.Proof) + return object; + var message = new $root.org.dash.platform.dapi.v0.Proof(); + if (object.grovedbProof != null) + if (typeof object.grovedbProof === "string") + $util.base64.decode(object.grovedbProof, message.grovedbProof = $util.newBuffer($util.base64.length(object.grovedbProof)), 0); + else if (object.grovedbProof.length >= 0) + message.grovedbProof = object.grovedbProof; + if (object.quorumHash != null) + if (typeof object.quorumHash === "string") + $util.base64.decode(object.quorumHash, message.quorumHash = $util.newBuffer($util.base64.length(object.quorumHash)), 0); + else if (object.quorumHash.length >= 0) + message.quorumHash = object.quorumHash; + 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 >= 0) + message.signature = object.signature; + if (object.round != null) + message.round = object.round >>> 0; + if (object.blockIdHash != null) + if (typeof object.blockIdHash === "string") + $util.base64.decode(object.blockIdHash, message.blockIdHash = $util.newBuffer($util.base64.length(object.blockIdHash)), 0); + else if (object.blockIdHash.length >= 0) + message.blockIdHash = object.blockIdHash; + if (object.quorumType != null) + message.quorumType = object.quorumType >>> 0; + return message; + }; + + /** + * Creates a plain object from a Proof message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.Proof + * @static + * @param {org.dash.platform.dapi.v0.Proof} message Proof + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Proof.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.grovedbProof = ""; + else { + object.grovedbProof = []; + if (options.bytes !== Array) + object.grovedbProof = $util.newBuffer(object.grovedbProof); + } + if (options.bytes === String) + object.quorumHash = ""; + else { + object.quorumHash = []; + if (options.bytes !== Array) + object.quorumHash = $util.newBuffer(object.quorumHash); + } + if (options.bytes === String) + object.signature = ""; + else { + object.signature = []; + if (options.bytes !== Array) + object.signature = $util.newBuffer(object.signature); + } + object.round = 0; + if (options.bytes === String) + object.blockIdHash = ""; + else { + object.blockIdHash = []; + if (options.bytes !== Array) + object.blockIdHash = $util.newBuffer(object.blockIdHash); + } + object.quorumType = 0; + } + if (message.grovedbProof != null && message.hasOwnProperty("grovedbProof")) + object.grovedbProof = options.bytes === String ? $util.base64.encode(message.grovedbProof, 0, message.grovedbProof.length) : options.bytes === Array ? Array.prototype.slice.call(message.grovedbProof) : message.grovedbProof; + if (message.quorumHash != null && message.hasOwnProperty("quorumHash")) + object.quorumHash = options.bytes === String ? $util.base64.encode(message.quorumHash, 0, message.quorumHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.quorumHash) : message.quorumHash; + 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; + if (message.round != null && message.hasOwnProperty("round")) + object.round = message.round; + if (message.blockIdHash != null && message.hasOwnProperty("blockIdHash")) + object.blockIdHash = options.bytes === String ? $util.base64.encode(message.blockIdHash, 0, message.blockIdHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.blockIdHash) : message.blockIdHash; + if (message.quorumType != null && message.hasOwnProperty("quorumType")) + object.quorumType = message.quorumType; + return object; + }; + + /** + * Converts this Proof to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.Proof + * @instance + * @returns {Object.} JSON object + */ + Proof.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Proof; + })(); + + v0.ResponseMetadata = (function() { + + /** + * Properties of a ResponseMetadata. + * @memberof org.dash.platform.dapi.v0 + * @interface IResponseMetadata + * @property {number|Long|null} [height] ResponseMetadata height + * @property {number|null} [coreChainLockedHeight] ResponseMetadata coreChainLockedHeight + * @property {number|null} [epoch] ResponseMetadata epoch + * @property {number|Long|null} [timeMs] ResponseMetadata timeMs + * @property {number|null} [protocolVersion] ResponseMetadata protocolVersion + * @property {string|null} [chainId] ResponseMetadata chainId + */ + + /** + * Constructs a new ResponseMetadata. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a ResponseMetadata. + * @implements IResponseMetadata + * @constructor + * @param {org.dash.platform.dapi.v0.IResponseMetadata=} [properties] Properties to set + */ + function ResponseMetadata(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]]; + } + + /** + * ResponseMetadata height. + * @member {number|Long} height + * @memberof org.dash.platform.dapi.v0.ResponseMetadata + * @instance + */ + ResponseMetadata.prototype.height = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * ResponseMetadata coreChainLockedHeight. + * @member {number} coreChainLockedHeight + * @memberof org.dash.platform.dapi.v0.ResponseMetadata + * @instance + */ + ResponseMetadata.prototype.coreChainLockedHeight = 0; + + /** + * ResponseMetadata epoch. + * @member {number} epoch + * @memberof org.dash.platform.dapi.v0.ResponseMetadata + * @instance + */ + ResponseMetadata.prototype.epoch = 0; + + /** + * ResponseMetadata timeMs. + * @member {number|Long} timeMs + * @memberof org.dash.platform.dapi.v0.ResponseMetadata + * @instance + */ + ResponseMetadata.prototype.timeMs = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * ResponseMetadata protocolVersion. + * @member {number} protocolVersion + * @memberof org.dash.platform.dapi.v0.ResponseMetadata + * @instance + */ + ResponseMetadata.prototype.protocolVersion = 0; + + /** + * ResponseMetadata chainId. + * @member {string} chainId + * @memberof org.dash.platform.dapi.v0.ResponseMetadata + * @instance + */ + ResponseMetadata.prototype.chainId = ""; + + /** + * Creates a new ResponseMetadata instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.ResponseMetadata + * @static + * @param {org.dash.platform.dapi.v0.IResponseMetadata=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.ResponseMetadata} ResponseMetadata instance + */ + ResponseMetadata.create = function create(properties) { + return new ResponseMetadata(properties); + }; + + /** + * Encodes the specified ResponseMetadata message. Does not implicitly {@link org.dash.platform.dapi.v0.ResponseMetadata.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.ResponseMetadata + * @static + * @param {org.dash.platform.dapi.v0.IResponseMetadata} message ResponseMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResponseMetadata.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).uint64(message.height); + if (message.coreChainLockedHeight != null && Object.hasOwnProperty.call(message, "coreChainLockedHeight")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.coreChainLockedHeight); + if (message.epoch != null && Object.hasOwnProperty.call(message, "epoch")) + writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.epoch); + if (message.timeMs != null && Object.hasOwnProperty.call(message, "timeMs")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.timeMs); + if (message.protocolVersion != null && Object.hasOwnProperty.call(message, "protocolVersion")) + writer.uint32(/* id 5, wireType 0 =*/40).uint32(message.protocolVersion); + if (message.chainId != null && Object.hasOwnProperty.call(message, "chainId")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.chainId); + return writer; + }; + + /** + * Encodes the specified ResponseMetadata message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.ResponseMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.ResponseMetadata + * @static + * @param {org.dash.platform.dapi.v0.IResponseMetadata} message ResponseMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResponseMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResponseMetadata message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.ResponseMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.ResponseMetadata} ResponseMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResponseMetadata.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.org.dash.platform.dapi.v0.ResponseMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.height = reader.uint64(); + break; + case 2: + message.coreChainLockedHeight = reader.uint32(); + break; + case 3: + message.epoch = reader.uint32(); + break; + case 4: + message.timeMs = reader.uint64(); + break; + case 5: + message.protocolVersion = reader.uint32(); + break; + case 6: + message.chainId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResponseMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.ResponseMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.ResponseMetadata} ResponseMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResponseMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResponseMetadata message. + * @function verify + * @memberof org.dash.platform.dapi.v0.ResponseMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResponseMetadata.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.coreChainLockedHeight != null && message.hasOwnProperty("coreChainLockedHeight")) + if (!$util.isInteger(message.coreChainLockedHeight)) + return "coreChainLockedHeight: integer expected"; + if (message.epoch != null && message.hasOwnProperty("epoch")) + if (!$util.isInteger(message.epoch)) + return "epoch: integer expected"; + if (message.timeMs != null && message.hasOwnProperty("timeMs")) + if (!$util.isInteger(message.timeMs) && !(message.timeMs && $util.isInteger(message.timeMs.low) && $util.isInteger(message.timeMs.high))) + return "timeMs: integer|Long expected"; + if (message.protocolVersion != null && message.hasOwnProperty("protocolVersion")) + if (!$util.isInteger(message.protocolVersion)) + return "protocolVersion: integer expected"; + if (message.chainId != null && message.hasOwnProperty("chainId")) + if (!$util.isString(message.chainId)) + return "chainId: string expected"; + return null; + }; + + /** + * Creates a ResponseMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.ResponseMetadata + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.ResponseMetadata} ResponseMetadata + */ + ResponseMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.ResponseMetadata) + return object; + var message = new $root.org.dash.platform.dapi.v0.ResponseMetadata(); + if (object.height != null) + if ($util.Long) + (message.height = $util.Long.fromValue(object.height)).unsigned = true; + 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(true); + if (object.coreChainLockedHeight != null) + message.coreChainLockedHeight = object.coreChainLockedHeight >>> 0; + if (object.epoch != null) + message.epoch = object.epoch >>> 0; + if (object.timeMs != null) + if ($util.Long) + (message.timeMs = $util.Long.fromValue(object.timeMs)).unsigned = true; + else if (typeof object.timeMs === "string") + message.timeMs = parseInt(object.timeMs, 10); + else if (typeof object.timeMs === "number") + message.timeMs = object.timeMs; + else if (typeof object.timeMs === "object") + message.timeMs = new $util.LongBits(object.timeMs.low >>> 0, object.timeMs.high >>> 0).toNumber(true); + if (object.protocolVersion != null) + message.protocolVersion = object.protocolVersion >>> 0; + if (object.chainId != null) + message.chainId = String(object.chainId); + return message; + }; + + /** + * Creates a plain object from a ResponseMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.ResponseMetadata + * @static + * @param {org.dash.platform.dapi.v0.ResponseMetadata} message ResponseMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResponseMetadata.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.height = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.height = options.longs === String ? "0" : 0; + object.coreChainLockedHeight = 0; + object.epoch = 0; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.timeMs = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.timeMs = options.longs === String ? "0" : 0; + object.protocolVersion = 0; + object.chainId = ""; + } + 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(true) : message.height; + if (message.coreChainLockedHeight != null && message.hasOwnProperty("coreChainLockedHeight")) + object.coreChainLockedHeight = message.coreChainLockedHeight; + if (message.epoch != null && message.hasOwnProperty("epoch")) + object.epoch = message.epoch; + if (message.timeMs != null && message.hasOwnProperty("timeMs")) + if (typeof message.timeMs === "number") + object.timeMs = options.longs === String ? String(message.timeMs) : message.timeMs; + else + object.timeMs = options.longs === String ? $util.Long.prototype.toString.call(message.timeMs) : options.longs === Number ? new $util.LongBits(message.timeMs.low >>> 0, message.timeMs.high >>> 0).toNumber(true) : message.timeMs; + if (message.protocolVersion != null && message.hasOwnProperty("protocolVersion")) + object.protocolVersion = message.protocolVersion; + if (message.chainId != null && message.hasOwnProperty("chainId")) + object.chainId = message.chainId; + return object; + }; + + /** + * Converts this ResponseMetadata to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.ResponseMetadata + * @instance + * @returns {Object.} JSON object + */ + ResponseMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ResponseMetadata; + })(); + + v0.StateTransitionBroadcastError = (function() { + + /** + * Properties of a StateTransitionBroadcastError. + * @memberof org.dash.platform.dapi.v0 + * @interface IStateTransitionBroadcastError + * @property {number|null} [code] StateTransitionBroadcastError code + * @property {string|null} [message] StateTransitionBroadcastError message + * @property {Uint8Array|null} [data] StateTransitionBroadcastError data + */ + + /** + * Constructs a new StateTransitionBroadcastError. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a StateTransitionBroadcastError. + * @implements IStateTransitionBroadcastError + * @constructor + * @param {org.dash.platform.dapi.v0.IStateTransitionBroadcastError=} [properties] Properties to set + */ + function StateTransitionBroadcastError(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]]; + } + + /** + * StateTransitionBroadcastError code. + * @member {number} code + * @memberof org.dash.platform.dapi.v0.StateTransitionBroadcastError + * @instance + */ + StateTransitionBroadcastError.prototype.code = 0; + + /** + * StateTransitionBroadcastError message. + * @member {string} message + * @memberof org.dash.platform.dapi.v0.StateTransitionBroadcastError + * @instance + */ + StateTransitionBroadcastError.prototype.message = ""; + + /** + * StateTransitionBroadcastError data. + * @member {Uint8Array} data + * @memberof org.dash.platform.dapi.v0.StateTransitionBroadcastError + * @instance + */ + StateTransitionBroadcastError.prototype.data = $util.newBuffer([]); + + /** + * Creates a new StateTransitionBroadcastError instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.StateTransitionBroadcastError + * @static + * @param {org.dash.platform.dapi.v0.IStateTransitionBroadcastError=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.StateTransitionBroadcastError} StateTransitionBroadcastError instance + */ + StateTransitionBroadcastError.create = function create(properties) { + return new StateTransitionBroadcastError(properties); + }; + + /** + * Encodes the specified StateTransitionBroadcastError message. Does not implicitly {@link org.dash.platform.dapi.v0.StateTransitionBroadcastError.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.StateTransitionBroadcastError + * @static + * @param {org.dash.platform.dapi.v0.IStateTransitionBroadcastError} message StateTransitionBroadcastError message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StateTransitionBroadcastError.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.code != null && Object.hasOwnProperty.call(message, "code")) + writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.code); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.message); + if (message.data != null && Object.hasOwnProperty.call(message, "data")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.data); + return writer; + }; + + /** + * Encodes the specified StateTransitionBroadcastError message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.StateTransitionBroadcastError.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.StateTransitionBroadcastError + * @static + * @param {org.dash.platform.dapi.v0.IStateTransitionBroadcastError} message StateTransitionBroadcastError message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StateTransitionBroadcastError.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StateTransitionBroadcastError message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.StateTransitionBroadcastError + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.StateTransitionBroadcastError} StateTransitionBroadcastError + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StateTransitionBroadcastError.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.org.dash.platform.dapi.v0.StateTransitionBroadcastError(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.code = reader.uint32(); + break; + case 2: + message.message = reader.string(); + break; + case 3: + message.data = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StateTransitionBroadcastError message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.StateTransitionBroadcastError + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.StateTransitionBroadcastError} StateTransitionBroadcastError + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StateTransitionBroadcastError.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StateTransitionBroadcastError message. + * @function verify + * @memberof org.dash.platform.dapi.v0.StateTransitionBroadcastError + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StateTransitionBroadcastError.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.code != null && message.hasOwnProperty("code")) + if (!$util.isInteger(message.code)) + return "code: integer expected"; + if (message.message != null && message.hasOwnProperty("message")) + if (!$util.isString(message.message)) + return "message: string expected"; + if (message.data != null && message.hasOwnProperty("data")) + if (!(message.data && typeof message.data.length === "number" || $util.isString(message.data))) + return "data: buffer expected"; + return null; + }; + + /** + * Creates a StateTransitionBroadcastError message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.StateTransitionBroadcastError + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.StateTransitionBroadcastError} StateTransitionBroadcastError + */ + StateTransitionBroadcastError.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.StateTransitionBroadcastError) + return object; + var message = new $root.org.dash.platform.dapi.v0.StateTransitionBroadcastError(); + if (object.code != null) + message.code = object.code >>> 0; + if (object.message != null) + message.message = String(object.message); + if (object.data != null) + if (typeof object.data === "string") + $util.base64.decode(object.data, message.data = $util.newBuffer($util.base64.length(object.data)), 0); + else if (object.data.length >= 0) + message.data = object.data; + return message; + }; + + /** + * Creates a plain object from a StateTransitionBroadcastError message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.StateTransitionBroadcastError + * @static + * @param {org.dash.platform.dapi.v0.StateTransitionBroadcastError} message StateTransitionBroadcastError + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StateTransitionBroadcastError.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.code = 0; + object.message = ""; + if (options.bytes === String) + object.data = ""; + else { + object.data = []; + if (options.bytes !== Array) + object.data = $util.newBuffer(object.data); + } + } + if (message.code != null && message.hasOwnProperty("code")) + object.code = message.code; + if (message.message != null && message.hasOwnProperty("message")) + object.message = message.message; + if (message.data != null && message.hasOwnProperty("data")) + object.data = options.bytes === String ? $util.base64.encode(message.data, 0, message.data.length) : options.bytes === Array ? Array.prototype.slice.call(message.data) : message.data; + return object; + }; + + /** + * Converts this StateTransitionBroadcastError to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.StateTransitionBroadcastError + * @instance + * @returns {Object.} JSON object + */ + StateTransitionBroadcastError.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return StateTransitionBroadcastError; + })(); + + /** + * KeyPurpose enum. + * @name org.dash.platform.dapi.v0.KeyPurpose + * @enum {number} + * @property {number} AUTHENTICATION=0 AUTHENTICATION value + * @property {number} ENCRYPTION=1 ENCRYPTION value + * @property {number} DECRYPTION=2 DECRYPTION value + * @property {number} TRANSFER=3 TRANSFER value + * @property {number} VOTING=5 VOTING value + */ + v0.KeyPurpose = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "AUTHENTICATION"] = 0; + values[valuesById[1] = "ENCRYPTION"] = 1; + values[valuesById[2] = "DECRYPTION"] = 2; + values[valuesById[3] = "TRANSFER"] = 3; + values[valuesById[5] = "VOTING"] = 5; + return values; + })(); + + v0.BroadcastStateTransitionRequest = (function() { + + /** + * Properties of a BroadcastStateTransitionRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IBroadcastStateTransitionRequest + * @property {Uint8Array|null} [stateTransition] BroadcastStateTransitionRequest stateTransition + */ + + /** + * Constructs a new BroadcastStateTransitionRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a BroadcastStateTransitionRequest. + * @implements IBroadcastStateTransitionRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IBroadcastStateTransitionRequest=} [properties] Properties to set + */ + function BroadcastStateTransitionRequest(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]]; + } + + /** + * BroadcastStateTransitionRequest stateTransition. + * @member {Uint8Array} stateTransition + * @memberof org.dash.platform.dapi.v0.BroadcastStateTransitionRequest + * @instance + */ + BroadcastStateTransitionRequest.prototype.stateTransition = $util.newBuffer([]); + + /** + * Creates a new BroadcastStateTransitionRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.BroadcastStateTransitionRequest + * @static + * @param {org.dash.platform.dapi.v0.IBroadcastStateTransitionRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.BroadcastStateTransitionRequest} BroadcastStateTransitionRequest instance + */ + BroadcastStateTransitionRequest.create = function create(properties) { + return new BroadcastStateTransitionRequest(properties); + }; + + /** + * Encodes the specified BroadcastStateTransitionRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.BroadcastStateTransitionRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.BroadcastStateTransitionRequest + * @static + * @param {org.dash.platform.dapi.v0.IBroadcastStateTransitionRequest} message BroadcastStateTransitionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BroadcastStateTransitionRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.stateTransition != null && Object.hasOwnProperty.call(message, "stateTransition")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.stateTransition); + return writer; + }; + + /** + * Encodes the specified BroadcastStateTransitionRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.BroadcastStateTransitionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.BroadcastStateTransitionRequest + * @static + * @param {org.dash.platform.dapi.v0.IBroadcastStateTransitionRequest} message BroadcastStateTransitionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BroadcastStateTransitionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BroadcastStateTransitionRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.BroadcastStateTransitionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.BroadcastStateTransitionRequest} BroadcastStateTransitionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BroadcastStateTransitionRequest.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.org.dash.platform.dapi.v0.BroadcastStateTransitionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.stateTransition = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BroadcastStateTransitionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.BroadcastStateTransitionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.BroadcastStateTransitionRequest} BroadcastStateTransitionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BroadcastStateTransitionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BroadcastStateTransitionRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.BroadcastStateTransitionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BroadcastStateTransitionRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.stateTransition != null && message.hasOwnProperty("stateTransition")) + if (!(message.stateTransition && typeof message.stateTransition.length === "number" || $util.isString(message.stateTransition))) + return "stateTransition: buffer expected"; + return null; + }; + + /** + * Creates a BroadcastStateTransitionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.BroadcastStateTransitionRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.BroadcastStateTransitionRequest} BroadcastStateTransitionRequest + */ + BroadcastStateTransitionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.BroadcastStateTransitionRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.BroadcastStateTransitionRequest(); + if (object.stateTransition != null) + if (typeof object.stateTransition === "string") + $util.base64.decode(object.stateTransition, message.stateTransition = $util.newBuffer($util.base64.length(object.stateTransition)), 0); + else if (object.stateTransition.length >= 0) + message.stateTransition = object.stateTransition; + return message; + }; + + /** + * Creates a plain object from a BroadcastStateTransitionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.BroadcastStateTransitionRequest + * @static + * @param {org.dash.platform.dapi.v0.BroadcastStateTransitionRequest} message BroadcastStateTransitionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BroadcastStateTransitionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if (options.bytes === String) + object.stateTransition = ""; + else { + object.stateTransition = []; + if (options.bytes !== Array) + object.stateTransition = $util.newBuffer(object.stateTransition); + } + if (message.stateTransition != null && message.hasOwnProperty("stateTransition")) + object.stateTransition = options.bytes === String ? $util.base64.encode(message.stateTransition, 0, message.stateTransition.length) : options.bytes === Array ? Array.prototype.slice.call(message.stateTransition) : message.stateTransition; + return object; + }; + + /** + * Converts this BroadcastStateTransitionRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.BroadcastStateTransitionRequest + * @instance + * @returns {Object.} JSON object + */ + BroadcastStateTransitionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return BroadcastStateTransitionRequest; + })(); + + v0.BroadcastStateTransitionResponse = (function() { + + /** + * Properties of a BroadcastStateTransitionResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IBroadcastStateTransitionResponse + */ + + /** + * Constructs a new BroadcastStateTransitionResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a BroadcastStateTransitionResponse. + * @implements IBroadcastStateTransitionResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IBroadcastStateTransitionResponse=} [properties] Properties to set + */ + function BroadcastStateTransitionResponse(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]]; + } + + /** + * Creates a new BroadcastStateTransitionResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.BroadcastStateTransitionResponse + * @static + * @param {org.dash.platform.dapi.v0.IBroadcastStateTransitionResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.BroadcastStateTransitionResponse} BroadcastStateTransitionResponse instance + */ + BroadcastStateTransitionResponse.create = function create(properties) { + return new BroadcastStateTransitionResponse(properties); + }; + + /** + * Encodes the specified BroadcastStateTransitionResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.BroadcastStateTransitionResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.BroadcastStateTransitionResponse + * @static + * @param {org.dash.platform.dapi.v0.IBroadcastStateTransitionResponse} message BroadcastStateTransitionResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BroadcastStateTransitionResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified BroadcastStateTransitionResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.BroadcastStateTransitionResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.BroadcastStateTransitionResponse + * @static + * @param {org.dash.platform.dapi.v0.IBroadcastStateTransitionResponse} message BroadcastStateTransitionResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BroadcastStateTransitionResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BroadcastStateTransitionResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.BroadcastStateTransitionResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.BroadcastStateTransitionResponse} BroadcastStateTransitionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BroadcastStateTransitionResponse.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.org.dash.platform.dapi.v0.BroadcastStateTransitionResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BroadcastStateTransitionResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.BroadcastStateTransitionResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.BroadcastStateTransitionResponse} BroadcastStateTransitionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BroadcastStateTransitionResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BroadcastStateTransitionResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.BroadcastStateTransitionResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BroadcastStateTransitionResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a BroadcastStateTransitionResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.BroadcastStateTransitionResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.BroadcastStateTransitionResponse} BroadcastStateTransitionResponse + */ + BroadcastStateTransitionResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.BroadcastStateTransitionResponse) + return object; + return new $root.org.dash.platform.dapi.v0.BroadcastStateTransitionResponse(); + }; + + /** + * Creates a plain object from a BroadcastStateTransitionResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.BroadcastStateTransitionResponse + * @static + * @param {org.dash.platform.dapi.v0.BroadcastStateTransitionResponse} message BroadcastStateTransitionResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BroadcastStateTransitionResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this BroadcastStateTransitionResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.BroadcastStateTransitionResponse + * @instance + * @returns {Object.} JSON object + */ + BroadcastStateTransitionResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return BroadcastStateTransitionResponse; + })(); + + v0.GetIdentityRequest = (function() { + + /** + * Properties of a GetIdentityRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetIdentityRequest + * @property {org.dash.platform.dapi.v0.GetIdentityRequest.IGetIdentityRequestV0|null} [v0] GetIdentityRequest v0 + */ + + /** + * Constructs a new GetIdentityRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetIdentityRequest. + * @implements IGetIdentityRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IGetIdentityRequest=} [properties] Properties to set + */ + function GetIdentityRequest(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]]; + } + + /** + * GetIdentityRequest v0. + * @member {org.dash.platform.dapi.v0.GetIdentityRequest.IGetIdentityRequestV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetIdentityRequest + * @instance + */ + GetIdentityRequest.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetIdentityRequest version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetIdentityRequest + * @instance + */ + Object.defineProperty(GetIdentityRequest.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetIdentityRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentityRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentityRequest} GetIdentityRequest instance + */ + GetIdentityRequest.create = function create(properties) { + return new GetIdentityRequest(properties); + }; + + /** + * Encodes the specified GetIdentityRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentityRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityRequest} message GetIdentityRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetIdentityRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityRequest} message GetIdentityRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentityRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentityRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentityRequest} GetIdentityRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityRequest.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.org.dash.platform.dapi.v0.GetIdentityRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentityRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentityRequest} GetIdentityRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentityRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentityRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentityRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetIdentityRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentityRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentityRequest} GetIdentityRequest + */ + GetIdentityRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentityRequest(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityRequest.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetIdentityRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentityRequest + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityRequest} message GetIdentityRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentityRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetIdentityRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentityRequest + * @instance + * @returns {Object.} JSON object + */ + GetIdentityRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetIdentityRequest.GetIdentityRequestV0 = (function() { + + /** + * Properties of a GetIdentityRequestV0. + * @memberof org.dash.platform.dapi.v0.GetIdentityRequest + * @interface IGetIdentityRequestV0 + * @property {Uint8Array|null} [id] GetIdentityRequestV0 id + * @property {boolean|null} [prove] GetIdentityRequestV0 prove + */ + + /** + * Constructs a new GetIdentityRequestV0. + * @memberof org.dash.platform.dapi.v0.GetIdentityRequest + * @classdesc Represents a GetIdentityRequestV0. + * @implements IGetIdentityRequestV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetIdentityRequest.IGetIdentityRequestV0=} [properties] Properties to set + */ + function GetIdentityRequestV0(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]]; + } + + /** + * GetIdentityRequestV0 id. + * @member {Uint8Array} id + * @memberof org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0 + * @instance + */ + GetIdentityRequestV0.prototype.id = $util.newBuffer([]); + + /** + * GetIdentityRequestV0 prove. + * @member {boolean} prove + * @memberof org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0 + * @instance + */ + GetIdentityRequestV0.prototype.prove = false; + + /** + * Creates a new GetIdentityRequestV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityRequest.IGetIdentityRequestV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0} GetIdentityRequestV0 instance + */ + GetIdentityRequestV0.create = function create(properties) { + return new GetIdentityRequestV0(properties); + }; + + /** + * Encodes the specified GetIdentityRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityRequest.IGetIdentityRequestV0} message GetIdentityRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityRequestV0.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).bytes(message.id); + if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.prove); + return writer; + }; + + /** + * Encodes the specified GetIdentityRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityRequest.IGetIdentityRequestV0} message GetIdentityRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityRequestV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentityRequestV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0} GetIdentityRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityRequestV0.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.org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.bytes(); + break; + case 2: + message.prove = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentityRequestV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0} GetIdentityRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityRequestV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentityRequestV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentityRequestV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.id != null && message.hasOwnProperty("id")) + if (!(message.id && typeof message.id.length === "number" || $util.isString(message.id))) + return "id: buffer expected"; + if (message.prove != null && message.hasOwnProperty("prove")) + if (typeof message.prove !== "boolean") + return "prove: boolean expected"; + return null; + }; + + /** + * Creates a GetIdentityRequestV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0} GetIdentityRequestV0 + */ + GetIdentityRequestV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0(); + if (object.id != null) + if (typeof object.id === "string") + $util.base64.decode(object.id, message.id = $util.newBuffer($util.base64.length(object.id)), 0); + else if (object.id.length >= 0) + message.id = object.id; + if (object.prove != null) + message.prove = Boolean(object.prove); + return message; + }; + + /** + * Creates a plain object from a GetIdentityRequestV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0} message GetIdentityRequestV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentityRequestV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.id = ""; + else { + object.id = []; + if (options.bytes !== Array) + object.id = $util.newBuffer(object.id); + } + object.prove = false; + } + if (message.id != null && message.hasOwnProperty("id")) + object.id = options.bytes === String ? $util.base64.encode(message.id, 0, message.id.length) : options.bytes === Array ? Array.prototype.slice.call(message.id) : message.id; + if (message.prove != null && message.hasOwnProperty("prove")) + object.prove = message.prove; + return object; + }; + + /** + * Converts this GetIdentityRequestV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0 + * @instance + * @returns {Object.} JSON object + */ + GetIdentityRequestV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetIdentityRequestV0; + })(); + + return GetIdentityRequest; + })(); + + v0.GetIdentityNonceRequest = (function() { + + /** + * Properties of a GetIdentityNonceRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetIdentityNonceRequest + * @property {org.dash.platform.dapi.v0.GetIdentityNonceRequest.IGetIdentityNonceRequestV0|null} [v0] GetIdentityNonceRequest v0 + */ + + /** + * Constructs a new GetIdentityNonceRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetIdentityNonceRequest. + * @implements IGetIdentityNonceRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IGetIdentityNonceRequest=} [properties] Properties to set + */ + function GetIdentityNonceRequest(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]]; + } + + /** + * GetIdentityNonceRequest v0. + * @member {org.dash.platform.dapi.v0.GetIdentityNonceRequest.IGetIdentityNonceRequestV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceRequest + * @instance + */ + GetIdentityNonceRequest.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetIdentityNonceRequest version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceRequest + * @instance + */ + Object.defineProperty(GetIdentityNonceRequest.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetIdentityNonceRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityNonceRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentityNonceRequest} GetIdentityNonceRequest instance + */ + GetIdentityNonceRequest.create = function create(properties) { + return new GetIdentityNonceRequest(properties); + }; + + /** + * Encodes the specified GetIdentityNonceRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityNonceRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityNonceRequest} message GetIdentityNonceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityNonceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetIdentityNonceRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityNonceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityNonceRequest} message GetIdentityNonceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityNonceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentityNonceRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentityNonceRequest} GetIdentityNonceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityNonceRequest.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.org.dash.platform.dapi.v0.GetIdentityNonceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentityNonceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentityNonceRequest} GetIdentityNonceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityNonceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentityNonceRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentityNonceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetIdentityNonceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentityNonceRequest} GetIdentityNonceRequest + */ + GetIdentityNonceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityNonceRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentityNonceRequest(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityNonceRequest.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetIdentityNonceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceRequest + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityNonceRequest} message GetIdentityNonceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentityNonceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetIdentityNonceRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceRequest + * @instance + * @returns {Object.} JSON object + */ + GetIdentityNonceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetIdentityNonceRequest.GetIdentityNonceRequestV0 = (function() { + + /** + * Properties of a GetIdentityNonceRequestV0. + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceRequest + * @interface IGetIdentityNonceRequestV0 + * @property {Uint8Array|null} [identityId] GetIdentityNonceRequestV0 identityId + * @property {boolean|null} [prove] GetIdentityNonceRequestV0 prove + */ + + /** + * Constructs a new GetIdentityNonceRequestV0. + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceRequest + * @classdesc Represents a GetIdentityNonceRequestV0. + * @implements IGetIdentityNonceRequestV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetIdentityNonceRequest.IGetIdentityNonceRequestV0=} [properties] Properties to set + */ + function GetIdentityNonceRequestV0(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]]; + } + + /** + * GetIdentityNonceRequestV0 identityId. + * @member {Uint8Array} identityId + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0 + * @instance + */ + GetIdentityNonceRequestV0.prototype.identityId = $util.newBuffer([]); + + /** + * GetIdentityNonceRequestV0 prove. + * @member {boolean} prove + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0 + * @instance + */ + GetIdentityNonceRequestV0.prototype.prove = false; + + /** + * Creates a new GetIdentityNonceRequestV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityNonceRequest.IGetIdentityNonceRequestV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0} GetIdentityNonceRequestV0 instance + */ + GetIdentityNonceRequestV0.create = function create(properties) { + return new GetIdentityNonceRequestV0(properties); + }; + + /** + * Encodes the specified GetIdentityNonceRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityNonceRequest.IGetIdentityNonceRequestV0} message GetIdentityNonceRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityNonceRequestV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.identityId != null && Object.hasOwnProperty.call(message, "identityId")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.identityId); + if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.prove); + return writer; + }; + + /** + * Encodes the specified GetIdentityNonceRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityNonceRequest.IGetIdentityNonceRequestV0} message GetIdentityNonceRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityNonceRequestV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentityNonceRequestV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0} GetIdentityNonceRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityNonceRequestV0.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.org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.identityId = reader.bytes(); + break; + case 2: + message.prove = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentityNonceRequestV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0} GetIdentityNonceRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityNonceRequestV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentityNonceRequestV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentityNonceRequestV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.identityId != null && message.hasOwnProperty("identityId")) + if (!(message.identityId && typeof message.identityId.length === "number" || $util.isString(message.identityId))) + return "identityId: buffer expected"; + if (message.prove != null && message.hasOwnProperty("prove")) + if (typeof message.prove !== "boolean") + return "prove: boolean expected"; + return null; + }; + + /** + * Creates a GetIdentityNonceRequestV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0} GetIdentityNonceRequestV0 + */ + GetIdentityNonceRequestV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0(); + if (object.identityId != null) + if (typeof object.identityId === "string") + $util.base64.decode(object.identityId, message.identityId = $util.newBuffer($util.base64.length(object.identityId)), 0); + else if (object.identityId.length >= 0) + message.identityId = object.identityId; + if (object.prove != null) + message.prove = Boolean(object.prove); + return message; + }; + + /** + * Creates a plain object from a GetIdentityNonceRequestV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0} message GetIdentityNonceRequestV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentityNonceRequestV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.identityId = ""; + else { + object.identityId = []; + if (options.bytes !== Array) + object.identityId = $util.newBuffer(object.identityId); + } + object.prove = false; + } + if (message.identityId != null && message.hasOwnProperty("identityId")) + object.identityId = options.bytes === String ? $util.base64.encode(message.identityId, 0, message.identityId.length) : options.bytes === Array ? Array.prototype.slice.call(message.identityId) : message.identityId; + if (message.prove != null && message.hasOwnProperty("prove")) + object.prove = message.prove; + return object; + }; + + /** + * Converts this GetIdentityNonceRequestV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0 + * @instance + * @returns {Object.} JSON object + */ + GetIdentityNonceRequestV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetIdentityNonceRequestV0; + })(); + + return GetIdentityNonceRequest; + })(); + + v0.GetIdentityContractNonceRequest = (function() { + + /** + * Properties of a GetIdentityContractNonceRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetIdentityContractNonceRequest + * @property {org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.IGetIdentityContractNonceRequestV0|null} [v0] GetIdentityContractNonceRequest v0 + */ + + /** + * Constructs a new GetIdentityContractNonceRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetIdentityContractNonceRequest. + * @implements IGetIdentityContractNonceRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IGetIdentityContractNonceRequest=} [properties] Properties to set + */ + function GetIdentityContractNonceRequest(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]]; + } + + /** + * GetIdentityContractNonceRequest v0. + * @member {org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.IGetIdentityContractNonceRequestV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceRequest + * @instance + */ + GetIdentityContractNonceRequest.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetIdentityContractNonceRequest version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceRequest + * @instance + */ + Object.defineProperty(GetIdentityContractNonceRequest.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetIdentityContractNonceRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityContractNonceRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentityContractNonceRequest} GetIdentityContractNonceRequest instance + */ + GetIdentityContractNonceRequest.create = function create(properties) { + return new GetIdentityContractNonceRequest(properties); + }; + + /** + * Encodes the specified GetIdentityContractNonceRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityContractNonceRequest} message GetIdentityContractNonceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityContractNonceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetIdentityContractNonceRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityContractNonceRequest} message GetIdentityContractNonceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityContractNonceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentityContractNonceRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentityContractNonceRequest} GetIdentityContractNonceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityContractNonceRequest.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.org.dash.platform.dapi.v0.GetIdentityContractNonceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentityContractNonceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentityContractNonceRequest} GetIdentityContractNonceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityContractNonceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentityContractNonceRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentityContractNonceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetIdentityContractNonceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentityContractNonceRequest} GetIdentityContractNonceRequest + */ + GetIdentityContractNonceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityContractNonceRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentityContractNonceRequest(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetIdentityContractNonceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceRequest + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityContractNonceRequest} message GetIdentityContractNonceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentityContractNonceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetIdentityContractNonceRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceRequest + * @instance + * @returns {Object.} JSON object + */ + GetIdentityContractNonceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0 = (function() { + + /** + * Properties of a GetIdentityContractNonceRequestV0. + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceRequest + * @interface IGetIdentityContractNonceRequestV0 + * @property {Uint8Array|null} [identityId] GetIdentityContractNonceRequestV0 identityId + * @property {Uint8Array|null} [contractId] GetIdentityContractNonceRequestV0 contractId + * @property {boolean|null} [prove] GetIdentityContractNonceRequestV0 prove + */ + + /** + * Constructs a new GetIdentityContractNonceRequestV0. + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceRequest + * @classdesc Represents a GetIdentityContractNonceRequestV0. + * @implements IGetIdentityContractNonceRequestV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.IGetIdentityContractNonceRequestV0=} [properties] Properties to set + */ + function GetIdentityContractNonceRequestV0(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]]; + } + + /** + * GetIdentityContractNonceRequestV0 identityId. + * @member {Uint8Array} identityId + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0 + * @instance + */ + GetIdentityContractNonceRequestV0.prototype.identityId = $util.newBuffer([]); + + /** + * GetIdentityContractNonceRequestV0 contractId. + * @member {Uint8Array} contractId + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0 + * @instance + */ + GetIdentityContractNonceRequestV0.prototype.contractId = $util.newBuffer([]); + + /** + * GetIdentityContractNonceRequestV0 prove. + * @member {boolean} prove + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0 + * @instance + */ + GetIdentityContractNonceRequestV0.prototype.prove = false; + + /** + * Creates a new GetIdentityContractNonceRequestV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.IGetIdentityContractNonceRequestV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0} GetIdentityContractNonceRequestV0 instance + */ + GetIdentityContractNonceRequestV0.create = function create(properties) { + return new GetIdentityContractNonceRequestV0(properties); + }; + + /** + * Encodes the specified GetIdentityContractNonceRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.IGetIdentityContractNonceRequestV0} message GetIdentityContractNonceRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityContractNonceRequestV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.identityId != null && Object.hasOwnProperty.call(message, "identityId")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.identityId); + if (message.contractId != null && Object.hasOwnProperty.call(message, "contractId")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.contractId); + if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.prove); + return writer; + }; + + /** + * Encodes the specified GetIdentityContractNonceRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.IGetIdentityContractNonceRequestV0} message GetIdentityContractNonceRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityContractNonceRequestV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentityContractNonceRequestV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0} GetIdentityContractNonceRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityContractNonceRequestV0.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.org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.identityId = reader.bytes(); + break; + case 2: + message.contractId = reader.bytes(); + break; + case 3: + message.prove = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentityContractNonceRequestV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0} GetIdentityContractNonceRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityContractNonceRequestV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentityContractNonceRequestV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentityContractNonceRequestV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.identityId != null && message.hasOwnProperty("identityId")) + if (!(message.identityId && typeof message.identityId.length === "number" || $util.isString(message.identityId))) + return "identityId: buffer expected"; + if (message.contractId != null && message.hasOwnProperty("contractId")) + if (!(message.contractId && typeof message.contractId.length === "number" || $util.isString(message.contractId))) + return "contractId: buffer expected"; + if (message.prove != null && message.hasOwnProperty("prove")) + if (typeof message.prove !== "boolean") + return "prove: boolean expected"; + return null; + }; + + /** + * Creates a GetIdentityContractNonceRequestV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0} GetIdentityContractNonceRequestV0 + */ + GetIdentityContractNonceRequestV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0(); + if (object.identityId != null) + if (typeof object.identityId === "string") + $util.base64.decode(object.identityId, message.identityId = $util.newBuffer($util.base64.length(object.identityId)), 0); + else if (object.identityId.length >= 0) + message.identityId = object.identityId; + if (object.contractId != null) + if (typeof object.contractId === "string") + $util.base64.decode(object.contractId, message.contractId = $util.newBuffer($util.base64.length(object.contractId)), 0); + else if (object.contractId.length >= 0) + message.contractId = object.contractId; + if (object.prove != null) + message.prove = Boolean(object.prove); + return message; + }; + + /** + * Creates a plain object from a GetIdentityContractNonceRequestV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0} message GetIdentityContractNonceRequestV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentityContractNonceRequestV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.identityId = ""; + else { + object.identityId = []; + if (options.bytes !== Array) + object.identityId = $util.newBuffer(object.identityId); + } + if (options.bytes === String) + object.contractId = ""; + else { + object.contractId = []; + if (options.bytes !== Array) + object.contractId = $util.newBuffer(object.contractId); + } + object.prove = false; + } + if (message.identityId != null && message.hasOwnProperty("identityId")) + object.identityId = options.bytes === String ? $util.base64.encode(message.identityId, 0, message.identityId.length) : options.bytes === Array ? Array.prototype.slice.call(message.identityId) : message.identityId; + if (message.contractId != null && message.hasOwnProperty("contractId")) + object.contractId = options.bytes === String ? $util.base64.encode(message.contractId, 0, message.contractId.length) : options.bytes === Array ? Array.prototype.slice.call(message.contractId) : message.contractId; + if (message.prove != null && message.hasOwnProperty("prove")) + object.prove = message.prove; + return object; + }; + + /** + * Converts this GetIdentityContractNonceRequestV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0 + * @instance + * @returns {Object.} JSON object + */ + GetIdentityContractNonceRequestV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetIdentityContractNonceRequestV0; + })(); + + return GetIdentityContractNonceRequest; + })(); + + v0.GetIdentityBalanceRequest = (function() { + + /** + * Properties of a GetIdentityBalanceRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetIdentityBalanceRequest + * @property {org.dash.platform.dapi.v0.GetIdentityBalanceRequest.IGetIdentityBalanceRequestV0|null} [v0] GetIdentityBalanceRequest v0 + */ + + /** + * Constructs a new GetIdentityBalanceRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetIdentityBalanceRequest. + * @implements IGetIdentityBalanceRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IGetIdentityBalanceRequest=} [properties] Properties to set + */ + function GetIdentityBalanceRequest(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]]; + } + + /** + * GetIdentityBalanceRequest v0. + * @member {org.dash.platform.dapi.v0.GetIdentityBalanceRequest.IGetIdentityBalanceRequestV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceRequest + * @instance + */ + GetIdentityBalanceRequest.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetIdentityBalanceRequest version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceRequest + * @instance + */ + Object.defineProperty(GetIdentityBalanceRequest.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetIdentityBalanceRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityBalanceRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceRequest} GetIdentityBalanceRequest instance + */ + GetIdentityBalanceRequest.create = function create(properties) { + return new GetIdentityBalanceRequest(properties); + }; + + /** + * Encodes the specified GetIdentityBalanceRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityBalanceRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityBalanceRequest} message GetIdentityBalanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityBalanceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetIdentityBalanceRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityBalanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityBalanceRequest} message GetIdentityBalanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityBalanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentityBalanceRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceRequest} GetIdentityBalanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityBalanceRequest.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.org.dash.platform.dapi.v0.GetIdentityBalanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentityBalanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceRequest} GetIdentityBalanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityBalanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentityBalanceRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentityBalanceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetIdentityBalanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceRequest} GetIdentityBalanceRequest + */ + GetIdentityBalanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityBalanceRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentityBalanceRequest(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityBalanceRequest.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetIdentityBalanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceRequest + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityBalanceRequest} message GetIdentityBalanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentityBalanceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetIdentityBalanceRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceRequest + * @instance + * @returns {Object.} JSON object + */ + GetIdentityBalanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetIdentityBalanceRequest.GetIdentityBalanceRequestV0 = (function() { + + /** + * Properties of a GetIdentityBalanceRequestV0. + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceRequest + * @interface IGetIdentityBalanceRequestV0 + * @property {Uint8Array|null} [id] GetIdentityBalanceRequestV0 id + * @property {boolean|null} [prove] GetIdentityBalanceRequestV0 prove + */ + + /** + * Constructs a new GetIdentityBalanceRequestV0. + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceRequest + * @classdesc Represents a GetIdentityBalanceRequestV0. + * @implements IGetIdentityBalanceRequestV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetIdentityBalanceRequest.IGetIdentityBalanceRequestV0=} [properties] Properties to set + */ + function GetIdentityBalanceRequestV0(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]]; + } + + /** + * GetIdentityBalanceRequestV0 id. + * @member {Uint8Array} id + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0 + * @instance + */ + GetIdentityBalanceRequestV0.prototype.id = $util.newBuffer([]); + + /** + * GetIdentityBalanceRequestV0 prove. + * @member {boolean} prove + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0 + * @instance + */ + GetIdentityBalanceRequestV0.prototype.prove = false; + + /** + * Creates a new GetIdentityBalanceRequestV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityBalanceRequest.IGetIdentityBalanceRequestV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0} GetIdentityBalanceRequestV0 instance + */ + GetIdentityBalanceRequestV0.create = function create(properties) { + return new GetIdentityBalanceRequestV0(properties); + }; + + /** + * Encodes the specified GetIdentityBalanceRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityBalanceRequest.IGetIdentityBalanceRequestV0} message GetIdentityBalanceRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityBalanceRequestV0.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).bytes(message.id); + if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.prove); + return writer; + }; + + /** + * Encodes the specified GetIdentityBalanceRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityBalanceRequest.IGetIdentityBalanceRequestV0} message GetIdentityBalanceRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityBalanceRequestV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentityBalanceRequestV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0} GetIdentityBalanceRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityBalanceRequestV0.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.org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.bytes(); + break; + case 2: + message.prove = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentityBalanceRequestV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0} GetIdentityBalanceRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityBalanceRequestV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentityBalanceRequestV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentityBalanceRequestV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.id != null && message.hasOwnProperty("id")) + if (!(message.id && typeof message.id.length === "number" || $util.isString(message.id))) + return "id: buffer expected"; + if (message.prove != null && message.hasOwnProperty("prove")) + if (typeof message.prove !== "boolean") + return "prove: boolean expected"; + return null; + }; + + /** + * Creates a GetIdentityBalanceRequestV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0} GetIdentityBalanceRequestV0 + */ + GetIdentityBalanceRequestV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0(); + if (object.id != null) + if (typeof object.id === "string") + $util.base64.decode(object.id, message.id = $util.newBuffer($util.base64.length(object.id)), 0); + else if (object.id.length >= 0) + message.id = object.id; + if (object.prove != null) + message.prove = Boolean(object.prove); + return message; + }; + + /** + * Creates a plain object from a GetIdentityBalanceRequestV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0} message GetIdentityBalanceRequestV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentityBalanceRequestV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.id = ""; + else { + object.id = []; + if (options.bytes !== Array) + object.id = $util.newBuffer(object.id); + } + object.prove = false; + } + if (message.id != null && message.hasOwnProperty("id")) + object.id = options.bytes === String ? $util.base64.encode(message.id, 0, message.id.length) : options.bytes === Array ? Array.prototype.slice.call(message.id) : message.id; + if (message.prove != null && message.hasOwnProperty("prove")) + object.prove = message.prove; + return object; + }; + + /** + * Converts this GetIdentityBalanceRequestV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0 + * @instance + * @returns {Object.} JSON object + */ + GetIdentityBalanceRequestV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetIdentityBalanceRequestV0; + })(); + + return GetIdentityBalanceRequest; + })(); + + v0.GetIdentityBalanceAndRevisionRequest = (function() { + + /** + * Properties of a GetIdentityBalanceAndRevisionRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetIdentityBalanceAndRevisionRequest + * @property {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.IGetIdentityBalanceAndRevisionRequestV0|null} [v0] GetIdentityBalanceAndRevisionRequest v0 + */ + + /** + * Constructs a new GetIdentityBalanceAndRevisionRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetIdentityBalanceAndRevisionRequest. + * @implements IGetIdentityBalanceAndRevisionRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IGetIdentityBalanceAndRevisionRequest=} [properties] Properties to set + */ + function GetIdentityBalanceAndRevisionRequest(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]]; + } + + /** + * GetIdentityBalanceAndRevisionRequest v0. + * @member {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.IGetIdentityBalanceAndRevisionRequestV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest + * @instance + */ + GetIdentityBalanceAndRevisionRequest.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetIdentityBalanceAndRevisionRequest version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest + * @instance + */ + Object.defineProperty(GetIdentityBalanceAndRevisionRequest.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetIdentityBalanceAndRevisionRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityBalanceAndRevisionRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest} GetIdentityBalanceAndRevisionRequest instance + */ + GetIdentityBalanceAndRevisionRequest.create = function create(properties) { + return new GetIdentityBalanceAndRevisionRequest(properties); + }; + + /** + * Encodes the specified GetIdentityBalanceAndRevisionRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityBalanceAndRevisionRequest} message GetIdentityBalanceAndRevisionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityBalanceAndRevisionRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetIdentityBalanceAndRevisionRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityBalanceAndRevisionRequest} message GetIdentityBalanceAndRevisionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityBalanceAndRevisionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentityBalanceAndRevisionRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest} GetIdentityBalanceAndRevisionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityBalanceAndRevisionRequest.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.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentityBalanceAndRevisionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest} GetIdentityBalanceAndRevisionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityBalanceAndRevisionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentityBalanceAndRevisionRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentityBalanceAndRevisionRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetIdentityBalanceAndRevisionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest} GetIdentityBalanceAndRevisionRequest + */ + GetIdentityBalanceAndRevisionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetIdentityBalanceAndRevisionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest} message GetIdentityBalanceAndRevisionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentityBalanceAndRevisionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetIdentityBalanceAndRevisionRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest + * @instance + * @returns {Object.} JSON object + */ + GetIdentityBalanceAndRevisionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0 = (function() { + + /** + * Properties of a GetIdentityBalanceAndRevisionRequestV0. + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest + * @interface IGetIdentityBalanceAndRevisionRequestV0 + * @property {Uint8Array|null} [id] GetIdentityBalanceAndRevisionRequestV0 id + * @property {boolean|null} [prove] GetIdentityBalanceAndRevisionRequestV0 prove + */ + + /** + * Constructs a new GetIdentityBalanceAndRevisionRequestV0. + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest + * @classdesc Represents a GetIdentityBalanceAndRevisionRequestV0. + * @implements IGetIdentityBalanceAndRevisionRequestV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.IGetIdentityBalanceAndRevisionRequestV0=} [properties] Properties to set + */ + function GetIdentityBalanceAndRevisionRequestV0(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]]; + } + + /** + * GetIdentityBalanceAndRevisionRequestV0 id. + * @member {Uint8Array} id + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0 + * @instance + */ + GetIdentityBalanceAndRevisionRequestV0.prototype.id = $util.newBuffer([]); + + /** + * GetIdentityBalanceAndRevisionRequestV0 prove. + * @member {boolean} prove + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0 + * @instance + */ + GetIdentityBalanceAndRevisionRequestV0.prototype.prove = false; + + /** + * Creates a new GetIdentityBalanceAndRevisionRequestV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.IGetIdentityBalanceAndRevisionRequestV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0} GetIdentityBalanceAndRevisionRequestV0 instance + */ + GetIdentityBalanceAndRevisionRequestV0.create = function create(properties) { + return new GetIdentityBalanceAndRevisionRequestV0(properties); + }; + + /** + * Encodes the specified GetIdentityBalanceAndRevisionRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.IGetIdentityBalanceAndRevisionRequestV0} message GetIdentityBalanceAndRevisionRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityBalanceAndRevisionRequestV0.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).bytes(message.id); + if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.prove); + return writer; + }; + + /** + * Encodes the specified GetIdentityBalanceAndRevisionRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.IGetIdentityBalanceAndRevisionRequestV0} message GetIdentityBalanceAndRevisionRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityBalanceAndRevisionRequestV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentityBalanceAndRevisionRequestV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0} GetIdentityBalanceAndRevisionRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityBalanceAndRevisionRequestV0.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.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.bytes(); + break; + case 2: + message.prove = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentityBalanceAndRevisionRequestV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0} GetIdentityBalanceAndRevisionRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityBalanceAndRevisionRequestV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentityBalanceAndRevisionRequestV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentityBalanceAndRevisionRequestV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.id != null && message.hasOwnProperty("id")) + if (!(message.id && typeof message.id.length === "number" || $util.isString(message.id))) + return "id: buffer expected"; + if (message.prove != null && message.hasOwnProperty("prove")) + if (typeof message.prove !== "boolean") + return "prove: boolean expected"; + return null; + }; + + /** + * Creates a GetIdentityBalanceAndRevisionRequestV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0} GetIdentityBalanceAndRevisionRequestV0 + */ + GetIdentityBalanceAndRevisionRequestV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0(); + if (object.id != null) + if (typeof object.id === "string") + $util.base64.decode(object.id, message.id = $util.newBuffer($util.base64.length(object.id)), 0); + else if (object.id.length >= 0) + message.id = object.id; + if (object.prove != null) + message.prove = Boolean(object.prove); + return message; + }; + + /** + * Creates a plain object from a GetIdentityBalanceAndRevisionRequestV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0} message GetIdentityBalanceAndRevisionRequestV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentityBalanceAndRevisionRequestV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.id = ""; + else { + object.id = []; + if (options.bytes !== Array) + object.id = $util.newBuffer(object.id); + } + object.prove = false; + } + if (message.id != null && message.hasOwnProperty("id")) + object.id = options.bytes === String ? $util.base64.encode(message.id, 0, message.id.length) : options.bytes === Array ? Array.prototype.slice.call(message.id) : message.id; + if (message.prove != null && message.hasOwnProperty("prove")) + object.prove = message.prove; + return object; + }; + + /** + * Converts this GetIdentityBalanceAndRevisionRequestV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0 + * @instance + * @returns {Object.} JSON object + */ + GetIdentityBalanceAndRevisionRequestV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetIdentityBalanceAndRevisionRequestV0; + })(); + + return GetIdentityBalanceAndRevisionRequest; + })(); + + v0.GetIdentityResponse = (function() { + + /** + * Properties of a GetIdentityResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetIdentityResponse + * @property {org.dash.platform.dapi.v0.GetIdentityResponse.IGetIdentityResponseV0|null} [v0] GetIdentityResponse v0 + */ + + /** + * Constructs a new GetIdentityResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetIdentityResponse. + * @implements IGetIdentityResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IGetIdentityResponse=} [properties] Properties to set + */ + function GetIdentityResponse(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]]; + } + + /** + * GetIdentityResponse v0. + * @member {org.dash.platform.dapi.v0.GetIdentityResponse.IGetIdentityResponseV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetIdentityResponse + * @instance + */ + GetIdentityResponse.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetIdentityResponse version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetIdentityResponse + * @instance + */ + Object.defineProperty(GetIdentityResponse.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetIdentityResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentityResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentityResponse} GetIdentityResponse instance + */ + GetIdentityResponse.create = function create(properties) { + return new GetIdentityResponse(properties); + }; + + /** + * Encodes the specified GetIdentityResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentityResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityResponse} message GetIdentityResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetIdentityResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityResponse} message GetIdentityResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentityResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentityResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentityResponse} GetIdentityResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityResponse.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.org.dash.platform.dapi.v0.GetIdentityResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentityResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentityResponse} GetIdentityResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentityResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentityResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentityResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetIdentityResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentityResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentityResponse} GetIdentityResponse + */ + GetIdentityResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentityResponse(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityResponse.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetIdentityResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentityResponse + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityResponse} message GetIdentityResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentityResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetIdentityResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentityResponse + * @instance + * @returns {Object.} JSON object + */ + GetIdentityResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetIdentityResponse.GetIdentityResponseV0 = (function() { + + /** + * Properties of a GetIdentityResponseV0. + * @memberof org.dash.platform.dapi.v0.GetIdentityResponse + * @interface IGetIdentityResponseV0 + * @property {Uint8Array|null} [identity] GetIdentityResponseV0 identity + * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetIdentityResponseV0 proof + * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetIdentityResponseV0 metadata + */ + + /** + * Constructs a new GetIdentityResponseV0. + * @memberof org.dash.platform.dapi.v0.GetIdentityResponse + * @classdesc Represents a GetIdentityResponseV0. + * @implements IGetIdentityResponseV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetIdentityResponse.IGetIdentityResponseV0=} [properties] Properties to set + */ + function GetIdentityResponseV0(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]]; + } + + /** + * GetIdentityResponseV0 identity. + * @member {Uint8Array} identity + * @memberof org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0 + * @instance + */ + GetIdentityResponseV0.prototype.identity = $util.newBuffer([]); + + /** + * GetIdentityResponseV0 proof. + * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof + * @memberof org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0 + * @instance + */ + GetIdentityResponseV0.prototype.proof = null; + + /** + * GetIdentityResponseV0 metadata. + * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata + * @memberof org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0 + * @instance + */ + GetIdentityResponseV0.prototype.metadata = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetIdentityResponseV0 result. + * @member {"identity"|"proof"|undefined} result + * @memberof org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0 + * @instance + */ + Object.defineProperty(GetIdentityResponseV0.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["identity", "proof"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetIdentityResponseV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityResponse.IGetIdentityResponseV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0} GetIdentityResponseV0 instance + */ + GetIdentityResponseV0.create = function create(properties) { + return new GetIdentityResponseV0(properties); + }; + + /** + * Encodes the specified GetIdentityResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityResponse.IGetIdentityResponseV0} message GetIdentityResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityResponseV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.identity != null && Object.hasOwnProperty.call(message, "identity")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.identity); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetIdentityResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityResponse.IGetIdentityResponseV0} message GetIdentityResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityResponseV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentityResponseV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0} GetIdentityResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityResponseV0.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.org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.identity = reader.bytes(); + break; + case 2: + message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); + break; + case 3: + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentityResponseV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0} GetIdentityResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityResponseV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentityResponseV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentityResponseV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.identity != null && message.hasOwnProperty("identity")) { + properties.result = 1; + if (!(message.identity && typeof message.identity.length === "number" || $util.isString(message.identity))) + return "identity: buffer expected"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); + if (error) + return "proof." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a GetIdentityResponseV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0} GetIdentityResponseV0 + */ + GetIdentityResponseV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0(); + if (object.identity != null) + if (typeof object.identity === "string") + $util.base64.decode(object.identity, message.identity = $util.newBuffer($util.base64.length(object.identity)), 0); + else if (object.identity.length >= 0) + message.identity = object.identity; + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0.proof: object expected"); + message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0.metadata: object expected"); + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a GetIdentityResponseV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0} message GetIdentityResponseV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentityResponseV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.metadata = null; + if (message.identity != null && message.hasOwnProperty("identity")) { + object.identity = options.bytes === String ? $util.base64.encode(message.identity, 0, message.identity.length) : options.bytes === Array ? Array.prototype.slice.call(message.identity) : message.identity; + if (options.oneofs) + object.result = "identity"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); + if (options.oneofs) + object.result = "proof"; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this GetIdentityResponseV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0 + * @instance + * @returns {Object.} JSON object + */ + GetIdentityResponseV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetIdentityResponseV0; + })(); + + return GetIdentityResponse; + })(); + + v0.GetIdentityNonceResponse = (function() { + + /** + * Properties of a GetIdentityNonceResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetIdentityNonceResponse + * @property {org.dash.platform.dapi.v0.GetIdentityNonceResponse.IGetIdentityNonceResponseV0|null} [v0] GetIdentityNonceResponse v0 + */ + + /** + * Constructs a new GetIdentityNonceResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetIdentityNonceResponse. + * @implements IGetIdentityNonceResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IGetIdentityNonceResponse=} [properties] Properties to set + */ + function GetIdentityNonceResponse(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]]; + } + + /** + * GetIdentityNonceResponse v0. + * @member {org.dash.platform.dapi.v0.GetIdentityNonceResponse.IGetIdentityNonceResponseV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceResponse + * @instance + */ + GetIdentityNonceResponse.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetIdentityNonceResponse version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceResponse + * @instance + */ + Object.defineProperty(GetIdentityNonceResponse.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetIdentityNonceResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityNonceResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentityNonceResponse} GetIdentityNonceResponse instance + */ + GetIdentityNonceResponse.create = function create(properties) { + return new GetIdentityNonceResponse(properties); + }; + + /** + * Encodes the specified GetIdentityNonceResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityNonceResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityNonceResponse} message GetIdentityNonceResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityNonceResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetIdentityNonceResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityNonceResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityNonceResponse} message GetIdentityNonceResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityNonceResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentityNonceResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentityNonceResponse} GetIdentityNonceResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityNonceResponse.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.org.dash.platform.dapi.v0.GetIdentityNonceResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentityNonceResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentityNonceResponse} GetIdentityNonceResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityNonceResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentityNonceResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentityNonceResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetIdentityNonceResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentityNonceResponse} GetIdentityNonceResponse + */ + GetIdentityNonceResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityNonceResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentityNonceResponse(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityNonceResponse.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetIdentityNonceResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceResponse + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityNonceResponse} message GetIdentityNonceResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentityNonceResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetIdentityNonceResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceResponse + * @instance + * @returns {Object.} JSON object + */ + GetIdentityNonceResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetIdentityNonceResponse.GetIdentityNonceResponseV0 = (function() { + + /** + * Properties of a GetIdentityNonceResponseV0. + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceResponse + * @interface IGetIdentityNonceResponseV0 + * @property {number|Long|null} [identityNonce] GetIdentityNonceResponseV0 identityNonce + * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetIdentityNonceResponseV0 proof + * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetIdentityNonceResponseV0 metadata + */ + + /** + * Constructs a new GetIdentityNonceResponseV0. + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceResponse + * @classdesc Represents a GetIdentityNonceResponseV0. + * @implements IGetIdentityNonceResponseV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetIdentityNonceResponse.IGetIdentityNonceResponseV0=} [properties] Properties to set + */ + function GetIdentityNonceResponseV0(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]]; + } + + /** + * GetIdentityNonceResponseV0 identityNonce. + * @member {number|Long} identityNonce + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0 + * @instance + */ + GetIdentityNonceResponseV0.prototype.identityNonce = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * GetIdentityNonceResponseV0 proof. + * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0 + * @instance + */ + GetIdentityNonceResponseV0.prototype.proof = null; + + /** + * GetIdentityNonceResponseV0 metadata. + * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0 + * @instance + */ + GetIdentityNonceResponseV0.prototype.metadata = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetIdentityNonceResponseV0 result. + * @member {"identityNonce"|"proof"|undefined} result + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0 + * @instance + */ + Object.defineProperty(GetIdentityNonceResponseV0.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["identityNonce", "proof"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetIdentityNonceResponseV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityNonceResponse.IGetIdentityNonceResponseV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0} GetIdentityNonceResponseV0 instance + */ + GetIdentityNonceResponseV0.create = function create(properties) { + return new GetIdentityNonceResponseV0(properties); + }; + + /** + * Encodes the specified GetIdentityNonceResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityNonceResponse.IGetIdentityNonceResponseV0} message GetIdentityNonceResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityNonceResponseV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.identityNonce != null && Object.hasOwnProperty.call(message, "identityNonce")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.identityNonce); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetIdentityNonceResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityNonceResponse.IGetIdentityNonceResponseV0} message GetIdentityNonceResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityNonceResponseV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentityNonceResponseV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0} GetIdentityNonceResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityNonceResponseV0.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.org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.identityNonce = reader.uint64(); + break; + case 2: + message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); + break; + case 3: + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentityNonceResponseV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0} GetIdentityNonceResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityNonceResponseV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentityNonceResponseV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentityNonceResponseV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.identityNonce != null && message.hasOwnProperty("identityNonce")) { + properties.result = 1; + if (!$util.isInteger(message.identityNonce) && !(message.identityNonce && $util.isInteger(message.identityNonce.low) && $util.isInteger(message.identityNonce.high))) + return "identityNonce: integer|Long expected"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); + if (error) + return "proof." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a GetIdentityNonceResponseV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0} GetIdentityNonceResponseV0 + */ + GetIdentityNonceResponseV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0(); + if (object.identityNonce != null) + if ($util.Long) + (message.identityNonce = $util.Long.fromValue(object.identityNonce)).unsigned = true; + else if (typeof object.identityNonce === "string") + message.identityNonce = parseInt(object.identityNonce, 10); + else if (typeof object.identityNonce === "number") + message.identityNonce = object.identityNonce; + else if (typeof object.identityNonce === "object") + message.identityNonce = new $util.LongBits(object.identityNonce.low >>> 0, object.identityNonce.high >>> 0).toNumber(true); + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0.proof: object expected"); + message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0.metadata: object expected"); + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a GetIdentityNonceResponseV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0} message GetIdentityNonceResponseV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentityNonceResponseV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.metadata = null; + if (message.identityNonce != null && message.hasOwnProperty("identityNonce")) { + if (typeof message.identityNonce === "number") + object.identityNonce = options.longs === String ? String(message.identityNonce) : message.identityNonce; + else + object.identityNonce = options.longs === String ? $util.Long.prototype.toString.call(message.identityNonce) : options.longs === Number ? new $util.LongBits(message.identityNonce.low >>> 0, message.identityNonce.high >>> 0).toNumber(true) : message.identityNonce; + if (options.oneofs) + object.result = "identityNonce"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); + if (options.oneofs) + object.result = "proof"; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this GetIdentityNonceResponseV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0 + * @instance + * @returns {Object.} JSON object + */ + GetIdentityNonceResponseV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetIdentityNonceResponseV0; + })(); + + return GetIdentityNonceResponse; + })(); + + v0.GetIdentityContractNonceResponse = (function() { + + /** + * Properties of a GetIdentityContractNonceResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetIdentityContractNonceResponse + * @property {org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.IGetIdentityContractNonceResponseV0|null} [v0] GetIdentityContractNonceResponse v0 + */ + + /** + * Constructs a new GetIdentityContractNonceResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetIdentityContractNonceResponse. + * @implements IGetIdentityContractNonceResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IGetIdentityContractNonceResponse=} [properties] Properties to set + */ + function GetIdentityContractNonceResponse(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]]; + } + + /** + * GetIdentityContractNonceResponse v0. + * @member {org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.IGetIdentityContractNonceResponseV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceResponse + * @instance + */ + GetIdentityContractNonceResponse.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetIdentityContractNonceResponse version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceResponse + * @instance + */ + Object.defineProperty(GetIdentityContractNonceResponse.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetIdentityContractNonceResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityContractNonceResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentityContractNonceResponse} GetIdentityContractNonceResponse instance + */ + GetIdentityContractNonceResponse.create = function create(properties) { + return new GetIdentityContractNonceResponse(properties); + }; + + /** + * Encodes the specified GetIdentityContractNonceResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityContractNonceResponse} message GetIdentityContractNonceResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityContractNonceResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetIdentityContractNonceResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityContractNonceResponse} message GetIdentityContractNonceResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityContractNonceResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentityContractNonceResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentityContractNonceResponse} GetIdentityContractNonceResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityContractNonceResponse.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.org.dash.platform.dapi.v0.GetIdentityContractNonceResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentityContractNonceResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentityContractNonceResponse} GetIdentityContractNonceResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityContractNonceResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentityContractNonceResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentityContractNonceResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetIdentityContractNonceResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentityContractNonceResponse} GetIdentityContractNonceResponse + */ + GetIdentityContractNonceResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityContractNonceResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentityContractNonceResponse(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetIdentityContractNonceResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceResponse + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityContractNonceResponse} message GetIdentityContractNonceResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentityContractNonceResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetIdentityContractNonceResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceResponse + * @instance + * @returns {Object.} JSON object + */ + GetIdentityContractNonceResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0 = (function() { + + /** + * Properties of a GetIdentityContractNonceResponseV0. + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceResponse + * @interface IGetIdentityContractNonceResponseV0 + * @property {number|Long|null} [identityContractNonce] GetIdentityContractNonceResponseV0 identityContractNonce + * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetIdentityContractNonceResponseV0 proof + * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetIdentityContractNonceResponseV0 metadata + */ + + /** + * Constructs a new GetIdentityContractNonceResponseV0. + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceResponse + * @classdesc Represents a GetIdentityContractNonceResponseV0. + * @implements IGetIdentityContractNonceResponseV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.IGetIdentityContractNonceResponseV0=} [properties] Properties to set + */ + function GetIdentityContractNonceResponseV0(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]]; + } + + /** + * GetIdentityContractNonceResponseV0 identityContractNonce. + * @member {number|Long} identityContractNonce + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0 + * @instance + */ + GetIdentityContractNonceResponseV0.prototype.identityContractNonce = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * GetIdentityContractNonceResponseV0 proof. + * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0 + * @instance + */ + GetIdentityContractNonceResponseV0.prototype.proof = null; + + /** + * GetIdentityContractNonceResponseV0 metadata. + * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0 + * @instance + */ + GetIdentityContractNonceResponseV0.prototype.metadata = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetIdentityContractNonceResponseV0 result. + * @member {"identityContractNonce"|"proof"|undefined} result + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0 + * @instance + */ + Object.defineProperty(GetIdentityContractNonceResponseV0.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["identityContractNonce", "proof"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetIdentityContractNonceResponseV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.IGetIdentityContractNonceResponseV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0} GetIdentityContractNonceResponseV0 instance + */ + GetIdentityContractNonceResponseV0.create = function create(properties) { + return new GetIdentityContractNonceResponseV0(properties); + }; + + /** + * Encodes the specified GetIdentityContractNonceResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.IGetIdentityContractNonceResponseV0} message GetIdentityContractNonceResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityContractNonceResponseV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.identityContractNonce != null && Object.hasOwnProperty.call(message, "identityContractNonce")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.identityContractNonce); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetIdentityContractNonceResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.IGetIdentityContractNonceResponseV0} message GetIdentityContractNonceResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityContractNonceResponseV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentityContractNonceResponseV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0} GetIdentityContractNonceResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityContractNonceResponseV0.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.org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.identityContractNonce = reader.uint64(); + break; + case 2: + message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); + break; + case 3: + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentityContractNonceResponseV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0} GetIdentityContractNonceResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityContractNonceResponseV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentityContractNonceResponseV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentityContractNonceResponseV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.identityContractNonce != null && message.hasOwnProperty("identityContractNonce")) { + properties.result = 1; + if (!$util.isInteger(message.identityContractNonce) && !(message.identityContractNonce && $util.isInteger(message.identityContractNonce.low) && $util.isInteger(message.identityContractNonce.high))) + return "identityContractNonce: integer|Long expected"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); + if (error) + return "proof." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a GetIdentityContractNonceResponseV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0} GetIdentityContractNonceResponseV0 + */ + GetIdentityContractNonceResponseV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0(); + if (object.identityContractNonce != null) + if ($util.Long) + (message.identityContractNonce = $util.Long.fromValue(object.identityContractNonce)).unsigned = true; + else if (typeof object.identityContractNonce === "string") + message.identityContractNonce = parseInt(object.identityContractNonce, 10); + else if (typeof object.identityContractNonce === "number") + message.identityContractNonce = object.identityContractNonce; + else if (typeof object.identityContractNonce === "object") + message.identityContractNonce = new $util.LongBits(object.identityContractNonce.low >>> 0, object.identityContractNonce.high >>> 0).toNumber(true); + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0.proof: object expected"); + message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0.metadata: object expected"); + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a GetIdentityContractNonceResponseV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0} message GetIdentityContractNonceResponseV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentityContractNonceResponseV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.metadata = null; + if (message.identityContractNonce != null && message.hasOwnProperty("identityContractNonce")) { + if (typeof message.identityContractNonce === "number") + object.identityContractNonce = options.longs === String ? String(message.identityContractNonce) : message.identityContractNonce; + else + object.identityContractNonce = options.longs === String ? $util.Long.prototype.toString.call(message.identityContractNonce) : options.longs === Number ? new $util.LongBits(message.identityContractNonce.low >>> 0, message.identityContractNonce.high >>> 0).toNumber(true) : message.identityContractNonce; + if (options.oneofs) + object.result = "identityContractNonce"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); + if (options.oneofs) + object.result = "proof"; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this GetIdentityContractNonceResponseV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0 + * @instance + * @returns {Object.} JSON object + */ + GetIdentityContractNonceResponseV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetIdentityContractNonceResponseV0; + })(); + + return GetIdentityContractNonceResponse; + })(); + + v0.GetIdentityBalanceResponse = (function() { + + /** + * Properties of a GetIdentityBalanceResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetIdentityBalanceResponse + * @property {org.dash.platform.dapi.v0.GetIdentityBalanceResponse.IGetIdentityBalanceResponseV0|null} [v0] GetIdentityBalanceResponse v0 + */ + + /** + * Constructs a new GetIdentityBalanceResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetIdentityBalanceResponse. + * @implements IGetIdentityBalanceResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IGetIdentityBalanceResponse=} [properties] Properties to set + */ + function GetIdentityBalanceResponse(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]]; + } + + /** + * GetIdentityBalanceResponse v0. + * @member {org.dash.platform.dapi.v0.GetIdentityBalanceResponse.IGetIdentityBalanceResponseV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse + * @instance + */ + GetIdentityBalanceResponse.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetIdentityBalanceResponse version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse + * @instance + */ + Object.defineProperty(GetIdentityBalanceResponse.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetIdentityBalanceResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityBalanceResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceResponse} GetIdentityBalanceResponse instance + */ + GetIdentityBalanceResponse.create = function create(properties) { + return new GetIdentityBalanceResponse(properties); + }; + + /** + * Encodes the specified GetIdentityBalanceResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityBalanceResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityBalanceResponse} message GetIdentityBalanceResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityBalanceResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetIdentityBalanceResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityBalanceResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityBalanceResponse} message GetIdentityBalanceResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityBalanceResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentityBalanceResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceResponse} GetIdentityBalanceResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityBalanceResponse.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.org.dash.platform.dapi.v0.GetIdentityBalanceResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentityBalanceResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceResponse} GetIdentityBalanceResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityBalanceResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentityBalanceResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentityBalanceResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetIdentityBalanceResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceResponse} GetIdentityBalanceResponse + */ + GetIdentityBalanceResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityBalanceResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentityBalanceResponse(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityBalanceResponse.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetIdentityBalanceResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityBalanceResponse} message GetIdentityBalanceResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentityBalanceResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetIdentityBalanceResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse + * @instance + * @returns {Object.} JSON object + */ + GetIdentityBalanceResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetIdentityBalanceResponse.GetIdentityBalanceResponseV0 = (function() { + + /** + * Properties of a GetIdentityBalanceResponseV0. + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse + * @interface IGetIdentityBalanceResponseV0 + * @property {number|Long|null} [balance] GetIdentityBalanceResponseV0 balance + * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetIdentityBalanceResponseV0 proof + * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetIdentityBalanceResponseV0 metadata + */ + + /** + * Constructs a new GetIdentityBalanceResponseV0. + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse + * @classdesc Represents a GetIdentityBalanceResponseV0. + * @implements IGetIdentityBalanceResponseV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetIdentityBalanceResponse.IGetIdentityBalanceResponseV0=} [properties] Properties to set + */ + function GetIdentityBalanceResponseV0(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]]; + } + + /** + * GetIdentityBalanceResponseV0 balance. + * @member {number|Long} balance + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0 + * @instance + */ + GetIdentityBalanceResponseV0.prototype.balance = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * GetIdentityBalanceResponseV0 proof. + * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0 + * @instance + */ + GetIdentityBalanceResponseV0.prototype.proof = null; + + /** + * GetIdentityBalanceResponseV0 metadata. + * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0 + * @instance + */ + GetIdentityBalanceResponseV0.prototype.metadata = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetIdentityBalanceResponseV0 result. + * @member {"balance"|"proof"|undefined} result + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0 + * @instance + */ + Object.defineProperty(GetIdentityBalanceResponseV0.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["balance", "proof"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetIdentityBalanceResponseV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityBalanceResponse.IGetIdentityBalanceResponseV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0} GetIdentityBalanceResponseV0 instance + */ + GetIdentityBalanceResponseV0.create = function create(properties) { + return new GetIdentityBalanceResponseV0(properties); + }; + + /** + * Encodes the specified GetIdentityBalanceResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityBalanceResponse.IGetIdentityBalanceResponseV0} message GetIdentityBalanceResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityBalanceResponseV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.balance != null && Object.hasOwnProperty.call(message, "balance")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.balance); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetIdentityBalanceResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityBalanceResponse.IGetIdentityBalanceResponseV0} message GetIdentityBalanceResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityBalanceResponseV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentityBalanceResponseV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0} GetIdentityBalanceResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityBalanceResponseV0.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.org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.balance = reader.uint64(); + break; + case 2: + message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); + break; + case 3: + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentityBalanceResponseV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0} GetIdentityBalanceResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityBalanceResponseV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentityBalanceResponseV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentityBalanceResponseV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.balance != null && message.hasOwnProperty("balance")) { + properties.result = 1; + if (!$util.isInteger(message.balance) && !(message.balance && $util.isInteger(message.balance.low) && $util.isInteger(message.balance.high))) + return "balance: integer|Long expected"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); + if (error) + return "proof." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a GetIdentityBalanceResponseV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0} GetIdentityBalanceResponseV0 + */ + GetIdentityBalanceResponseV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0(); + if (object.balance != null) + if ($util.Long) + (message.balance = $util.Long.fromValue(object.balance)).unsigned = true; + else if (typeof object.balance === "string") + message.balance = parseInt(object.balance, 10); + else if (typeof object.balance === "number") + message.balance = object.balance; + else if (typeof object.balance === "object") + message.balance = new $util.LongBits(object.balance.low >>> 0, object.balance.high >>> 0).toNumber(true); + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0.proof: object expected"); + message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0.metadata: object expected"); + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a GetIdentityBalanceResponseV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0} message GetIdentityBalanceResponseV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentityBalanceResponseV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.metadata = null; + if (message.balance != null && message.hasOwnProperty("balance")) { + if (typeof message.balance === "number") + object.balance = options.longs === String ? String(message.balance) : message.balance; + else + object.balance = options.longs === String ? $util.Long.prototype.toString.call(message.balance) : options.longs === Number ? new $util.LongBits(message.balance.low >>> 0, message.balance.high >>> 0).toNumber(true) : message.balance; + if (options.oneofs) + object.result = "balance"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); + if (options.oneofs) + object.result = "proof"; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this GetIdentityBalanceResponseV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0 + * @instance + * @returns {Object.} JSON object + */ + GetIdentityBalanceResponseV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetIdentityBalanceResponseV0; + })(); + + return GetIdentityBalanceResponse; + })(); + + v0.GetIdentityBalanceAndRevisionResponse = (function() { + + /** + * Properties of a GetIdentityBalanceAndRevisionResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetIdentityBalanceAndRevisionResponse + * @property {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.IGetIdentityBalanceAndRevisionResponseV0|null} [v0] GetIdentityBalanceAndRevisionResponse v0 + */ + + /** + * Constructs a new GetIdentityBalanceAndRevisionResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetIdentityBalanceAndRevisionResponse. + * @implements IGetIdentityBalanceAndRevisionResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IGetIdentityBalanceAndRevisionResponse=} [properties] Properties to set + */ + function GetIdentityBalanceAndRevisionResponse(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]]; + } + + /** + * GetIdentityBalanceAndRevisionResponse v0. + * @member {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.IGetIdentityBalanceAndRevisionResponseV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse + * @instance + */ + GetIdentityBalanceAndRevisionResponse.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetIdentityBalanceAndRevisionResponse version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse + * @instance + */ + Object.defineProperty(GetIdentityBalanceAndRevisionResponse.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetIdentityBalanceAndRevisionResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityBalanceAndRevisionResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse} GetIdentityBalanceAndRevisionResponse instance + */ + GetIdentityBalanceAndRevisionResponse.create = function create(properties) { + return new GetIdentityBalanceAndRevisionResponse(properties); + }; + + /** + * Encodes the specified GetIdentityBalanceAndRevisionResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityBalanceAndRevisionResponse} message GetIdentityBalanceAndRevisionResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityBalanceAndRevisionResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetIdentityBalanceAndRevisionResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityBalanceAndRevisionResponse} message GetIdentityBalanceAndRevisionResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityBalanceAndRevisionResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentityBalanceAndRevisionResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse} GetIdentityBalanceAndRevisionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityBalanceAndRevisionResponse.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.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentityBalanceAndRevisionResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse} GetIdentityBalanceAndRevisionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityBalanceAndRevisionResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentityBalanceAndRevisionResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentityBalanceAndRevisionResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetIdentityBalanceAndRevisionResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse} GetIdentityBalanceAndRevisionResponse + */ + GetIdentityBalanceAndRevisionResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetIdentityBalanceAndRevisionResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse} message GetIdentityBalanceAndRevisionResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentityBalanceAndRevisionResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetIdentityBalanceAndRevisionResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse + * @instance + * @returns {Object.} JSON object + */ + GetIdentityBalanceAndRevisionResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0 = (function() { + + /** + * Properties of a GetIdentityBalanceAndRevisionResponseV0. + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse + * @interface IGetIdentityBalanceAndRevisionResponseV0 + * @property {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.IBalanceAndRevision|null} [balanceAndRevision] GetIdentityBalanceAndRevisionResponseV0 balanceAndRevision + * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetIdentityBalanceAndRevisionResponseV0 proof + * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetIdentityBalanceAndRevisionResponseV0 metadata + */ + + /** + * Constructs a new GetIdentityBalanceAndRevisionResponseV0. + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse + * @classdesc Represents a GetIdentityBalanceAndRevisionResponseV0. + * @implements IGetIdentityBalanceAndRevisionResponseV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.IGetIdentityBalanceAndRevisionResponseV0=} [properties] Properties to set + */ + function GetIdentityBalanceAndRevisionResponseV0(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]]; + } + + /** + * GetIdentityBalanceAndRevisionResponseV0 balanceAndRevision. + * @member {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.IBalanceAndRevision|null|undefined} balanceAndRevision + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0 + * @instance + */ + GetIdentityBalanceAndRevisionResponseV0.prototype.balanceAndRevision = null; + + /** + * GetIdentityBalanceAndRevisionResponseV0 proof. + * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0 + * @instance + */ + GetIdentityBalanceAndRevisionResponseV0.prototype.proof = null; + + /** + * GetIdentityBalanceAndRevisionResponseV0 metadata. + * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0 + * @instance + */ + GetIdentityBalanceAndRevisionResponseV0.prototype.metadata = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetIdentityBalanceAndRevisionResponseV0 result. + * @member {"balanceAndRevision"|"proof"|undefined} result + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0 + * @instance + */ + Object.defineProperty(GetIdentityBalanceAndRevisionResponseV0.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["balanceAndRevision", "proof"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetIdentityBalanceAndRevisionResponseV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.IGetIdentityBalanceAndRevisionResponseV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0} GetIdentityBalanceAndRevisionResponseV0 instance + */ + GetIdentityBalanceAndRevisionResponseV0.create = function create(properties) { + return new GetIdentityBalanceAndRevisionResponseV0(properties); + }; + + /** + * Encodes the specified GetIdentityBalanceAndRevisionResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.IGetIdentityBalanceAndRevisionResponseV0} message GetIdentityBalanceAndRevisionResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityBalanceAndRevisionResponseV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.balanceAndRevision != null && Object.hasOwnProperty.call(message, "balanceAndRevision")) + $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision.encode(message.balanceAndRevision, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetIdentityBalanceAndRevisionResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.IGetIdentityBalanceAndRevisionResponseV0} message GetIdentityBalanceAndRevisionResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityBalanceAndRevisionResponseV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentityBalanceAndRevisionResponseV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0} GetIdentityBalanceAndRevisionResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityBalanceAndRevisionResponseV0.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.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.balanceAndRevision = $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision.decode(reader, reader.uint32()); + break; + case 2: + message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); + break; + case 3: + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentityBalanceAndRevisionResponseV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0} GetIdentityBalanceAndRevisionResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityBalanceAndRevisionResponseV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentityBalanceAndRevisionResponseV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentityBalanceAndRevisionResponseV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.balanceAndRevision != null && message.hasOwnProperty("balanceAndRevision")) { + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision.verify(message.balanceAndRevision); + if (error) + return "balanceAndRevision." + error; + } + } + if (message.proof != null && message.hasOwnProperty("proof")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); + if (error) + return "proof." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a GetIdentityBalanceAndRevisionResponseV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0} GetIdentityBalanceAndRevisionResponseV0 + */ + GetIdentityBalanceAndRevisionResponseV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0(); + if (object.balanceAndRevision != null) { + if (typeof object.balanceAndRevision !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.balanceAndRevision: object expected"); + message.balanceAndRevision = $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision.fromObject(object.balanceAndRevision); + } + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.proof: object expected"); + message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.metadata: object expected"); + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a GetIdentityBalanceAndRevisionResponseV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0} message GetIdentityBalanceAndRevisionResponseV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentityBalanceAndRevisionResponseV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.metadata = null; + if (message.balanceAndRevision != null && message.hasOwnProperty("balanceAndRevision")) { + object.balanceAndRevision = $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision.toObject(message.balanceAndRevision, options); + if (options.oneofs) + object.result = "balanceAndRevision"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); + if (options.oneofs) + object.result = "proof"; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this GetIdentityBalanceAndRevisionResponseV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0 + * @instance + * @returns {Object.} JSON object + */ + GetIdentityBalanceAndRevisionResponseV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision = (function() { + + /** + * Properties of a BalanceAndRevision. + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0 + * @interface IBalanceAndRevision + * @property {number|Long|null} [balance] BalanceAndRevision balance + * @property {number|Long|null} [revision] BalanceAndRevision revision + */ + + /** + * Constructs a new BalanceAndRevision. + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0 + * @classdesc Represents a BalanceAndRevision. + * @implements IBalanceAndRevision + * @constructor + * @param {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.IBalanceAndRevision=} [properties] Properties to set + */ + function BalanceAndRevision(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]]; + } + + /** + * BalanceAndRevision balance. + * @member {number|Long} balance + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision + * @instance + */ + BalanceAndRevision.prototype.balance = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * BalanceAndRevision revision. + * @member {number|Long} revision + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision + * @instance + */ + BalanceAndRevision.prototype.revision = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new BalanceAndRevision instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.IBalanceAndRevision=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision} BalanceAndRevision instance + */ + BalanceAndRevision.create = function create(properties) { + return new BalanceAndRevision(properties); + }; + + /** + * Encodes the specified BalanceAndRevision message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.IBalanceAndRevision} message BalanceAndRevision message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BalanceAndRevision.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.balance != null && Object.hasOwnProperty.call(message, "balance")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.balance); + if (message.revision != null && Object.hasOwnProperty.call(message, "revision")) + writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.revision); + return writer; + }; + + /** + * Encodes the specified BalanceAndRevision message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.IBalanceAndRevision} message BalanceAndRevision message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BalanceAndRevision.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BalanceAndRevision message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision} BalanceAndRevision + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BalanceAndRevision.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.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.balance = reader.uint64(); + break; + case 2: + message.revision = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BalanceAndRevision message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision} BalanceAndRevision + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BalanceAndRevision.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BalanceAndRevision message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BalanceAndRevision.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.balance != null && message.hasOwnProperty("balance")) + if (!$util.isInteger(message.balance) && !(message.balance && $util.isInteger(message.balance.low) && $util.isInteger(message.balance.high))) + return "balance: integer|Long expected"; + if (message.revision != null && message.hasOwnProperty("revision")) + if (!$util.isInteger(message.revision) && !(message.revision && $util.isInteger(message.revision.low) && $util.isInteger(message.revision.high))) + return "revision: integer|Long expected"; + return null; + }; + + /** + * Creates a BalanceAndRevision message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision} BalanceAndRevision + */ + BalanceAndRevision.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision(); + if (object.balance != null) + if ($util.Long) + (message.balance = $util.Long.fromValue(object.balance)).unsigned = true; + else if (typeof object.balance === "string") + message.balance = parseInt(object.balance, 10); + else if (typeof object.balance === "number") + message.balance = object.balance; + else if (typeof object.balance === "object") + message.balance = new $util.LongBits(object.balance.low >>> 0, object.balance.high >>> 0).toNumber(true); + if (object.revision != null) + if ($util.Long) + (message.revision = $util.Long.fromValue(object.revision)).unsigned = true; + else if (typeof object.revision === "string") + message.revision = parseInt(object.revision, 10); + else if (typeof object.revision === "number") + message.revision = object.revision; + else if (typeof object.revision === "object") + message.revision = new $util.LongBits(object.revision.low >>> 0, object.revision.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from a BalanceAndRevision message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision} message BalanceAndRevision + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BalanceAndRevision.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.balance = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.balance = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.revision = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.revision = options.longs === String ? "0" : 0; + } + if (message.balance != null && message.hasOwnProperty("balance")) + if (typeof message.balance === "number") + object.balance = options.longs === String ? String(message.balance) : message.balance; + else + object.balance = options.longs === String ? $util.Long.prototype.toString.call(message.balance) : options.longs === Number ? new $util.LongBits(message.balance.low >>> 0, message.balance.high >>> 0).toNumber(true) : message.balance; + if (message.revision != null && message.hasOwnProperty("revision")) + if (typeof message.revision === "number") + object.revision = options.longs === String ? String(message.revision) : message.revision; + else + object.revision = options.longs === String ? $util.Long.prototype.toString.call(message.revision) : options.longs === Number ? new $util.LongBits(message.revision.low >>> 0, message.revision.high >>> 0).toNumber(true) : message.revision; + return object; + }; + + /** + * Converts this BalanceAndRevision to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision + * @instance + * @returns {Object.} JSON object + */ + BalanceAndRevision.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return BalanceAndRevision; + })(); + + return GetIdentityBalanceAndRevisionResponseV0; + })(); + + return GetIdentityBalanceAndRevisionResponse; + })(); + + v0.KeyRequestType = (function() { + + /** + * Properties of a KeyRequestType. + * @memberof org.dash.platform.dapi.v0 + * @interface IKeyRequestType + * @property {org.dash.platform.dapi.v0.IAllKeys|null} [allKeys] KeyRequestType allKeys + * @property {org.dash.platform.dapi.v0.ISpecificKeys|null} [specificKeys] KeyRequestType specificKeys + * @property {org.dash.platform.dapi.v0.ISearchKey|null} [searchKey] KeyRequestType searchKey + */ + + /** + * Constructs a new KeyRequestType. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a KeyRequestType. + * @implements IKeyRequestType + * @constructor + * @param {org.dash.platform.dapi.v0.IKeyRequestType=} [properties] Properties to set + */ + function KeyRequestType(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]]; + } + + /** + * KeyRequestType allKeys. + * @member {org.dash.platform.dapi.v0.IAllKeys|null|undefined} allKeys + * @memberof org.dash.platform.dapi.v0.KeyRequestType + * @instance + */ + KeyRequestType.prototype.allKeys = null; + + /** + * KeyRequestType specificKeys. + * @member {org.dash.platform.dapi.v0.ISpecificKeys|null|undefined} specificKeys + * @memberof org.dash.platform.dapi.v0.KeyRequestType + * @instance + */ + KeyRequestType.prototype.specificKeys = null; + + /** + * KeyRequestType searchKey. + * @member {org.dash.platform.dapi.v0.ISearchKey|null|undefined} searchKey + * @memberof org.dash.platform.dapi.v0.KeyRequestType + * @instance + */ + KeyRequestType.prototype.searchKey = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * KeyRequestType request. + * @member {"allKeys"|"specificKeys"|"searchKey"|undefined} request + * @memberof org.dash.platform.dapi.v0.KeyRequestType + * @instance + */ + Object.defineProperty(KeyRequestType.prototype, "request", { + get: $util.oneOfGetter($oneOfFields = ["allKeys", "specificKeys", "searchKey"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new KeyRequestType instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.KeyRequestType + * @static + * @param {org.dash.platform.dapi.v0.IKeyRequestType=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.KeyRequestType} KeyRequestType instance + */ + KeyRequestType.create = function create(properties) { + return new KeyRequestType(properties); + }; + + /** + * Encodes the specified KeyRequestType message. Does not implicitly {@link org.dash.platform.dapi.v0.KeyRequestType.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.KeyRequestType + * @static + * @param {org.dash.platform.dapi.v0.IKeyRequestType} message KeyRequestType message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KeyRequestType.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.allKeys != null && Object.hasOwnProperty.call(message, "allKeys")) + $root.org.dash.platform.dapi.v0.AllKeys.encode(message.allKeys, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.specificKeys != null && Object.hasOwnProperty.call(message, "specificKeys")) + $root.org.dash.platform.dapi.v0.SpecificKeys.encode(message.specificKeys, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.searchKey != null && Object.hasOwnProperty.call(message, "searchKey")) + $root.org.dash.platform.dapi.v0.SearchKey.encode(message.searchKey, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified KeyRequestType message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.KeyRequestType.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.KeyRequestType + * @static + * @param {org.dash.platform.dapi.v0.IKeyRequestType} message KeyRequestType message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KeyRequestType.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a KeyRequestType message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.KeyRequestType + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.KeyRequestType} KeyRequestType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KeyRequestType.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.org.dash.platform.dapi.v0.KeyRequestType(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.allKeys = $root.org.dash.platform.dapi.v0.AllKeys.decode(reader, reader.uint32()); + break; + case 2: + message.specificKeys = $root.org.dash.platform.dapi.v0.SpecificKeys.decode(reader, reader.uint32()); + break; + case 3: + message.searchKey = $root.org.dash.platform.dapi.v0.SearchKey.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a KeyRequestType message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.KeyRequestType + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.KeyRequestType} KeyRequestType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KeyRequestType.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a KeyRequestType message. + * @function verify + * @memberof org.dash.platform.dapi.v0.KeyRequestType + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + KeyRequestType.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.allKeys != null && message.hasOwnProperty("allKeys")) { + properties.request = 1; + { + var error = $root.org.dash.platform.dapi.v0.AllKeys.verify(message.allKeys); + if (error) + return "allKeys." + error; + } + } + if (message.specificKeys != null && message.hasOwnProperty("specificKeys")) { + if (properties.request === 1) + return "request: multiple values"; + properties.request = 1; + { + var error = $root.org.dash.platform.dapi.v0.SpecificKeys.verify(message.specificKeys); + if (error) + return "specificKeys." + error; + } + } + if (message.searchKey != null && message.hasOwnProperty("searchKey")) { + if (properties.request === 1) + return "request: multiple values"; + properties.request = 1; + { + var error = $root.org.dash.platform.dapi.v0.SearchKey.verify(message.searchKey); + if (error) + return "searchKey." + error; + } + } + return null; + }; + + /** + * Creates a KeyRequestType message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.KeyRequestType + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.KeyRequestType} KeyRequestType + */ + KeyRequestType.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.KeyRequestType) + return object; + var message = new $root.org.dash.platform.dapi.v0.KeyRequestType(); + if (object.allKeys != null) { + if (typeof object.allKeys !== "object") + throw TypeError(".org.dash.platform.dapi.v0.KeyRequestType.allKeys: object expected"); + message.allKeys = $root.org.dash.platform.dapi.v0.AllKeys.fromObject(object.allKeys); + } + if (object.specificKeys != null) { + if (typeof object.specificKeys !== "object") + throw TypeError(".org.dash.platform.dapi.v0.KeyRequestType.specificKeys: object expected"); + message.specificKeys = $root.org.dash.platform.dapi.v0.SpecificKeys.fromObject(object.specificKeys); + } + if (object.searchKey != null) { + if (typeof object.searchKey !== "object") + throw TypeError(".org.dash.platform.dapi.v0.KeyRequestType.searchKey: object expected"); + message.searchKey = $root.org.dash.platform.dapi.v0.SearchKey.fromObject(object.searchKey); + } + return message; + }; + + /** + * Creates a plain object from a KeyRequestType message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.KeyRequestType + * @static + * @param {org.dash.platform.dapi.v0.KeyRequestType} message KeyRequestType + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + KeyRequestType.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.allKeys != null && message.hasOwnProperty("allKeys")) { + object.allKeys = $root.org.dash.platform.dapi.v0.AllKeys.toObject(message.allKeys, options); + if (options.oneofs) + object.request = "allKeys"; + } + if (message.specificKeys != null && message.hasOwnProperty("specificKeys")) { + object.specificKeys = $root.org.dash.platform.dapi.v0.SpecificKeys.toObject(message.specificKeys, options); + if (options.oneofs) + object.request = "specificKeys"; + } + if (message.searchKey != null && message.hasOwnProperty("searchKey")) { + object.searchKey = $root.org.dash.platform.dapi.v0.SearchKey.toObject(message.searchKey, options); + if (options.oneofs) + object.request = "searchKey"; + } + return object; + }; + + /** + * Converts this KeyRequestType to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.KeyRequestType + * @instance + * @returns {Object.} JSON object + */ + KeyRequestType.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return KeyRequestType; + })(); + + v0.AllKeys = (function() { + + /** + * Properties of an AllKeys. + * @memberof org.dash.platform.dapi.v0 + * @interface IAllKeys + */ + + /** + * Constructs a new AllKeys. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents an AllKeys. + * @implements IAllKeys + * @constructor + * @param {org.dash.platform.dapi.v0.IAllKeys=} [properties] Properties to set + */ + function AllKeys(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]]; + } + + /** + * Creates a new AllKeys instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.AllKeys + * @static + * @param {org.dash.platform.dapi.v0.IAllKeys=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.AllKeys} AllKeys instance + */ + AllKeys.create = function create(properties) { + return new AllKeys(properties); + }; + + /** + * Encodes the specified AllKeys message. Does not implicitly {@link org.dash.platform.dapi.v0.AllKeys.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.AllKeys + * @static + * @param {org.dash.platform.dapi.v0.IAllKeys} message AllKeys message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AllKeys.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified AllKeys message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.AllKeys.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.AllKeys + * @static + * @param {org.dash.platform.dapi.v0.IAllKeys} message AllKeys message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AllKeys.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AllKeys message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.AllKeys + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.AllKeys} AllKeys + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AllKeys.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.org.dash.platform.dapi.v0.AllKeys(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AllKeys message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.AllKeys + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.AllKeys} AllKeys + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AllKeys.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AllKeys message. + * @function verify + * @memberof org.dash.platform.dapi.v0.AllKeys + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AllKeys.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an AllKeys message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.AllKeys + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.AllKeys} AllKeys + */ + AllKeys.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.AllKeys) + return object; + return new $root.org.dash.platform.dapi.v0.AllKeys(); + }; + + /** + * Creates a plain object from an AllKeys message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.AllKeys + * @static + * @param {org.dash.platform.dapi.v0.AllKeys} message AllKeys + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AllKeys.toObject = function toObject() { + return {}; + }; + + /** + * Converts this AllKeys to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.AllKeys + * @instance + * @returns {Object.} JSON object + */ + AllKeys.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AllKeys; + })(); + + v0.SpecificKeys = (function() { + + /** + * Properties of a SpecificKeys. + * @memberof org.dash.platform.dapi.v0 + * @interface ISpecificKeys + * @property {Array.|null} [keyIds] SpecificKeys keyIds + */ + + /** + * Constructs a new SpecificKeys. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a SpecificKeys. + * @implements ISpecificKeys + * @constructor + * @param {org.dash.platform.dapi.v0.ISpecificKeys=} [properties] Properties to set + */ + function SpecificKeys(properties) { + this.keyIds = []; + 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]]; + } + + /** + * SpecificKeys keyIds. + * @member {Array.} keyIds + * @memberof org.dash.platform.dapi.v0.SpecificKeys + * @instance + */ + SpecificKeys.prototype.keyIds = $util.emptyArray; + + /** + * Creates a new SpecificKeys instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.SpecificKeys + * @static + * @param {org.dash.platform.dapi.v0.ISpecificKeys=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.SpecificKeys} SpecificKeys instance + */ + SpecificKeys.create = function create(properties) { + return new SpecificKeys(properties); + }; + + /** + * Encodes the specified SpecificKeys message. Does not implicitly {@link org.dash.platform.dapi.v0.SpecificKeys.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.SpecificKeys + * @static + * @param {org.dash.platform.dapi.v0.ISpecificKeys} message SpecificKeys message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpecificKeys.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.keyIds != null && message.keyIds.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.keyIds.length; ++i) + writer.uint32(message.keyIds[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified SpecificKeys message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.SpecificKeys.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.SpecificKeys + * @static + * @param {org.dash.platform.dapi.v0.ISpecificKeys} message SpecificKeys message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpecificKeys.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SpecificKeys message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.SpecificKeys + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.SpecificKeys} SpecificKeys + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpecificKeys.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.org.dash.platform.dapi.v0.SpecificKeys(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.keyIds && message.keyIds.length)) + message.keyIds = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.keyIds.push(reader.uint32()); + } else + message.keyIds.push(reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SpecificKeys message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.SpecificKeys + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.SpecificKeys} SpecificKeys + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpecificKeys.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SpecificKeys message. + * @function verify + * @memberof org.dash.platform.dapi.v0.SpecificKeys + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SpecificKeys.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.keyIds != null && message.hasOwnProperty("keyIds")) { + if (!Array.isArray(message.keyIds)) + return "keyIds: array expected"; + for (var i = 0; i < message.keyIds.length; ++i) + if (!$util.isInteger(message.keyIds[i])) + return "keyIds: integer[] expected"; + } + return null; + }; + + /** + * Creates a SpecificKeys message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.SpecificKeys + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.SpecificKeys} SpecificKeys + */ + SpecificKeys.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.SpecificKeys) + return object; + var message = new $root.org.dash.platform.dapi.v0.SpecificKeys(); + if (object.keyIds) { + if (!Array.isArray(object.keyIds)) + throw TypeError(".org.dash.platform.dapi.v0.SpecificKeys.keyIds: array expected"); + message.keyIds = []; + for (var i = 0; i < object.keyIds.length; ++i) + message.keyIds[i] = object.keyIds[i] >>> 0; + } + return message; + }; + + /** + * Creates a plain object from a SpecificKeys message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.SpecificKeys + * @static + * @param {org.dash.platform.dapi.v0.SpecificKeys} message SpecificKeys + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SpecificKeys.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.keyIds = []; + if (message.keyIds && message.keyIds.length) { + object.keyIds = []; + for (var j = 0; j < message.keyIds.length; ++j) + object.keyIds[j] = message.keyIds[j]; + } + return object; + }; + + /** + * Converts this SpecificKeys to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.SpecificKeys + * @instance + * @returns {Object.} JSON object + */ + SpecificKeys.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SpecificKeys; + })(); + + v0.SearchKey = (function() { + + /** + * Properties of a SearchKey. + * @memberof org.dash.platform.dapi.v0 + * @interface ISearchKey + * @property {Object.|null} [purposeMap] SearchKey purposeMap + */ + + /** + * Constructs a new SearchKey. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a SearchKey. + * @implements ISearchKey + * @constructor + * @param {org.dash.platform.dapi.v0.ISearchKey=} [properties] Properties to set + */ + function SearchKey(properties) { + this.purposeMap = {}; + 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]]; + } + + /** + * SearchKey purposeMap. + * @member {Object.} purposeMap + * @memberof org.dash.platform.dapi.v0.SearchKey + * @instance + */ + SearchKey.prototype.purposeMap = $util.emptyObject; + + /** + * Creates a new SearchKey instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.SearchKey + * @static + * @param {org.dash.platform.dapi.v0.ISearchKey=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.SearchKey} SearchKey instance + */ + SearchKey.create = function create(properties) { + return new SearchKey(properties); + }; + + /** + * Encodes the specified SearchKey message. Does not implicitly {@link org.dash.platform.dapi.v0.SearchKey.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.SearchKey + * @static + * @param {org.dash.platform.dapi.v0.ISearchKey} message SearchKey message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchKey.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.purposeMap != null && Object.hasOwnProperty.call(message, "purposeMap")) + for (var keys = Object.keys(message.purposeMap), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 0 =*/8).uint32(keys[i]); + $root.org.dash.platform.dapi.v0.SecurityLevelMap.encode(message.purposeMap[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + return writer; + }; + + /** + * Encodes the specified SearchKey message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.SearchKey.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.SearchKey + * @static + * @param {org.dash.platform.dapi.v0.ISearchKey} message SearchKey message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchKey.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SearchKey message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.SearchKey + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.SearchKey} SearchKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchKey.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.org.dash.platform.dapi.v0.SearchKey(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (message.purposeMap === $util.emptyObject) + message.purposeMap = {}; + var end2 = reader.uint32() + reader.pos; + key = 0; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.uint32(); + break; + case 2: + value = $root.org.dash.platform.dapi.v0.SecurityLevelMap.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.purposeMap[key] = value; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SearchKey message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.SearchKey + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.SearchKey} SearchKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchKey.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SearchKey message. + * @function verify + * @memberof org.dash.platform.dapi.v0.SearchKey + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SearchKey.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.purposeMap != null && message.hasOwnProperty("purposeMap")) { + if (!$util.isObject(message.purposeMap)) + return "purposeMap: object expected"; + var key = Object.keys(message.purposeMap); + for (var i = 0; i < key.length; ++i) { + if (!$util.key32Re.test(key[i])) + return "purposeMap: integer key{k:uint32} expected"; + { + var error = $root.org.dash.platform.dapi.v0.SecurityLevelMap.verify(message.purposeMap[key[i]]); + if (error) + return "purposeMap." + error; + } + } + } + return null; + }; + + /** + * Creates a SearchKey message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.SearchKey + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.SearchKey} SearchKey + */ + SearchKey.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.SearchKey) + return object; + var message = new $root.org.dash.platform.dapi.v0.SearchKey(); + if (object.purposeMap) { + if (typeof object.purposeMap !== "object") + throw TypeError(".org.dash.platform.dapi.v0.SearchKey.purposeMap: object expected"); + message.purposeMap = {}; + for (var keys = Object.keys(object.purposeMap), i = 0; i < keys.length; ++i) { + if (typeof object.purposeMap[keys[i]] !== "object") + throw TypeError(".org.dash.platform.dapi.v0.SearchKey.purposeMap: object expected"); + message.purposeMap[keys[i]] = $root.org.dash.platform.dapi.v0.SecurityLevelMap.fromObject(object.purposeMap[keys[i]]); + } + } + return message; + }; + + /** + * Creates a plain object from a SearchKey message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.SearchKey + * @static + * @param {org.dash.platform.dapi.v0.SearchKey} message SearchKey + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SearchKey.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.purposeMap = {}; + var keys2; + if (message.purposeMap && (keys2 = Object.keys(message.purposeMap)).length) { + object.purposeMap = {}; + for (var j = 0; j < keys2.length; ++j) + object.purposeMap[keys2[j]] = $root.org.dash.platform.dapi.v0.SecurityLevelMap.toObject(message.purposeMap[keys2[j]], options); + } + return object; + }; + + /** + * Converts this SearchKey to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.SearchKey + * @instance + * @returns {Object.} JSON object + */ + SearchKey.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SearchKey; + })(); + + v0.SecurityLevelMap = (function() { + + /** + * Properties of a SecurityLevelMap. + * @memberof org.dash.platform.dapi.v0 + * @interface ISecurityLevelMap + * @property {Object.|null} [securityLevelMap] SecurityLevelMap securityLevelMap + */ + + /** + * Constructs a new SecurityLevelMap. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a SecurityLevelMap. + * @implements ISecurityLevelMap + * @constructor + * @param {org.dash.platform.dapi.v0.ISecurityLevelMap=} [properties] Properties to set + */ + function SecurityLevelMap(properties) { + this.securityLevelMap = {}; + 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]]; + } + + /** + * SecurityLevelMap securityLevelMap. + * @member {Object.} securityLevelMap + * @memberof org.dash.platform.dapi.v0.SecurityLevelMap + * @instance + */ + SecurityLevelMap.prototype.securityLevelMap = $util.emptyObject; + + /** + * Creates a new SecurityLevelMap instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.SecurityLevelMap + * @static + * @param {org.dash.platform.dapi.v0.ISecurityLevelMap=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.SecurityLevelMap} SecurityLevelMap instance + */ + SecurityLevelMap.create = function create(properties) { + return new SecurityLevelMap(properties); + }; + + /** + * Encodes the specified SecurityLevelMap message. Does not implicitly {@link org.dash.platform.dapi.v0.SecurityLevelMap.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.SecurityLevelMap + * @static + * @param {org.dash.platform.dapi.v0.ISecurityLevelMap} message SecurityLevelMap message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SecurityLevelMap.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.securityLevelMap != null && Object.hasOwnProperty.call(message, "securityLevelMap")) + for (var keys = Object.keys(message.securityLevelMap), i = 0; i < keys.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 0 =*/8).uint32(keys[i]).uint32(/* id 2, wireType 0 =*/16).int32(message.securityLevelMap[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified SecurityLevelMap message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.SecurityLevelMap.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.SecurityLevelMap + * @static + * @param {org.dash.platform.dapi.v0.ISecurityLevelMap} message SecurityLevelMap message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SecurityLevelMap.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SecurityLevelMap message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.SecurityLevelMap + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.SecurityLevelMap} SecurityLevelMap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SecurityLevelMap.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.org.dash.platform.dapi.v0.SecurityLevelMap(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (message.securityLevelMap === $util.emptyObject) + message.securityLevelMap = {}; + var end2 = reader.uint32() + reader.pos; + key = 0; + value = 0; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.uint32(); + break; + case 2: + value = reader.int32(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.securityLevelMap[key] = value; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SecurityLevelMap message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.SecurityLevelMap + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.SecurityLevelMap} SecurityLevelMap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SecurityLevelMap.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SecurityLevelMap message. + * @function verify + * @memberof org.dash.platform.dapi.v0.SecurityLevelMap + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SecurityLevelMap.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.securityLevelMap != null && message.hasOwnProperty("securityLevelMap")) { + if (!$util.isObject(message.securityLevelMap)) + return "securityLevelMap: object expected"; + var key = Object.keys(message.securityLevelMap); + for (var i = 0; i < key.length; ++i) { + if (!$util.key32Re.test(key[i])) + return "securityLevelMap: integer key{k:uint32} expected"; + switch (message.securityLevelMap[key[i]]) { + default: + return "securityLevelMap: enum value{k:uint32} expected"; + case 0: + case 1: + break; + } + } + } + return null; + }; + + /** + * Creates a SecurityLevelMap message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.SecurityLevelMap + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.SecurityLevelMap} SecurityLevelMap + */ + SecurityLevelMap.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.SecurityLevelMap) + return object; + var message = new $root.org.dash.platform.dapi.v0.SecurityLevelMap(); + if (object.securityLevelMap) { + if (typeof object.securityLevelMap !== "object") + throw TypeError(".org.dash.platform.dapi.v0.SecurityLevelMap.securityLevelMap: object expected"); + message.securityLevelMap = {}; + for (var keys = Object.keys(object.securityLevelMap), i = 0; i < keys.length; ++i) + switch (object.securityLevelMap[keys[i]]) { + case "CURRENT_KEY_OF_KIND_REQUEST": + case 0: + message.securityLevelMap[keys[i]] = 0; + break; + case "ALL_KEYS_OF_KIND_REQUEST": + case 1: + message.securityLevelMap[keys[i]] = 1; + break; + } + } + return message; + }; + + /** + * Creates a plain object from a SecurityLevelMap message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.SecurityLevelMap + * @static + * @param {org.dash.platform.dapi.v0.SecurityLevelMap} message SecurityLevelMap + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SecurityLevelMap.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.securityLevelMap = {}; + var keys2; + if (message.securityLevelMap && (keys2 = Object.keys(message.securityLevelMap)).length) { + object.securityLevelMap = {}; + for (var j = 0; j < keys2.length; ++j) + object.securityLevelMap[keys2[j]] = options.enums === String ? $root.org.dash.platform.dapi.v0.SecurityLevelMap.KeyKindRequestType[message.securityLevelMap[keys2[j]]] : message.securityLevelMap[keys2[j]]; + } + return object; + }; + + /** + * Converts this SecurityLevelMap to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.SecurityLevelMap + * @instance + * @returns {Object.} JSON object + */ + SecurityLevelMap.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * KeyKindRequestType enum. + * @name org.dash.platform.dapi.v0.SecurityLevelMap.KeyKindRequestType + * @enum {number} + * @property {number} CURRENT_KEY_OF_KIND_REQUEST=0 CURRENT_KEY_OF_KIND_REQUEST value + * @property {number} ALL_KEYS_OF_KIND_REQUEST=1 ALL_KEYS_OF_KIND_REQUEST value + */ + SecurityLevelMap.KeyKindRequestType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CURRENT_KEY_OF_KIND_REQUEST"] = 0; + values[valuesById[1] = "ALL_KEYS_OF_KIND_REQUEST"] = 1; + return values; + })(); + + return SecurityLevelMap; + })(); + + v0.GetIdentityKeysRequest = (function() { + + /** + * Properties of a GetIdentityKeysRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetIdentityKeysRequest + * @property {org.dash.platform.dapi.v0.GetIdentityKeysRequest.IGetIdentityKeysRequestV0|null} [v0] GetIdentityKeysRequest v0 + */ + + /** + * Constructs a new GetIdentityKeysRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetIdentityKeysRequest. + * @implements IGetIdentityKeysRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IGetIdentityKeysRequest=} [properties] Properties to set + */ + function GetIdentityKeysRequest(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]]; + } + + /** + * GetIdentityKeysRequest v0. + * @member {org.dash.platform.dapi.v0.GetIdentityKeysRequest.IGetIdentityKeysRequestV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest + * @instance + */ + GetIdentityKeysRequest.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetIdentityKeysRequest version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest + * @instance + */ + Object.defineProperty(GetIdentityKeysRequest.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetIdentityKeysRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityKeysRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentityKeysRequest} GetIdentityKeysRequest instance + */ + GetIdentityKeysRequest.create = function create(properties) { + return new GetIdentityKeysRequest(properties); + }; + + /** + * Encodes the specified GetIdentityKeysRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityKeysRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityKeysRequest} message GetIdentityKeysRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityKeysRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetIdentityKeysRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityKeysRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityKeysRequest} message GetIdentityKeysRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityKeysRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentityKeysRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentityKeysRequest} GetIdentityKeysRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityKeysRequest.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.org.dash.platform.dapi.v0.GetIdentityKeysRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentityKeysRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentityKeysRequest} GetIdentityKeysRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityKeysRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentityKeysRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentityKeysRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetIdentityKeysRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentityKeysRequest} GetIdentityKeysRequest + */ + GetIdentityKeysRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityKeysRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentityKeysRequest(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityKeysRequest.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetIdentityKeysRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityKeysRequest} message GetIdentityKeysRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentityKeysRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetIdentityKeysRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest + * @instance + * @returns {Object.} JSON object + */ + GetIdentityKeysRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetIdentityKeysRequest.GetIdentityKeysRequestV0 = (function() { + + /** + * Properties of a GetIdentityKeysRequestV0. + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest + * @interface IGetIdentityKeysRequestV0 + * @property {Uint8Array|null} [identityId] GetIdentityKeysRequestV0 identityId + * @property {org.dash.platform.dapi.v0.IKeyRequestType|null} [requestType] GetIdentityKeysRequestV0 requestType + * @property {google.protobuf.IUInt32Value|null} [limit] GetIdentityKeysRequestV0 limit + * @property {google.protobuf.IUInt32Value|null} [offset] GetIdentityKeysRequestV0 offset + * @property {boolean|null} [prove] GetIdentityKeysRequestV0 prove + */ + + /** + * Constructs a new GetIdentityKeysRequestV0. + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest + * @classdesc Represents a GetIdentityKeysRequestV0. + * @implements IGetIdentityKeysRequestV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetIdentityKeysRequest.IGetIdentityKeysRequestV0=} [properties] Properties to set + */ + function GetIdentityKeysRequestV0(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]]; + } + + /** + * GetIdentityKeysRequestV0 identityId. + * @member {Uint8Array} identityId + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0 + * @instance + */ + GetIdentityKeysRequestV0.prototype.identityId = $util.newBuffer([]); + + /** + * GetIdentityKeysRequestV0 requestType. + * @member {org.dash.platform.dapi.v0.IKeyRequestType|null|undefined} requestType + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0 + * @instance + */ + GetIdentityKeysRequestV0.prototype.requestType = null; + + /** + * GetIdentityKeysRequestV0 limit. + * @member {google.protobuf.IUInt32Value|null|undefined} limit + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0 + * @instance + */ + GetIdentityKeysRequestV0.prototype.limit = null; + + /** + * GetIdentityKeysRequestV0 offset. + * @member {google.protobuf.IUInt32Value|null|undefined} offset + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0 + * @instance + */ + GetIdentityKeysRequestV0.prototype.offset = null; + + /** + * GetIdentityKeysRequestV0 prove. + * @member {boolean} prove + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0 + * @instance + */ + GetIdentityKeysRequestV0.prototype.prove = false; + + /** + * Creates a new GetIdentityKeysRequestV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityKeysRequest.IGetIdentityKeysRequestV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0} GetIdentityKeysRequestV0 instance + */ + GetIdentityKeysRequestV0.create = function create(properties) { + return new GetIdentityKeysRequestV0(properties); + }; + + /** + * Encodes the specified GetIdentityKeysRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityKeysRequest.IGetIdentityKeysRequestV0} message GetIdentityKeysRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityKeysRequestV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.identityId != null && Object.hasOwnProperty.call(message, "identityId")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.identityId); + if (message.requestType != null && Object.hasOwnProperty.call(message, "requestType")) + $root.org.dash.platform.dapi.v0.KeyRequestType.encode(message.requestType, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.limit != null && Object.hasOwnProperty.call(message, "limit")) + $root.google.protobuf.UInt32Value.encode(message.limit, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.offset != null && Object.hasOwnProperty.call(message, "offset")) + $root.google.protobuf.UInt32Value.encode(message.offset, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.prove); + return writer; + }; + + /** + * Encodes the specified GetIdentityKeysRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityKeysRequest.IGetIdentityKeysRequestV0} message GetIdentityKeysRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityKeysRequestV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentityKeysRequestV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0} GetIdentityKeysRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityKeysRequestV0.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.org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.identityId = reader.bytes(); + break; + case 2: + message.requestType = $root.org.dash.platform.dapi.v0.KeyRequestType.decode(reader, reader.uint32()); + break; + case 3: + message.limit = $root.google.protobuf.UInt32Value.decode(reader, reader.uint32()); + break; + case 4: + message.offset = $root.google.protobuf.UInt32Value.decode(reader, reader.uint32()); + break; + case 5: + message.prove = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentityKeysRequestV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0} GetIdentityKeysRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityKeysRequestV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentityKeysRequestV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentityKeysRequestV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.identityId != null && message.hasOwnProperty("identityId")) + if (!(message.identityId && typeof message.identityId.length === "number" || $util.isString(message.identityId))) + return "identityId: buffer expected"; + if (message.requestType != null && message.hasOwnProperty("requestType")) { + var error = $root.org.dash.platform.dapi.v0.KeyRequestType.verify(message.requestType); + if (error) + return "requestType." + error; + } + if (message.limit != null && message.hasOwnProperty("limit")) { + var error = $root.google.protobuf.UInt32Value.verify(message.limit); + if (error) + return "limit." + error; + } + if (message.offset != null && message.hasOwnProperty("offset")) { + var error = $root.google.protobuf.UInt32Value.verify(message.offset); + if (error) + return "offset." + error; + } + if (message.prove != null && message.hasOwnProperty("prove")) + if (typeof message.prove !== "boolean") + return "prove: boolean expected"; + return null; + }; + + /** + * Creates a GetIdentityKeysRequestV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0} GetIdentityKeysRequestV0 + */ + GetIdentityKeysRequestV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0(); + if (object.identityId != null) + if (typeof object.identityId === "string") + $util.base64.decode(object.identityId, message.identityId = $util.newBuffer($util.base64.length(object.identityId)), 0); + else if (object.identityId.length >= 0) + message.identityId = object.identityId; + if (object.requestType != null) { + if (typeof object.requestType !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0.requestType: object expected"); + message.requestType = $root.org.dash.platform.dapi.v0.KeyRequestType.fromObject(object.requestType); + } + if (object.limit != null) { + if (typeof object.limit !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0.limit: object expected"); + message.limit = $root.google.protobuf.UInt32Value.fromObject(object.limit); + } + if (object.offset != null) { + if (typeof object.offset !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0.offset: object expected"); + message.offset = $root.google.protobuf.UInt32Value.fromObject(object.offset); + } + if (object.prove != null) + message.prove = Boolean(object.prove); + return message; + }; + + /** + * Creates a plain object from a GetIdentityKeysRequestV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0} message GetIdentityKeysRequestV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentityKeysRequestV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.identityId = ""; + else { + object.identityId = []; + if (options.bytes !== Array) + object.identityId = $util.newBuffer(object.identityId); + } + object.requestType = null; + object.limit = null; + object.offset = null; + object.prove = false; + } + if (message.identityId != null && message.hasOwnProperty("identityId")) + object.identityId = options.bytes === String ? $util.base64.encode(message.identityId, 0, message.identityId.length) : options.bytes === Array ? Array.prototype.slice.call(message.identityId) : message.identityId; + if (message.requestType != null && message.hasOwnProperty("requestType")) + object.requestType = $root.org.dash.platform.dapi.v0.KeyRequestType.toObject(message.requestType, options); + if (message.limit != null && message.hasOwnProperty("limit")) + object.limit = $root.google.protobuf.UInt32Value.toObject(message.limit, options); + if (message.offset != null && message.hasOwnProperty("offset")) + object.offset = $root.google.protobuf.UInt32Value.toObject(message.offset, options); + if (message.prove != null && message.hasOwnProperty("prove")) + object.prove = message.prove; + return object; + }; + + /** + * Converts this GetIdentityKeysRequestV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0 + * @instance + * @returns {Object.} JSON object + */ + GetIdentityKeysRequestV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetIdentityKeysRequestV0; + })(); + + return GetIdentityKeysRequest; + })(); + + v0.GetIdentityKeysResponse = (function() { + + /** + * Properties of a GetIdentityKeysResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetIdentityKeysResponse + * @property {org.dash.platform.dapi.v0.GetIdentityKeysResponse.IGetIdentityKeysResponseV0|null} [v0] GetIdentityKeysResponse v0 + */ + + /** + * Constructs a new GetIdentityKeysResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetIdentityKeysResponse. + * @implements IGetIdentityKeysResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IGetIdentityKeysResponse=} [properties] Properties to set + */ + function GetIdentityKeysResponse(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]]; + } + + /** + * GetIdentityKeysResponse v0. + * @member {org.dash.platform.dapi.v0.GetIdentityKeysResponse.IGetIdentityKeysResponseV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse + * @instance + */ + GetIdentityKeysResponse.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetIdentityKeysResponse version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse + * @instance + */ + Object.defineProperty(GetIdentityKeysResponse.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetIdentityKeysResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityKeysResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentityKeysResponse} GetIdentityKeysResponse instance + */ + GetIdentityKeysResponse.create = function create(properties) { + return new GetIdentityKeysResponse(properties); + }; + + /** + * Encodes the specified GetIdentityKeysResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityKeysResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityKeysResponse} message GetIdentityKeysResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityKeysResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetIdentityKeysResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityKeysResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityKeysResponse} message GetIdentityKeysResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityKeysResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentityKeysResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentityKeysResponse} GetIdentityKeysResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityKeysResponse.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.org.dash.platform.dapi.v0.GetIdentityKeysResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentityKeysResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentityKeysResponse} GetIdentityKeysResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityKeysResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentityKeysResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentityKeysResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetIdentityKeysResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentityKeysResponse} GetIdentityKeysResponse + */ + GetIdentityKeysResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityKeysResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentityKeysResponse(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityKeysResponse.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetIdentityKeysResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityKeysResponse} message GetIdentityKeysResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentityKeysResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetIdentityKeysResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse + * @instance + * @returns {Object.} JSON object + */ + GetIdentityKeysResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetIdentityKeysResponse.GetIdentityKeysResponseV0 = (function() { + + /** + * Properties of a GetIdentityKeysResponseV0. + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse + * @interface IGetIdentityKeysResponseV0 + * @property {org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.IKeys|null} [keys] GetIdentityKeysResponseV0 keys + * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetIdentityKeysResponseV0 proof + * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetIdentityKeysResponseV0 metadata + */ + + /** + * Constructs a new GetIdentityKeysResponseV0. + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse + * @classdesc Represents a GetIdentityKeysResponseV0. + * @implements IGetIdentityKeysResponseV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetIdentityKeysResponse.IGetIdentityKeysResponseV0=} [properties] Properties to set + */ + function GetIdentityKeysResponseV0(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]]; + } + + /** + * GetIdentityKeysResponseV0 keys. + * @member {org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.IKeys|null|undefined} keys + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0 + * @instance + */ + GetIdentityKeysResponseV0.prototype.keys = null; + + /** + * GetIdentityKeysResponseV0 proof. + * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0 + * @instance + */ + GetIdentityKeysResponseV0.prototype.proof = null; + + /** + * GetIdentityKeysResponseV0 metadata. + * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0 + * @instance + */ + GetIdentityKeysResponseV0.prototype.metadata = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetIdentityKeysResponseV0 result. + * @member {"keys"|"proof"|undefined} result + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0 + * @instance + */ + Object.defineProperty(GetIdentityKeysResponseV0.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["keys", "proof"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetIdentityKeysResponseV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityKeysResponse.IGetIdentityKeysResponseV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0} GetIdentityKeysResponseV0 instance + */ + GetIdentityKeysResponseV0.create = function create(properties) { + return new GetIdentityKeysResponseV0(properties); + }; + + /** + * Encodes the specified GetIdentityKeysResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityKeysResponse.IGetIdentityKeysResponseV0} message GetIdentityKeysResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityKeysResponseV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.keys != null && Object.hasOwnProperty.call(message, "keys")) + $root.org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.Keys.encode(message.keys, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetIdentityKeysResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityKeysResponse.IGetIdentityKeysResponseV0} message GetIdentityKeysResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityKeysResponseV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentityKeysResponseV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0} GetIdentityKeysResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityKeysResponseV0.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.org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.keys = $root.org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.Keys.decode(reader, reader.uint32()); + break; + case 2: + message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); + break; + case 3: + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentityKeysResponseV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0} GetIdentityKeysResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityKeysResponseV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentityKeysResponseV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentityKeysResponseV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.keys != null && message.hasOwnProperty("keys")) { + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.Keys.verify(message.keys); + if (error) + return "keys." + error; + } + } + if (message.proof != null && message.hasOwnProperty("proof")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); + if (error) + return "proof." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a GetIdentityKeysResponseV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0} GetIdentityKeysResponseV0 + */ + GetIdentityKeysResponseV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0(); + if (object.keys != null) { + if (typeof object.keys !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.keys: object expected"); + message.keys = $root.org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.Keys.fromObject(object.keys); + } + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.proof: object expected"); + message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.metadata: object expected"); + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a GetIdentityKeysResponseV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0} message GetIdentityKeysResponseV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentityKeysResponseV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.metadata = null; + if (message.keys != null && message.hasOwnProperty("keys")) { + object.keys = $root.org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.Keys.toObject(message.keys, options); + if (options.oneofs) + object.result = "keys"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); + if (options.oneofs) + object.result = "proof"; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this GetIdentityKeysResponseV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0 + * @instance + * @returns {Object.} JSON object + */ + GetIdentityKeysResponseV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetIdentityKeysResponseV0.Keys = (function() { + + /** + * Properties of a Keys. + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0 + * @interface IKeys + * @property {Array.|null} [keysBytes] Keys keysBytes + */ + + /** + * Constructs a new Keys. + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0 + * @classdesc Represents a Keys. + * @implements IKeys + * @constructor + * @param {org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.IKeys=} [properties] Properties to set + */ + function Keys(properties) { + this.keysBytes = []; + 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]]; + } + + /** + * Keys keysBytes. + * @member {Array.} keysBytes + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.Keys + * @instance + */ + Keys.prototype.keysBytes = $util.emptyArray; + + /** + * Creates a new Keys instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.Keys + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.IKeys=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.Keys} Keys instance + */ + Keys.create = function create(properties) { + return new Keys(properties); + }; + + /** + * Encodes the specified Keys message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.Keys.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.Keys + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.IKeys} message Keys message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Keys.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.keysBytes != null && message.keysBytes.length) + for (var i = 0; i < message.keysBytes.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.keysBytes[i]); + return writer; + }; + + /** + * Encodes the specified Keys message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.Keys.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.Keys + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.IKeys} message Keys message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Keys.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Keys message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.Keys + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.Keys} Keys + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Keys.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.org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.Keys(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.keysBytes && message.keysBytes.length)) + message.keysBytes = []; + message.keysBytes.push(reader.bytes()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Keys message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.Keys + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.Keys} Keys + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Keys.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Keys message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.Keys + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Keys.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.keysBytes != null && message.hasOwnProperty("keysBytes")) { + if (!Array.isArray(message.keysBytes)) + return "keysBytes: array expected"; + for (var i = 0; i < message.keysBytes.length; ++i) + if (!(message.keysBytes[i] && typeof message.keysBytes[i].length === "number" || $util.isString(message.keysBytes[i]))) + return "keysBytes: buffer[] expected"; + } + return null; + }; + + /** + * Creates a Keys message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.Keys + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.Keys} Keys + */ + Keys.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.Keys) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.Keys(); + if (object.keysBytes) { + if (!Array.isArray(object.keysBytes)) + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.Keys.keysBytes: array expected"); + message.keysBytes = []; + for (var i = 0; i < object.keysBytes.length; ++i) + if (typeof object.keysBytes[i] === "string") + $util.base64.decode(object.keysBytes[i], message.keysBytes[i] = $util.newBuffer($util.base64.length(object.keysBytes[i])), 0); + else if (object.keysBytes[i].length >= 0) + message.keysBytes[i] = object.keysBytes[i]; + } + return message; + }; + + /** + * Creates a plain object from a Keys message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.Keys + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.Keys} message Keys + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Keys.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.keysBytes = []; + if (message.keysBytes && message.keysBytes.length) { + object.keysBytes = []; + for (var j = 0; j < message.keysBytes.length; ++j) + object.keysBytes[j] = options.bytes === String ? $util.base64.encode(message.keysBytes[j], 0, message.keysBytes[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.keysBytes[j]) : message.keysBytes[j]; + } + return object; + }; + + /** + * Converts this Keys to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.Keys + * @instance + * @returns {Object.} JSON object + */ + Keys.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Keys; + })(); + + return GetIdentityKeysResponseV0; + })(); + + return GetIdentityKeysResponse; + })(); + + v0.GetIdentitiesContractKeysRequest = (function() { + + /** + * Properties of a GetIdentitiesContractKeysRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetIdentitiesContractKeysRequest + * @property {org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.IGetIdentitiesContractKeysRequestV0|null} [v0] GetIdentitiesContractKeysRequest v0 + */ + + /** + * Constructs a new GetIdentitiesContractKeysRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetIdentitiesContractKeysRequest. + * @implements IGetIdentitiesContractKeysRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IGetIdentitiesContractKeysRequest=} [properties] Properties to set + */ + function GetIdentitiesContractKeysRequest(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]]; + } + + /** + * GetIdentitiesContractKeysRequest v0. + * @member {org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.IGetIdentitiesContractKeysRequestV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest + * @instance + */ + GetIdentitiesContractKeysRequest.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetIdentitiesContractKeysRequest version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest + * @instance + */ + Object.defineProperty(GetIdentitiesContractKeysRequest.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetIdentitiesContractKeysRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentitiesContractKeysRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest} GetIdentitiesContractKeysRequest instance + */ + GetIdentitiesContractKeysRequest.create = function create(properties) { + return new GetIdentitiesContractKeysRequest(properties); + }; + + /** + * Encodes the specified GetIdentitiesContractKeysRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentitiesContractKeysRequest} message GetIdentitiesContractKeysRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentitiesContractKeysRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetIdentitiesContractKeysRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentitiesContractKeysRequest} message GetIdentitiesContractKeysRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentitiesContractKeysRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentitiesContractKeysRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest} GetIdentitiesContractKeysRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentitiesContractKeysRequest.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.org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentitiesContractKeysRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest} GetIdentitiesContractKeysRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentitiesContractKeysRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentitiesContractKeysRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentitiesContractKeysRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetIdentitiesContractKeysRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest} GetIdentitiesContractKeysRequest + */ + GetIdentitiesContractKeysRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetIdentitiesContractKeysRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest} message GetIdentitiesContractKeysRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentitiesContractKeysRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetIdentitiesContractKeysRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest + * @instance + * @returns {Object.} JSON object + */ + GetIdentitiesContractKeysRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0 = (function() { + + /** + * Properties of a GetIdentitiesContractKeysRequestV0. + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest + * @interface IGetIdentitiesContractKeysRequestV0 + * @property {Array.|null} [identitiesIds] GetIdentitiesContractKeysRequestV0 identitiesIds + * @property {Uint8Array|null} [contractId] GetIdentitiesContractKeysRequestV0 contractId + * @property {string|null} [documentTypeName] GetIdentitiesContractKeysRequestV0 documentTypeName + * @property {Array.|null} [purposes] GetIdentitiesContractKeysRequestV0 purposes + * @property {boolean|null} [prove] GetIdentitiesContractKeysRequestV0 prove + */ + + /** + * Constructs a new GetIdentitiesContractKeysRequestV0. + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest + * @classdesc Represents a GetIdentitiesContractKeysRequestV0. + * @implements IGetIdentitiesContractKeysRequestV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.IGetIdentitiesContractKeysRequestV0=} [properties] Properties to set + */ + function GetIdentitiesContractKeysRequestV0(properties) { + this.identitiesIds = []; + this.purposes = []; + 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]]; + } + + /** + * GetIdentitiesContractKeysRequestV0 identitiesIds. + * @member {Array.} identitiesIds + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0 + * @instance + */ + GetIdentitiesContractKeysRequestV0.prototype.identitiesIds = $util.emptyArray; + + /** + * GetIdentitiesContractKeysRequestV0 contractId. + * @member {Uint8Array} contractId + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0 + * @instance + */ + GetIdentitiesContractKeysRequestV0.prototype.contractId = $util.newBuffer([]); + + /** + * GetIdentitiesContractKeysRequestV0 documentTypeName. + * @member {string} documentTypeName + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0 + * @instance + */ + GetIdentitiesContractKeysRequestV0.prototype.documentTypeName = ""; + + /** + * GetIdentitiesContractKeysRequestV0 purposes. + * @member {Array.} purposes + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0 + * @instance + */ + GetIdentitiesContractKeysRequestV0.prototype.purposes = $util.emptyArray; + + /** + * GetIdentitiesContractKeysRequestV0 prove. + * @member {boolean} prove + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0 + * @instance + */ + GetIdentitiesContractKeysRequestV0.prototype.prove = false; + + /** + * Creates a new GetIdentitiesContractKeysRequestV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.IGetIdentitiesContractKeysRequestV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0} GetIdentitiesContractKeysRequestV0 instance + */ + GetIdentitiesContractKeysRequestV0.create = function create(properties) { + return new GetIdentitiesContractKeysRequestV0(properties); + }; + + /** + * Encodes the specified GetIdentitiesContractKeysRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.IGetIdentitiesContractKeysRequestV0} message GetIdentitiesContractKeysRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentitiesContractKeysRequestV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.identitiesIds != null && message.identitiesIds.length) + for (var i = 0; i < message.identitiesIds.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.identitiesIds[i]); + if (message.contractId != null && Object.hasOwnProperty.call(message, "contractId")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.contractId); + if (message.documentTypeName != null && Object.hasOwnProperty.call(message, "documentTypeName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.documentTypeName); + if (message.purposes != null && message.purposes.length) { + writer.uint32(/* id 4, wireType 2 =*/34).fork(); + for (var i = 0; i < message.purposes.length; ++i) + writer.int32(message.purposes[i]); + writer.ldelim(); + } + if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.prove); + return writer; + }; + + /** + * Encodes the specified GetIdentitiesContractKeysRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.IGetIdentitiesContractKeysRequestV0} message GetIdentitiesContractKeysRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentitiesContractKeysRequestV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentitiesContractKeysRequestV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0} GetIdentitiesContractKeysRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentitiesContractKeysRequestV0.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.org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.identitiesIds && message.identitiesIds.length)) + message.identitiesIds = []; + message.identitiesIds.push(reader.bytes()); + break; + case 2: + message.contractId = reader.bytes(); + break; + case 3: + message.documentTypeName = reader.string(); + break; + case 4: + if (!(message.purposes && message.purposes.length)) + message.purposes = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.purposes.push(reader.int32()); + } else + message.purposes.push(reader.int32()); + break; + case 5: + message.prove = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentitiesContractKeysRequestV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0} GetIdentitiesContractKeysRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentitiesContractKeysRequestV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentitiesContractKeysRequestV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentitiesContractKeysRequestV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.identitiesIds != null && message.hasOwnProperty("identitiesIds")) { + if (!Array.isArray(message.identitiesIds)) + return "identitiesIds: array expected"; + for (var i = 0; i < message.identitiesIds.length; ++i) + if (!(message.identitiesIds[i] && typeof message.identitiesIds[i].length === "number" || $util.isString(message.identitiesIds[i]))) + return "identitiesIds: buffer[] expected"; + } + if (message.contractId != null && message.hasOwnProperty("contractId")) + if (!(message.contractId && typeof message.contractId.length === "number" || $util.isString(message.contractId))) + return "contractId: buffer expected"; + if (message.documentTypeName != null && message.hasOwnProperty("documentTypeName")) + if (!$util.isString(message.documentTypeName)) + return "documentTypeName: string expected"; + if (message.purposes != null && message.hasOwnProperty("purposes")) { + if (!Array.isArray(message.purposes)) + return "purposes: array expected"; + for (var i = 0; i < message.purposes.length; ++i) + switch (message.purposes[i]) { + default: + return "purposes: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 5: + break; + } + } + if (message.prove != null && message.hasOwnProperty("prove")) + if (typeof message.prove !== "boolean") + return "prove: boolean expected"; + return null; + }; + + /** + * Creates a GetIdentitiesContractKeysRequestV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0} GetIdentitiesContractKeysRequestV0 + */ + GetIdentitiesContractKeysRequestV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0(); + if (object.identitiesIds) { + if (!Array.isArray(object.identitiesIds)) + throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0.identitiesIds: array expected"); + message.identitiesIds = []; + for (var i = 0; i < object.identitiesIds.length; ++i) + if (typeof object.identitiesIds[i] === "string") + $util.base64.decode(object.identitiesIds[i], message.identitiesIds[i] = $util.newBuffer($util.base64.length(object.identitiesIds[i])), 0); + else if (object.identitiesIds[i].length >= 0) + message.identitiesIds[i] = object.identitiesIds[i]; + } + if (object.contractId != null) + if (typeof object.contractId === "string") + $util.base64.decode(object.contractId, message.contractId = $util.newBuffer($util.base64.length(object.contractId)), 0); + else if (object.contractId.length >= 0) + message.contractId = object.contractId; + if (object.documentTypeName != null) + message.documentTypeName = String(object.documentTypeName); + if (object.purposes) { + if (!Array.isArray(object.purposes)) + throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0.purposes: array expected"); + message.purposes = []; + for (var i = 0; i < object.purposes.length; ++i) + switch (object.purposes[i]) { + default: + case "AUTHENTICATION": + case 0: + message.purposes[i] = 0; + break; + case "ENCRYPTION": + case 1: + message.purposes[i] = 1; + break; + case "DECRYPTION": + case 2: + message.purposes[i] = 2; + break; + case "TRANSFER": + case 3: + message.purposes[i] = 3; + break; + case "VOTING": + case 5: + message.purposes[i] = 5; + break; + } + } + if (object.prove != null) + message.prove = Boolean(object.prove); + return message; + }; + + /** + * Creates a plain object from a GetIdentitiesContractKeysRequestV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0} message GetIdentitiesContractKeysRequestV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentitiesContractKeysRequestV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.identitiesIds = []; + object.purposes = []; + } + if (options.defaults) { + if (options.bytes === String) + object.contractId = ""; + else { + object.contractId = []; + if (options.bytes !== Array) + object.contractId = $util.newBuffer(object.contractId); + } + object.documentTypeName = ""; + object.prove = false; + } + if (message.identitiesIds && message.identitiesIds.length) { + object.identitiesIds = []; + for (var j = 0; j < message.identitiesIds.length; ++j) + object.identitiesIds[j] = options.bytes === String ? $util.base64.encode(message.identitiesIds[j], 0, message.identitiesIds[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.identitiesIds[j]) : message.identitiesIds[j]; + } + if (message.contractId != null && message.hasOwnProperty("contractId")) + object.contractId = options.bytes === String ? $util.base64.encode(message.contractId, 0, message.contractId.length) : options.bytes === Array ? Array.prototype.slice.call(message.contractId) : message.contractId; + if (message.documentTypeName != null && message.hasOwnProperty("documentTypeName")) + object.documentTypeName = message.documentTypeName; + if (message.purposes && message.purposes.length) { + object.purposes = []; + for (var j = 0; j < message.purposes.length; ++j) + object.purposes[j] = options.enums === String ? $root.org.dash.platform.dapi.v0.KeyPurpose[message.purposes[j]] : message.purposes[j]; + } + if (message.prove != null && message.hasOwnProperty("prove")) + object.prove = message.prove; + return object; + }; + + /** + * Converts this GetIdentitiesContractKeysRequestV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0 + * @instance + * @returns {Object.} JSON object + */ + GetIdentitiesContractKeysRequestV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetIdentitiesContractKeysRequestV0; + })(); + + return GetIdentitiesContractKeysRequest; + })(); + + v0.GetIdentitiesContractKeysResponse = (function() { + + /** + * Properties of a GetIdentitiesContractKeysResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetIdentitiesContractKeysResponse + * @property {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.IGetIdentitiesContractKeysResponseV0|null} [v0] GetIdentitiesContractKeysResponse v0 + */ + + /** + * Constructs a new GetIdentitiesContractKeysResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetIdentitiesContractKeysResponse. + * @implements IGetIdentitiesContractKeysResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IGetIdentitiesContractKeysResponse=} [properties] Properties to set + */ + function GetIdentitiesContractKeysResponse(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]]; + } + + /** + * GetIdentitiesContractKeysResponse v0. + * @member {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.IGetIdentitiesContractKeysResponseV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse + * @instance + */ + GetIdentitiesContractKeysResponse.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetIdentitiesContractKeysResponse version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse + * @instance + */ + Object.defineProperty(GetIdentitiesContractKeysResponse.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetIdentitiesContractKeysResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentitiesContractKeysResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse} GetIdentitiesContractKeysResponse instance + */ + GetIdentitiesContractKeysResponse.create = function create(properties) { + return new GetIdentitiesContractKeysResponse(properties); + }; + + /** + * Encodes the specified GetIdentitiesContractKeysResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentitiesContractKeysResponse} message GetIdentitiesContractKeysResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentitiesContractKeysResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetIdentitiesContractKeysResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentitiesContractKeysResponse} message GetIdentitiesContractKeysResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentitiesContractKeysResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentitiesContractKeysResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse} GetIdentitiesContractKeysResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentitiesContractKeysResponse.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.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentitiesContractKeysResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse} GetIdentitiesContractKeysResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentitiesContractKeysResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentitiesContractKeysResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentitiesContractKeysResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetIdentitiesContractKeysResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse} GetIdentitiesContractKeysResponse + */ + GetIdentitiesContractKeysResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetIdentitiesContractKeysResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse} message GetIdentitiesContractKeysResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentitiesContractKeysResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetIdentitiesContractKeysResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse + * @instance + * @returns {Object.} JSON object + */ + GetIdentitiesContractKeysResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0 = (function() { + + /** + * Properties of a GetIdentitiesContractKeysResponseV0. + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse + * @interface IGetIdentitiesContractKeysResponseV0 + * @property {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IIdentitiesKeys|null} [identitiesKeys] GetIdentitiesContractKeysResponseV0 identitiesKeys + * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetIdentitiesContractKeysResponseV0 proof + * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetIdentitiesContractKeysResponseV0 metadata + */ + + /** + * Constructs a new GetIdentitiesContractKeysResponseV0. + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse + * @classdesc Represents a GetIdentitiesContractKeysResponseV0. + * @implements IGetIdentitiesContractKeysResponseV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.IGetIdentitiesContractKeysResponseV0=} [properties] Properties to set + */ + function GetIdentitiesContractKeysResponseV0(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]]; + } + + /** + * GetIdentitiesContractKeysResponseV0 identitiesKeys. + * @member {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IIdentitiesKeys|null|undefined} identitiesKeys + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0 + * @instance + */ + GetIdentitiesContractKeysResponseV0.prototype.identitiesKeys = null; + + /** + * GetIdentitiesContractKeysResponseV0 proof. + * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0 + * @instance + */ + GetIdentitiesContractKeysResponseV0.prototype.proof = null; + + /** + * GetIdentitiesContractKeysResponseV0 metadata. + * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0 + * @instance + */ + GetIdentitiesContractKeysResponseV0.prototype.metadata = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetIdentitiesContractKeysResponseV0 result. + * @member {"identitiesKeys"|"proof"|undefined} result + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0 + * @instance + */ + Object.defineProperty(GetIdentitiesContractKeysResponseV0.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["identitiesKeys", "proof"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetIdentitiesContractKeysResponseV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.IGetIdentitiesContractKeysResponseV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0} GetIdentitiesContractKeysResponseV0 instance + */ + GetIdentitiesContractKeysResponseV0.create = function create(properties) { + return new GetIdentitiesContractKeysResponseV0(properties); + }; + + /** + * Encodes the specified GetIdentitiesContractKeysResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.IGetIdentitiesContractKeysResponseV0} message GetIdentitiesContractKeysResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentitiesContractKeysResponseV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.identitiesKeys != null && Object.hasOwnProperty.call(message, "identitiesKeys")) + $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys.encode(message.identitiesKeys, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetIdentitiesContractKeysResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.IGetIdentitiesContractKeysResponseV0} message GetIdentitiesContractKeysResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentitiesContractKeysResponseV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentitiesContractKeysResponseV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0} GetIdentitiesContractKeysResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentitiesContractKeysResponseV0.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.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.identitiesKeys = $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys.decode(reader, reader.uint32()); + break; + case 2: + message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); + break; + case 3: + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentitiesContractKeysResponseV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0} GetIdentitiesContractKeysResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentitiesContractKeysResponseV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentitiesContractKeysResponseV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentitiesContractKeysResponseV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.identitiesKeys != null && message.hasOwnProperty("identitiesKeys")) { + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys.verify(message.identitiesKeys); + if (error) + return "identitiesKeys." + error; + } + } + if (message.proof != null && message.hasOwnProperty("proof")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); + if (error) + return "proof." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a GetIdentitiesContractKeysResponseV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0} GetIdentitiesContractKeysResponseV0 + */ + GetIdentitiesContractKeysResponseV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0(); + if (object.identitiesKeys != null) { + if (typeof object.identitiesKeys !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.identitiesKeys: object expected"); + message.identitiesKeys = $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys.fromObject(object.identitiesKeys); + } + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.proof: object expected"); + message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.metadata: object expected"); + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a GetIdentitiesContractKeysResponseV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0} message GetIdentitiesContractKeysResponseV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentitiesContractKeysResponseV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.metadata = null; + if (message.identitiesKeys != null && message.hasOwnProperty("identitiesKeys")) { + object.identitiesKeys = $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys.toObject(message.identitiesKeys, options); + if (options.oneofs) + object.result = "identitiesKeys"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); + if (options.oneofs) + object.result = "proof"; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this GetIdentitiesContractKeysResponseV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0 + * @instance + * @returns {Object.} JSON object + */ + GetIdentitiesContractKeysResponseV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetIdentitiesContractKeysResponseV0.PurposeKeys = (function() { + + /** + * Properties of a PurposeKeys. + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0 + * @interface IPurposeKeys + * @property {org.dash.platform.dapi.v0.KeyPurpose|null} [purpose] PurposeKeys purpose + * @property {Array.|null} [keysBytes] PurposeKeys keysBytes + */ + + /** + * Constructs a new PurposeKeys. + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0 + * @classdesc Represents a PurposeKeys. + * @implements IPurposeKeys + * @constructor + * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IPurposeKeys=} [properties] Properties to set + */ + function PurposeKeys(properties) { + this.keysBytes = []; + 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]]; + } + + /** + * PurposeKeys purpose. + * @member {org.dash.platform.dapi.v0.KeyPurpose} purpose + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys + * @instance + */ + PurposeKeys.prototype.purpose = 0; + + /** + * PurposeKeys keysBytes. + * @member {Array.} keysBytes + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys + * @instance + */ + PurposeKeys.prototype.keysBytes = $util.emptyArray; + + /** + * Creates a new PurposeKeys instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IPurposeKeys=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys} PurposeKeys instance + */ + PurposeKeys.create = function create(properties) { + return new PurposeKeys(properties); + }; + + /** + * Encodes the specified PurposeKeys message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IPurposeKeys} message PurposeKeys message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PurposeKeys.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.purpose != null && Object.hasOwnProperty.call(message, "purpose")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.purpose); + if (message.keysBytes != null && message.keysBytes.length) + for (var i = 0; i < message.keysBytes.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.keysBytes[i]); + return writer; + }; + + /** + * Encodes the specified PurposeKeys message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IPurposeKeys} message PurposeKeys message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PurposeKeys.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PurposeKeys message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys} PurposeKeys + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PurposeKeys.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.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.purpose = reader.int32(); + break; + case 2: + if (!(message.keysBytes && message.keysBytes.length)) + message.keysBytes = []; + message.keysBytes.push(reader.bytes()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PurposeKeys message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys} PurposeKeys + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PurposeKeys.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PurposeKeys message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PurposeKeys.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.purpose != null && message.hasOwnProperty("purpose")) + switch (message.purpose) { + default: + return "purpose: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 5: + break; + } + if (message.keysBytes != null && message.hasOwnProperty("keysBytes")) { + if (!Array.isArray(message.keysBytes)) + return "keysBytes: array expected"; + for (var i = 0; i < message.keysBytes.length; ++i) + if (!(message.keysBytes[i] && typeof message.keysBytes[i].length === "number" || $util.isString(message.keysBytes[i]))) + return "keysBytes: buffer[] expected"; + } + return null; + }; + + /** + * Creates a PurposeKeys message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys} PurposeKeys + */ + PurposeKeys.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys(); + switch (object.purpose) { + case "AUTHENTICATION": + case 0: + message.purpose = 0; + break; + case "ENCRYPTION": + case 1: + message.purpose = 1; + break; + case "DECRYPTION": + case 2: + message.purpose = 2; + break; + case "TRANSFER": + case 3: + message.purpose = 3; + break; + case "VOTING": + case 5: + message.purpose = 5; + break; + } + if (object.keysBytes) { + if (!Array.isArray(object.keysBytes)) + throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys.keysBytes: array expected"); + message.keysBytes = []; + for (var i = 0; i < object.keysBytes.length; ++i) + if (typeof object.keysBytes[i] === "string") + $util.base64.decode(object.keysBytes[i], message.keysBytes[i] = $util.newBuffer($util.base64.length(object.keysBytes[i])), 0); + else if (object.keysBytes[i].length >= 0) + message.keysBytes[i] = object.keysBytes[i]; + } + return message; + }; + + /** + * Creates a plain object from a PurposeKeys message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys} message PurposeKeys + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PurposeKeys.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.keysBytes = []; + if (options.defaults) + object.purpose = options.enums === String ? "AUTHENTICATION" : 0; + if (message.purpose != null && message.hasOwnProperty("purpose")) + object.purpose = options.enums === String ? $root.org.dash.platform.dapi.v0.KeyPurpose[message.purpose] : message.purpose; + if (message.keysBytes && message.keysBytes.length) { + object.keysBytes = []; + for (var j = 0; j < message.keysBytes.length; ++j) + object.keysBytes[j] = options.bytes === String ? $util.base64.encode(message.keysBytes[j], 0, message.keysBytes[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.keysBytes[j]) : message.keysBytes[j]; + } + return object; + }; + + /** + * Converts this PurposeKeys to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys + * @instance + * @returns {Object.} JSON object + */ + PurposeKeys.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PurposeKeys; + })(); + + GetIdentitiesContractKeysResponseV0.IdentityKeys = (function() { + + /** + * Properties of an IdentityKeys. + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0 + * @interface IIdentityKeys + * @property {Uint8Array|null} [identityId] IdentityKeys identityId + * @property {Array.|null} [keys] IdentityKeys keys + */ + + /** + * Constructs a new IdentityKeys. + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0 + * @classdesc Represents an IdentityKeys. + * @implements IIdentityKeys + * @constructor + * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IIdentityKeys=} [properties] Properties to set + */ + function IdentityKeys(properties) { + this.keys = []; + 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]]; + } + + /** + * IdentityKeys identityId. + * @member {Uint8Array} identityId + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys + * @instance + */ + IdentityKeys.prototype.identityId = $util.newBuffer([]); + + /** + * IdentityKeys keys. + * @member {Array.} keys + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys + * @instance + */ + IdentityKeys.prototype.keys = $util.emptyArray; + + /** + * Creates a new IdentityKeys instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IIdentityKeys=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys} IdentityKeys instance + */ + IdentityKeys.create = function create(properties) { + return new IdentityKeys(properties); + }; + + /** + * Encodes the specified IdentityKeys message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IIdentityKeys} message IdentityKeys message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IdentityKeys.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.identityId != null && Object.hasOwnProperty.call(message, "identityId")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.identityId); + if (message.keys != null && message.keys.length) + for (var i = 0; i < message.keys.length; ++i) + $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys.encode(message.keys[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified IdentityKeys message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IIdentityKeys} message IdentityKeys message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IdentityKeys.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IdentityKeys message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys} IdentityKeys + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IdentityKeys.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.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.identityId = reader.bytes(); + break; + case 2: + if (!(message.keys && message.keys.length)) + message.keys = []; + message.keys.push($root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IdentityKeys message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys} IdentityKeys + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IdentityKeys.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IdentityKeys message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IdentityKeys.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.identityId != null && message.hasOwnProperty("identityId")) + if (!(message.identityId && typeof message.identityId.length === "number" || $util.isString(message.identityId))) + return "identityId: buffer expected"; + if (message.keys != null && message.hasOwnProperty("keys")) { + if (!Array.isArray(message.keys)) + return "keys: array expected"; + for (var i = 0; i < message.keys.length; ++i) { + var error = $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys.verify(message.keys[i]); + if (error) + return "keys." + error; + } + } + return null; + }; + + /** + * Creates an IdentityKeys message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys} IdentityKeys + */ + IdentityKeys.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys(); + if (object.identityId != null) + if (typeof object.identityId === "string") + $util.base64.decode(object.identityId, message.identityId = $util.newBuffer($util.base64.length(object.identityId)), 0); + else if (object.identityId.length >= 0) + message.identityId = object.identityId; + if (object.keys) { + if (!Array.isArray(object.keys)) + throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys.keys: array expected"); + message.keys = []; + for (var i = 0; i < object.keys.length; ++i) { + if (typeof object.keys[i] !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys.keys: object expected"); + message.keys[i] = $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys.fromObject(object.keys[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an IdentityKeys message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys} message IdentityKeys + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IdentityKeys.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.keys = []; + if (options.defaults) + if (options.bytes === String) + object.identityId = ""; + else { + object.identityId = []; + if (options.bytes !== Array) + object.identityId = $util.newBuffer(object.identityId); + } + if (message.identityId != null && message.hasOwnProperty("identityId")) + object.identityId = options.bytes === String ? $util.base64.encode(message.identityId, 0, message.identityId.length) : options.bytes === Array ? Array.prototype.slice.call(message.identityId) : message.identityId; + if (message.keys && message.keys.length) { + object.keys = []; + for (var j = 0; j < message.keys.length; ++j) + object.keys[j] = $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys.toObject(message.keys[j], options); + } + return object; + }; + + /** + * Converts this IdentityKeys to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys + * @instance + * @returns {Object.} JSON object + */ + IdentityKeys.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return IdentityKeys; + })(); + + GetIdentitiesContractKeysResponseV0.IdentitiesKeys = (function() { + + /** + * Properties of an IdentitiesKeys. + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0 + * @interface IIdentitiesKeys + * @property {Array.|null} [entries] IdentitiesKeys entries + */ + + /** + * Constructs a new IdentitiesKeys. + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0 + * @classdesc Represents an IdentitiesKeys. + * @implements IIdentitiesKeys + * @constructor + * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IIdentitiesKeys=} [properties] Properties to set + */ + function IdentitiesKeys(properties) { + this.entries = []; + 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]]; + } + + /** + * IdentitiesKeys entries. + * @member {Array.} entries + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys + * @instance + */ + IdentitiesKeys.prototype.entries = $util.emptyArray; + + /** + * Creates a new IdentitiesKeys instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IIdentitiesKeys=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys} IdentitiesKeys instance + */ + IdentitiesKeys.create = function create(properties) { + return new IdentitiesKeys(properties); + }; + + /** + * Encodes the specified IdentitiesKeys message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IIdentitiesKeys} message IdentitiesKeys message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IdentitiesKeys.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.entries != null && message.entries.length) + for (var i = 0; i < message.entries.length; ++i) + $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys.encode(message.entries[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified IdentitiesKeys message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IIdentitiesKeys} message IdentitiesKeys message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IdentitiesKeys.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IdentitiesKeys message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys} IdentitiesKeys + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IdentitiesKeys.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.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.entries && message.entries.length)) + message.entries = []; + message.entries.push($root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IdentitiesKeys message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys} IdentitiesKeys + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IdentitiesKeys.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IdentitiesKeys message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IdentitiesKeys.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.entries != null && message.hasOwnProperty("entries")) { + if (!Array.isArray(message.entries)) + return "entries: array expected"; + for (var i = 0; i < message.entries.length; ++i) { + var error = $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys.verify(message.entries[i]); + if (error) + return "entries." + error; + } + } + return null; + }; + + /** + * Creates an IdentitiesKeys message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys} IdentitiesKeys + */ + IdentitiesKeys.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys(); + if (object.entries) { + if (!Array.isArray(object.entries)) + throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys.entries: array expected"); + message.entries = []; + for (var i = 0; i < object.entries.length; ++i) { + if (typeof object.entries[i] !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys.entries: object expected"); + message.entries[i] = $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys.fromObject(object.entries[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an IdentitiesKeys message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys} message IdentitiesKeys + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IdentitiesKeys.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.entries = []; + if (message.entries && message.entries.length) { + object.entries = []; + for (var j = 0; j < message.entries.length; ++j) + object.entries[j] = $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys.toObject(message.entries[j], options); + } + return object; + }; + + /** + * Converts this IdentitiesKeys to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys + * @instance + * @returns {Object.} JSON object + */ + IdentitiesKeys.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return IdentitiesKeys; + })(); + + return GetIdentitiesContractKeysResponseV0; + })(); + + return GetIdentitiesContractKeysResponse; + })(); + + v0.GetEvonodesProposedEpochBlocksByIdsRequest = (function() { + + /** + * Properties of a GetEvonodesProposedEpochBlocksByIdsRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetEvonodesProposedEpochBlocksByIdsRequest + * @property {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.IGetEvonodesProposedEpochBlocksByIdsRequestV0|null} [v0] GetEvonodesProposedEpochBlocksByIdsRequest v0 + */ + + /** + * Constructs a new GetEvonodesProposedEpochBlocksByIdsRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetEvonodesProposedEpochBlocksByIdsRequest. + * @implements IGetEvonodesProposedEpochBlocksByIdsRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IGetEvonodesProposedEpochBlocksByIdsRequest=} [properties] Properties to set + */ + function GetEvonodesProposedEpochBlocksByIdsRequest(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]]; + } + + /** + * GetEvonodesProposedEpochBlocksByIdsRequest v0. + * @member {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.IGetEvonodesProposedEpochBlocksByIdsRequestV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest + * @instance + */ + GetEvonodesProposedEpochBlocksByIdsRequest.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetEvonodesProposedEpochBlocksByIdsRequest version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest + * @instance + */ + Object.defineProperty(GetEvonodesProposedEpochBlocksByIdsRequest.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetEvonodesProposedEpochBlocksByIdsRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetEvonodesProposedEpochBlocksByIdsRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest} GetEvonodesProposedEpochBlocksByIdsRequest instance + */ + GetEvonodesProposedEpochBlocksByIdsRequest.create = function create(properties) { + return new GetEvonodesProposedEpochBlocksByIdsRequest(properties); + }; + + /** + * Encodes the specified GetEvonodesProposedEpochBlocksByIdsRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetEvonodesProposedEpochBlocksByIdsRequest} message GetEvonodesProposedEpochBlocksByIdsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetEvonodesProposedEpochBlocksByIdsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetEvonodesProposedEpochBlocksByIdsRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetEvonodesProposedEpochBlocksByIdsRequest} message GetEvonodesProposedEpochBlocksByIdsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetEvonodesProposedEpochBlocksByIdsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetEvonodesProposedEpochBlocksByIdsRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest} GetEvonodesProposedEpochBlocksByIdsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetEvonodesProposedEpochBlocksByIdsRequest.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.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetEvonodesProposedEpochBlocksByIdsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest} GetEvonodesProposedEpochBlocksByIdsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetEvonodesProposedEpochBlocksByIdsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetEvonodesProposedEpochBlocksByIdsRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetEvonodesProposedEpochBlocksByIdsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetEvonodesProposedEpochBlocksByIdsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest} GetEvonodesProposedEpochBlocksByIdsRequest + */ + GetEvonodesProposedEpochBlocksByIdsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetEvonodesProposedEpochBlocksByIdsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest + * @static + * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest} message GetEvonodesProposedEpochBlocksByIdsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetEvonodesProposedEpochBlocksByIdsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetEvonodesProposedEpochBlocksByIdsRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest + * @instance + * @returns {Object.} JSON object + */ + GetEvonodesProposedEpochBlocksByIdsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0 = (function() { + + /** + * Properties of a GetEvonodesProposedEpochBlocksByIdsRequestV0. + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest + * @interface IGetEvonodesProposedEpochBlocksByIdsRequestV0 + * @property {number|null} [epoch] GetEvonodesProposedEpochBlocksByIdsRequestV0 epoch + * @property {Array.|null} [ids] GetEvonodesProposedEpochBlocksByIdsRequestV0 ids + * @property {boolean|null} [prove] GetEvonodesProposedEpochBlocksByIdsRequestV0 prove + */ + + /** + * Constructs a new GetEvonodesProposedEpochBlocksByIdsRequestV0. + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest + * @classdesc Represents a GetEvonodesProposedEpochBlocksByIdsRequestV0. + * @implements IGetEvonodesProposedEpochBlocksByIdsRequestV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.IGetEvonodesProposedEpochBlocksByIdsRequestV0=} [properties] Properties to set + */ + function GetEvonodesProposedEpochBlocksByIdsRequestV0(properties) { + this.ids = []; + 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]]; + } + + /** + * GetEvonodesProposedEpochBlocksByIdsRequestV0 epoch. + * @member {number} epoch + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0 + * @instance + */ + GetEvonodesProposedEpochBlocksByIdsRequestV0.prototype.epoch = 0; + + /** + * GetEvonodesProposedEpochBlocksByIdsRequestV0 ids. + * @member {Array.} ids + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0 + * @instance + */ + GetEvonodesProposedEpochBlocksByIdsRequestV0.prototype.ids = $util.emptyArray; + + /** + * GetEvonodesProposedEpochBlocksByIdsRequestV0 prove. + * @member {boolean} prove + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0 + * @instance + */ + GetEvonodesProposedEpochBlocksByIdsRequestV0.prototype.prove = false; + + /** + * Creates a new GetEvonodesProposedEpochBlocksByIdsRequestV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.IGetEvonodesProposedEpochBlocksByIdsRequestV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0} GetEvonodesProposedEpochBlocksByIdsRequestV0 instance + */ + GetEvonodesProposedEpochBlocksByIdsRequestV0.create = function create(properties) { + return new GetEvonodesProposedEpochBlocksByIdsRequestV0(properties); + }; + + /** + * Encodes the specified GetEvonodesProposedEpochBlocksByIdsRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.IGetEvonodesProposedEpochBlocksByIdsRequestV0} message GetEvonodesProposedEpochBlocksByIdsRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetEvonodesProposedEpochBlocksByIdsRequestV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.epoch != null && Object.hasOwnProperty.call(message, "epoch")) + writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.epoch); + if (message.ids != null && message.ids.length) + for (var i = 0; i < message.ids.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.ids[i]); + if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.prove); + return writer; + }; + + /** + * Encodes the specified GetEvonodesProposedEpochBlocksByIdsRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.IGetEvonodesProposedEpochBlocksByIdsRequestV0} message GetEvonodesProposedEpochBlocksByIdsRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetEvonodesProposedEpochBlocksByIdsRequestV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetEvonodesProposedEpochBlocksByIdsRequestV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0} GetEvonodesProposedEpochBlocksByIdsRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetEvonodesProposedEpochBlocksByIdsRequestV0.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.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.epoch = reader.uint32(); + break; + case 2: + if (!(message.ids && message.ids.length)) + message.ids = []; + message.ids.push(reader.bytes()); + break; + case 3: + message.prove = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetEvonodesProposedEpochBlocksByIdsRequestV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0} GetEvonodesProposedEpochBlocksByIdsRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetEvonodesProposedEpochBlocksByIdsRequestV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetEvonodesProposedEpochBlocksByIdsRequestV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetEvonodesProposedEpochBlocksByIdsRequestV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.epoch != null && message.hasOwnProperty("epoch")) + if (!$util.isInteger(message.epoch)) + return "epoch: integer expected"; + if (message.ids != null && message.hasOwnProperty("ids")) { + if (!Array.isArray(message.ids)) + return "ids: array expected"; + for (var i = 0; i < message.ids.length; ++i) + if (!(message.ids[i] && typeof message.ids[i].length === "number" || $util.isString(message.ids[i]))) + return "ids: buffer[] expected"; + } + if (message.prove != null && message.hasOwnProperty("prove")) + if (typeof message.prove !== "boolean") + return "prove: boolean expected"; + return null; + }; + + /** + * Creates a GetEvonodesProposedEpochBlocksByIdsRequestV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0} GetEvonodesProposedEpochBlocksByIdsRequestV0 + */ + GetEvonodesProposedEpochBlocksByIdsRequestV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0(); + if (object.epoch != null) + message.epoch = object.epoch >>> 0; + if (object.ids) { + if (!Array.isArray(object.ids)) + throw TypeError(".org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0.ids: array expected"); + message.ids = []; + for (var i = 0; i < object.ids.length; ++i) + if (typeof object.ids[i] === "string") + $util.base64.decode(object.ids[i], message.ids[i] = $util.newBuffer($util.base64.length(object.ids[i])), 0); + else if (object.ids[i].length >= 0) + message.ids[i] = object.ids[i]; + } + if (object.prove != null) + message.prove = Boolean(object.prove); + return message; + }; + + /** + * Creates a plain object from a GetEvonodesProposedEpochBlocksByIdsRequestV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0} message GetEvonodesProposedEpochBlocksByIdsRequestV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetEvonodesProposedEpochBlocksByIdsRequestV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.ids = []; + if (options.defaults) { + object.epoch = 0; + object.prove = false; + } + if (message.epoch != null && message.hasOwnProperty("epoch")) + object.epoch = message.epoch; + if (message.ids && message.ids.length) { + object.ids = []; + for (var j = 0; j < message.ids.length; ++j) + object.ids[j] = options.bytes === String ? $util.base64.encode(message.ids[j], 0, message.ids[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.ids[j]) : message.ids[j]; + } + if (message.prove != null && message.hasOwnProperty("prove")) + object.prove = message.prove; + return object; + }; + + /** + * Converts this GetEvonodesProposedEpochBlocksByIdsRequestV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0 + * @instance + * @returns {Object.} JSON object + */ + GetEvonodesProposedEpochBlocksByIdsRequestV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetEvonodesProposedEpochBlocksByIdsRequestV0; + })(); + + return GetEvonodesProposedEpochBlocksByIdsRequest; + })(); + + v0.GetEvonodesProposedEpochBlocksResponse = (function() { + + /** + * Properties of a GetEvonodesProposedEpochBlocksResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetEvonodesProposedEpochBlocksResponse + * @property {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.IGetEvonodesProposedEpochBlocksResponseV0|null} [v0] GetEvonodesProposedEpochBlocksResponse v0 + */ + + /** + * Constructs a new GetEvonodesProposedEpochBlocksResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetEvonodesProposedEpochBlocksResponse. + * @implements IGetEvonodesProposedEpochBlocksResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IGetEvonodesProposedEpochBlocksResponse=} [properties] Properties to set + */ + function GetEvonodesProposedEpochBlocksResponse(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]]; + } + + /** + * GetEvonodesProposedEpochBlocksResponse v0. + * @member {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.IGetEvonodesProposedEpochBlocksResponseV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse + * @instance + */ + GetEvonodesProposedEpochBlocksResponse.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetEvonodesProposedEpochBlocksResponse version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse + * @instance + */ + Object.defineProperty(GetEvonodesProposedEpochBlocksResponse.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetEvonodesProposedEpochBlocksResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetEvonodesProposedEpochBlocksResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse} GetEvonodesProposedEpochBlocksResponse instance + */ + GetEvonodesProposedEpochBlocksResponse.create = function create(properties) { + return new GetEvonodesProposedEpochBlocksResponse(properties); + }; + + /** + * Encodes the specified GetEvonodesProposedEpochBlocksResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetEvonodesProposedEpochBlocksResponse} message GetEvonodesProposedEpochBlocksResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetEvonodesProposedEpochBlocksResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetEvonodesProposedEpochBlocksResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetEvonodesProposedEpochBlocksResponse} message GetEvonodesProposedEpochBlocksResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetEvonodesProposedEpochBlocksResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetEvonodesProposedEpochBlocksResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse} GetEvonodesProposedEpochBlocksResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetEvonodesProposedEpochBlocksResponse.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.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetEvonodesProposedEpochBlocksResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse} GetEvonodesProposedEpochBlocksResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetEvonodesProposedEpochBlocksResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetEvonodesProposedEpochBlocksResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetEvonodesProposedEpochBlocksResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetEvonodesProposedEpochBlocksResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse} GetEvonodesProposedEpochBlocksResponse + */ + GetEvonodesProposedEpochBlocksResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetEvonodesProposedEpochBlocksResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse + * @static + * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse} message GetEvonodesProposedEpochBlocksResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetEvonodesProposedEpochBlocksResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetEvonodesProposedEpochBlocksResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse + * @instance + * @returns {Object.} JSON object + */ + GetEvonodesProposedEpochBlocksResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0 = (function() { + + /** + * Properties of a GetEvonodesProposedEpochBlocksResponseV0. + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse + * @interface IGetEvonodesProposedEpochBlocksResponseV0 + * @property {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.IEvonodesProposedBlocks|null} [evonodesProposedBlockCountsInfo] GetEvonodesProposedEpochBlocksResponseV0 evonodesProposedBlockCountsInfo + * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetEvonodesProposedEpochBlocksResponseV0 proof + * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetEvonodesProposedEpochBlocksResponseV0 metadata + */ + + /** + * Constructs a new GetEvonodesProposedEpochBlocksResponseV0. + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse + * @classdesc Represents a GetEvonodesProposedEpochBlocksResponseV0. + * @implements IGetEvonodesProposedEpochBlocksResponseV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.IGetEvonodesProposedEpochBlocksResponseV0=} [properties] Properties to set + */ + function GetEvonodesProposedEpochBlocksResponseV0(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]]; + } + + /** + * GetEvonodesProposedEpochBlocksResponseV0 evonodesProposedBlockCountsInfo. + * @member {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.IEvonodesProposedBlocks|null|undefined} evonodesProposedBlockCountsInfo + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0 + * @instance + */ + GetEvonodesProposedEpochBlocksResponseV0.prototype.evonodesProposedBlockCountsInfo = null; + + /** + * GetEvonodesProposedEpochBlocksResponseV0 proof. + * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0 + * @instance + */ + GetEvonodesProposedEpochBlocksResponseV0.prototype.proof = null; + + /** + * GetEvonodesProposedEpochBlocksResponseV0 metadata. + * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0 + * @instance + */ + GetEvonodesProposedEpochBlocksResponseV0.prototype.metadata = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetEvonodesProposedEpochBlocksResponseV0 result. + * @member {"evonodesProposedBlockCountsInfo"|"proof"|undefined} result + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0 + * @instance + */ + Object.defineProperty(GetEvonodesProposedEpochBlocksResponseV0.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["evonodesProposedBlockCountsInfo", "proof"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetEvonodesProposedEpochBlocksResponseV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.IGetEvonodesProposedEpochBlocksResponseV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0} GetEvonodesProposedEpochBlocksResponseV0 instance + */ + GetEvonodesProposedEpochBlocksResponseV0.create = function create(properties) { + return new GetEvonodesProposedEpochBlocksResponseV0(properties); + }; + + /** + * Encodes the specified GetEvonodesProposedEpochBlocksResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.IGetEvonodesProposedEpochBlocksResponseV0} message GetEvonodesProposedEpochBlocksResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetEvonodesProposedEpochBlocksResponseV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.evonodesProposedBlockCountsInfo != null && Object.hasOwnProperty.call(message, "evonodesProposedBlockCountsInfo")) + $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks.encode(message.evonodesProposedBlockCountsInfo, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetEvonodesProposedEpochBlocksResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.IGetEvonodesProposedEpochBlocksResponseV0} message GetEvonodesProposedEpochBlocksResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetEvonodesProposedEpochBlocksResponseV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetEvonodesProposedEpochBlocksResponseV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0} GetEvonodesProposedEpochBlocksResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetEvonodesProposedEpochBlocksResponseV0.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.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.evonodesProposedBlockCountsInfo = $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks.decode(reader, reader.uint32()); + break; + case 2: + message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); + break; + case 3: + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetEvonodesProposedEpochBlocksResponseV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0} GetEvonodesProposedEpochBlocksResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetEvonodesProposedEpochBlocksResponseV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetEvonodesProposedEpochBlocksResponseV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetEvonodesProposedEpochBlocksResponseV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.evonodesProposedBlockCountsInfo != null && message.hasOwnProperty("evonodesProposedBlockCountsInfo")) { + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks.verify(message.evonodesProposedBlockCountsInfo); + if (error) + return "evonodesProposedBlockCountsInfo." + error; + } + } + if (message.proof != null && message.hasOwnProperty("proof")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); + if (error) + return "proof." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a GetEvonodesProposedEpochBlocksResponseV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0} GetEvonodesProposedEpochBlocksResponseV0 + */ + GetEvonodesProposedEpochBlocksResponseV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0(); + if (object.evonodesProposedBlockCountsInfo != null) { + if (typeof object.evonodesProposedBlockCountsInfo !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.evonodesProposedBlockCountsInfo: object expected"); + message.evonodesProposedBlockCountsInfo = $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks.fromObject(object.evonodesProposedBlockCountsInfo); + } + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.proof: object expected"); + message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.metadata: object expected"); + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a GetEvonodesProposedEpochBlocksResponseV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0} message GetEvonodesProposedEpochBlocksResponseV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetEvonodesProposedEpochBlocksResponseV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.metadata = null; + if (message.evonodesProposedBlockCountsInfo != null && message.hasOwnProperty("evonodesProposedBlockCountsInfo")) { + object.evonodesProposedBlockCountsInfo = $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks.toObject(message.evonodesProposedBlockCountsInfo, options); + if (options.oneofs) + object.result = "evonodesProposedBlockCountsInfo"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); + if (options.oneofs) + object.result = "proof"; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this GetEvonodesProposedEpochBlocksResponseV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0 + * @instance + * @returns {Object.} JSON object + */ + GetEvonodesProposedEpochBlocksResponseV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocks = (function() { + + /** + * Properties of an EvonodeProposedBlocks. + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0 + * @interface IEvonodeProposedBlocks + * @property {Uint8Array|null} [proTxHash] EvonodeProposedBlocks proTxHash + * @property {number|Long|null} [count] EvonodeProposedBlocks count + */ + + /** + * Constructs a new EvonodeProposedBlocks. + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0 + * @classdesc Represents an EvonodeProposedBlocks. + * @implements IEvonodeProposedBlocks + * @constructor + * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.IEvonodeProposedBlocks=} [properties] Properties to set + */ + function EvonodeProposedBlocks(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]]; + } + + /** + * EvonodeProposedBlocks proTxHash. + * @member {Uint8Array} proTxHash + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocks + * @instance + */ + EvonodeProposedBlocks.prototype.proTxHash = $util.newBuffer([]); + + /** + * EvonodeProposedBlocks count. + * @member {number|Long} count + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocks + * @instance + */ + EvonodeProposedBlocks.prototype.count = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new EvonodeProposedBlocks instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocks + * @static + * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.IEvonodeProposedBlocks=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocks} EvonodeProposedBlocks instance + */ + EvonodeProposedBlocks.create = function create(properties) { + return new EvonodeProposedBlocks(properties); + }; + + /** + * Encodes the specified EvonodeProposedBlocks message. Does not implicitly {@link org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocks.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocks + * @static + * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.IEvonodeProposedBlocks} message EvonodeProposedBlocks message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EvonodeProposedBlocks.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.proTxHash != null && Object.hasOwnProperty.call(message, "proTxHash")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.proTxHash); + if (message.count != null && Object.hasOwnProperty.call(message, "count")) + writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.count); + return writer; + }; + + /** + * Encodes the specified EvonodeProposedBlocks message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocks.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocks + * @static + * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.IEvonodeProposedBlocks} message EvonodeProposedBlocks message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EvonodeProposedBlocks.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EvonodeProposedBlocks message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocks + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocks} EvonodeProposedBlocks + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EvonodeProposedBlocks.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.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocks(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proTxHash = reader.bytes(); + break; + case 2: + message.count = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EvonodeProposedBlocks message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocks + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocks} EvonodeProposedBlocks + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EvonodeProposedBlocks.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EvonodeProposedBlocks message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocks + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EvonodeProposedBlocks.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.proTxHash != null && message.hasOwnProperty("proTxHash")) + if (!(message.proTxHash && typeof message.proTxHash.length === "number" || $util.isString(message.proTxHash))) + return "proTxHash: buffer expected"; + if (message.count != null && message.hasOwnProperty("count")) + if (!$util.isInteger(message.count) && !(message.count && $util.isInteger(message.count.low) && $util.isInteger(message.count.high))) + return "count: integer|Long expected"; + return null; + }; + + /** + * Creates an EvonodeProposedBlocks message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocks + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocks} EvonodeProposedBlocks + */ + EvonodeProposedBlocks.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocks) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocks(); + if (object.proTxHash != null) + if (typeof object.proTxHash === "string") + $util.base64.decode(object.proTxHash, message.proTxHash = $util.newBuffer($util.base64.length(object.proTxHash)), 0); + else if (object.proTxHash.length >= 0) + message.proTxHash = object.proTxHash; + if (object.count != null) + if ($util.Long) + (message.count = $util.Long.fromValue(object.count)).unsigned = true; + else if (typeof object.count === "string") + message.count = parseInt(object.count, 10); + else if (typeof object.count === "number") + message.count = object.count; + else if (typeof object.count === "object") + message.count = new $util.LongBits(object.count.low >>> 0, object.count.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from an EvonodeProposedBlocks message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocks + * @static + * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocks} message EvonodeProposedBlocks + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EvonodeProposedBlocks.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.proTxHash = ""; + else { + object.proTxHash = []; + if (options.bytes !== Array) + object.proTxHash = $util.newBuffer(object.proTxHash); + } + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.count = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.count = options.longs === String ? "0" : 0; + } + if (message.proTxHash != null && message.hasOwnProperty("proTxHash")) + object.proTxHash = options.bytes === String ? $util.base64.encode(message.proTxHash, 0, message.proTxHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.proTxHash) : message.proTxHash; + if (message.count != null && message.hasOwnProperty("count")) + if (typeof message.count === "number") + object.count = options.longs === String ? String(message.count) : message.count; + else + object.count = options.longs === String ? $util.Long.prototype.toString.call(message.count) : options.longs === Number ? new $util.LongBits(message.count.low >>> 0, message.count.high >>> 0).toNumber(true) : message.count; + return object; + }; + + /** + * Converts this EvonodeProposedBlocks to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocks + * @instance + * @returns {Object.} JSON object + */ + EvonodeProposedBlocks.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return EvonodeProposedBlocks; + })(); + + GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks = (function() { + + /** + * Properties of an EvonodesProposedBlocks. + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0 + * @interface IEvonodesProposedBlocks + * @property {Array.|null} [evonodesProposedBlockCounts] EvonodesProposedBlocks evonodesProposedBlockCounts + */ + + /** + * Constructs a new EvonodesProposedBlocks. + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0 + * @classdesc Represents an EvonodesProposedBlocks. + * @implements IEvonodesProposedBlocks + * @constructor + * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.IEvonodesProposedBlocks=} [properties] Properties to set + */ + function EvonodesProposedBlocks(properties) { + this.evonodesProposedBlockCounts = []; + 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]]; + } + + /** + * EvonodesProposedBlocks evonodesProposedBlockCounts. + * @member {Array.} evonodesProposedBlockCounts + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks + * @instance + */ + EvonodesProposedBlocks.prototype.evonodesProposedBlockCounts = $util.emptyArray; + + /** + * Creates a new EvonodesProposedBlocks instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks + * @static + * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.IEvonodesProposedBlocks=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks} EvonodesProposedBlocks instance + */ + EvonodesProposedBlocks.create = function create(properties) { + return new EvonodesProposedBlocks(properties); + }; + + /** + * Encodes the specified EvonodesProposedBlocks message. Does not implicitly {@link org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks + * @static + * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.IEvonodesProposedBlocks} message EvonodesProposedBlocks message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EvonodesProposedBlocks.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.evonodesProposedBlockCounts != null && message.evonodesProposedBlockCounts.length) + for (var i = 0; i < message.evonodesProposedBlockCounts.length; ++i) + $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocks.encode(message.evonodesProposedBlockCounts[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EvonodesProposedBlocks message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks + * @static + * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.IEvonodesProposedBlocks} message EvonodesProposedBlocks message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EvonodesProposedBlocks.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EvonodesProposedBlocks message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks} EvonodesProposedBlocks + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EvonodesProposedBlocks.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.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.evonodesProposedBlockCounts && message.evonodesProposedBlockCounts.length)) + message.evonodesProposedBlockCounts = []; + message.evonodesProposedBlockCounts.push($root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocks.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EvonodesProposedBlocks message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks} EvonodesProposedBlocks + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EvonodesProposedBlocks.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EvonodesProposedBlocks message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EvonodesProposedBlocks.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.evonodesProposedBlockCounts != null && message.hasOwnProperty("evonodesProposedBlockCounts")) { + if (!Array.isArray(message.evonodesProposedBlockCounts)) + return "evonodesProposedBlockCounts: array expected"; + for (var i = 0; i < message.evonodesProposedBlockCounts.length; ++i) { + var error = $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocks.verify(message.evonodesProposedBlockCounts[i]); + if (error) + return "evonodesProposedBlockCounts." + error; + } + } + return null; + }; + + /** + * Creates an EvonodesProposedBlocks message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks} EvonodesProposedBlocks + */ + EvonodesProposedBlocks.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks(); + if (object.evonodesProposedBlockCounts) { + if (!Array.isArray(object.evonodesProposedBlockCounts)) + throw TypeError(".org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks.evonodesProposedBlockCounts: array expected"); + message.evonodesProposedBlockCounts = []; + for (var i = 0; i < object.evonodesProposedBlockCounts.length; ++i) { + if (typeof object.evonodesProposedBlockCounts[i] !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks.evonodesProposedBlockCounts: object expected"); + message.evonodesProposedBlockCounts[i] = $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocks.fromObject(object.evonodesProposedBlockCounts[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an EvonodesProposedBlocks message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks + * @static + * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks} message EvonodesProposedBlocks + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EvonodesProposedBlocks.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.evonodesProposedBlockCounts = []; + if (message.evonodesProposedBlockCounts && message.evonodesProposedBlockCounts.length) { + object.evonodesProposedBlockCounts = []; + for (var j = 0; j < message.evonodesProposedBlockCounts.length; ++j) + object.evonodesProposedBlockCounts[j] = $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocks.toObject(message.evonodesProposedBlockCounts[j], options); + } + return object; + }; + + /** + * Converts this EvonodesProposedBlocks to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks + * @instance + * @returns {Object.} JSON object + */ + EvonodesProposedBlocks.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return EvonodesProposedBlocks; + })(); + + return GetEvonodesProposedEpochBlocksResponseV0; + })(); + + return GetEvonodesProposedEpochBlocksResponse; + })(); + + v0.GetEvonodesProposedEpochBlocksByRangeRequest = (function() { + + /** + * Properties of a GetEvonodesProposedEpochBlocksByRangeRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetEvonodesProposedEpochBlocksByRangeRequest + * @property {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.IGetEvonodesProposedEpochBlocksByRangeRequestV0|null} [v0] GetEvonodesProposedEpochBlocksByRangeRequest v0 + */ + + /** + * Constructs a new GetEvonodesProposedEpochBlocksByRangeRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetEvonodesProposedEpochBlocksByRangeRequest. + * @implements IGetEvonodesProposedEpochBlocksByRangeRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IGetEvonodesProposedEpochBlocksByRangeRequest=} [properties] Properties to set + */ + function GetEvonodesProposedEpochBlocksByRangeRequest(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]]; + } + + /** + * GetEvonodesProposedEpochBlocksByRangeRequest v0. + * @member {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.IGetEvonodesProposedEpochBlocksByRangeRequestV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest + * @instance + */ + GetEvonodesProposedEpochBlocksByRangeRequest.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetEvonodesProposedEpochBlocksByRangeRequest version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest + * @instance + */ + Object.defineProperty(GetEvonodesProposedEpochBlocksByRangeRequest.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetEvonodesProposedEpochBlocksByRangeRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetEvonodesProposedEpochBlocksByRangeRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest} GetEvonodesProposedEpochBlocksByRangeRequest instance + */ + GetEvonodesProposedEpochBlocksByRangeRequest.create = function create(properties) { + return new GetEvonodesProposedEpochBlocksByRangeRequest(properties); + }; + + /** + * Encodes the specified GetEvonodesProposedEpochBlocksByRangeRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetEvonodesProposedEpochBlocksByRangeRequest} message GetEvonodesProposedEpochBlocksByRangeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetEvonodesProposedEpochBlocksByRangeRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetEvonodesProposedEpochBlocksByRangeRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetEvonodesProposedEpochBlocksByRangeRequest} message GetEvonodesProposedEpochBlocksByRangeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetEvonodesProposedEpochBlocksByRangeRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetEvonodesProposedEpochBlocksByRangeRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest} GetEvonodesProposedEpochBlocksByRangeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetEvonodesProposedEpochBlocksByRangeRequest.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.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetEvonodesProposedEpochBlocksByRangeRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest} GetEvonodesProposedEpochBlocksByRangeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetEvonodesProposedEpochBlocksByRangeRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetEvonodesProposedEpochBlocksByRangeRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetEvonodesProposedEpochBlocksByRangeRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetEvonodesProposedEpochBlocksByRangeRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest} GetEvonodesProposedEpochBlocksByRangeRequest + */ + GetEvonodesProposedEpochBlocksByRangeRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetEvonodesProposedEpochBlocksByRangeRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest + * @static + * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest} message GetEvonodesProposedEpochBlocksByRangeRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetEvonodesProposedEpochBlocksByRangeRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetEvonodesProposedEpochBlocksByRangeRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest + * @instance + * @returns {Object.} JSON object + */ + GetEvonodesProposedEpochBlocksByRangeRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0 = (function() { + + /** + * Properties of a GetEvonodesProposedEpochBlocksByRangeRequestV0. + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest + * @interface IGetEvonodesProposedEpochBlocksByRangeRequestV0 + * @property {number|null} [epoch] GetEvonodesProposedEpochBlocksByRangeRequestV0 epoch + * @property {number|null} [limit] GetEvonodesProposedEpochBlocksByRangeRequestV0 limit + * @property {Uint8Array|null} [startAfter] GetEvonodesProposedEpochBlocksByRangeRequestV0 startAfter + * @property {Uint8Array|null} [startAt] GetEvonodesProposedEpochBlocksByRangeRequestV0 startAt + * @property {boolean|null} [prove] GetEvonodesProposedEpochBlocksByRangeRequestV0 prove + */ + + /** + * Constructs a new GetEvonodesProposedEpochBlocksByRangeRequestV0. + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest + * @classdesc Represents a GetEvonodesProposedEpochBlocksByRangeRequestV0. + * @implements IGetEvonodesProposedEpochBlocksByRangeRequestV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.IGetEvonodesProposedEpochBlocksByRangeRequestV0=} [properties] Properties to set + */ + function GetEvonodesProposedEpochBlocksByRangeRequestV0(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]]; + } + + /** + * GetEvonodesProposedEpochBlocksByRangeRequestV0 epoch. + * @member {number} epoch + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0 + * @instance + */ + GetEvonodesProposedEpochBlocksByRangeRequestV0.prototype.epoch = 0; + + /** + * GetEvonodesProposedEpochBlocksByRangeRequestV0 limit. + * @member {number} limit + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0 + * @instance + */ + GetEvonodesProposedEpochBlocksByRangeRequestV0.prototype.limit = 0; + + /** + * GetEvonodesProposedEpochBlocksByRangeRequestV0 startAfter. + * @member {Uint8Array} startAfter + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0 + * @instance + */ + GetEvonodesProposedEpochBlocksByRangeRequestV0.prototype.startAfter = $util.newBuffer([]); + + /** + * GetEvonodesProposedEpochBlocksByRangeRequestV0 startAt. + * @member {Uint8Array} startAt + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0 + * @instance + */ + GetEvonodesProposedEpochBlocksByRangeRequestV0.prototype.startAt = $util.newBuffer([]); + + /** + * GetEvonodesProposedEpochBlocksByRangeRequestV0 prove. + * @member {boolean} prove + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0 + * @instance + */ + GetEvonodesProposedEpochBlocksByRangeRequestV0.prototype.prove = false; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetEvonodesProposedEpochBlocksByRangeRequestV0 start. + * @member {"startAfter"|"startAt"|undefined} start + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0 + * @instance + */ + Object.defineProperty(GetEvonodesProposedEpochBlocksByRangeRequestV0.prototype, "start", { + get: $util.oneOfGetter($oneOfFields = ["startAfter", "startAt"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetEvonodesProposedEpochBlocksByRangeRequestV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.IGetEvonodesProposedEpochBlocksByRangeRequestV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0} GetEvonodesProposedEpochBlocksByRangeRequestV0 instance + */ + GetEvonodesProposedEpochBlocksByRangeRequestV0.create = function create(properties) { + return new GetEvonodesProposedEpochBlocksByRangeRequestV0(properties); + }; + + /** + * Encodes the specified GetEvonodesProposedEpochBlocksByRangeRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.IGetEvonodesProposedEpochBlocksByRangeRequestV0} message GetEvonodesProposedEpochBlocksByRangeRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetEvonodesProposedEpochBlocksByRangeRequestV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.epoch != null && Object.hasOwnProperty.call(message, "epoch")) + writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.epoch); + if (message.limit != null && Object.hasOwnProperty.call(message, "limit")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.limit); + if (message.startAfter != null && Object.hasOwnProperty.call(message, "startAfter")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.startAfter); + if (message.startAt != null && Object.hasOwnProperty.call(message, "startAt")) + writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.startAt); + if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.prove); + return writer; + }; + + /** + * Encodes the specified GetEvonodesProposedEpochBlocksByRangeRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.IGetEvonodesProposedEpochBlocksByRangeRequestV0} message GetEvonodesProposedEpochBlocksByRangeRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetEvonodesProposedEpochBlocksByRangeRequestV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetEvonodesProposedEpochBlocksByRangeRequestV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0} GetEvonodesProposedEpochBlocksByRangeRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetEvonodesProposedEpochBlocksByRangeRequestV0.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.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.epoch = reader.uint32(); + break; + case 2: + message.limit = reader.uint32(); + break; + case 3: + message.startAfter = reader.bytes(); + break; + case 4: + message.startAt = reader.bytes(); + break; + case 5: + message.prove = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetEvonodesProposedEpochBlocksByRangeRequestV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0} GetEvonodesProposedEpochBlocksByRangeRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetEvonodesProposedEpochBlocksByRangeRequestV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetEvonodesProposedEpochBlocksByRangeRequestV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetEvonodesProposedEpochBlocksByRangeRequestV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.epoch != null && message.hasOwnProperty("epoch")) + if (!$util.isInteger(message.epoch)) + return "epoch: integer expected"; + if (message.limit != null && message.hasOwnProperty("limit")) + if (!$util.isInteger(message.limit)) + return "limit: integer expected"; + if (message.startAfter != null && message.hasOwnProperty("startAfter")) { + properties.start = 1; + if (!(message.startAfter && typeof message.startAfter.length === "number" || $util.isString(message.startAfter))) + return "startAfter: buffer expected"; + } + if (message.startAt != null && message.hasOwnProperty("startAt")) { + if (properties.start === 1) + return "start: multiple values"; + properties.start = 1; + if (!(message.startAt && typeof message.startAt.length === "number" || $util.isString(message.startAt))) + return "startAt: buffer expected"; + } + if (message.prove != null && message.hasOwnProperty("prove")) + if (typeof message.prove !== "boolean") + return "prove: boolean expected"; + return null; + }; + + /** + * Creates a GetEvonodesProposedEpochBlocksByRangeRequestV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0} GetEvonodesProposedEpochBlocksByRangeRequestV0 + */ + GetEvonodesProposedEpochBlocksByRangeRequestV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0(); + if (object.epoch != null) + message.epoch = object.epoch >>> 0; + if (object.limit != null) + message.limit = object.limit >>> 0; + if (object.startAfter != null) + if (typeof object.startAfter === "string") + $util.base64.decode(object.startAfter, message.startAfter = $util.newBuffer($util.base64.length(object.startAfter)), 0); + else if (object.startAfter.length >= 0) + message.startAfter = object.startAfter; + if (object.startAt != null) + if (typeof object.startAt === "string") + $util.base64.decode(object.startAt, message.startAt = $util.newBuffer($util.base64.length(object.startAt)), 0); + else if (object.startAt.length >= 0) + message.startAt = object.startAt; + if (object.prove != null) + message.prove = Boolean(object.prove); + return message; + }; + + /** + * Creates a plain object from a GetEvonodesProposedEpochBlocksByRangeRequestV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0} message GetEvonodesProposedEpochBlocksByRangeRequestV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetEvonodesProposedEpochBlocksByRangeRequestV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.epoch = 0; + object.limit = 0; + object.prove = false; + } + if (message.epoch != null && message.hasOwnProperty("epoch")) + object.epoch = message.epoch; + if (message.limit != null && message.hasOwnProperty("limit")) + object.limit = message.limit; + if (message.startAfter != null && message.hasOwnProperty("startAfter")) { + object.startAfter = options.bytes === String ? $util.base64.encode(message.startAfter, 0, message.startAfter.length) : options.bytes === Array ? Array.prototype.slice.call(message.startAfter) : message.startAfter; + if (options.oneofs) + object.start = "startAfter"; + } + if (message.startAt != null && message.hasOwnProperty("startAt")) { + object.startAt = options.bytes === String ? $util.base64.encode(message.startAt, 0, message.startAt.length) : options.bytes === Array ? Array.prototype.slice.call(message.startAt) : message.startAt; + if (options.oneofs) + object.start = "startAt"; + } + if (message.prove != null && message.hasOwnProperty("prove")) + object.prove = message.prove; + return object; + }; + + /** + * Converts this GetEvonodesProposedEpochBlocksByRangeRequestV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0 + * @instance + * @returns {Object.} JSON object + */ + GetEvonodesProposedEpochBlocksByRangeRequestV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetEvonodesProposedEpochBlocksByRangeRequestV0; + })(); + + return GetEvonodesProposedEpochBlocksByRangeRequest; + })(); + + v0.GetIdentitiesBalancesRequest = (function() { + + /** + * Properties of a GetIdentitiesBalancesRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetIdentitiesBalancesRequest + * @property {org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.IGetIdentitiesBalancesRequestV0|null} [v0] GetIdentitiesBalancesRequest v0 + */ + + /** + * Constructs a new GetIdentitiesBalancesRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetIdentitiesBalancesRequest. + * @implements IGetIdentitiesBalancesRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IGetIdentitiesBalancesRequest=} [properties] Properties to set + */ + function GetIdentitiesBalancesRequest(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]]; + } + + /** + * GetIdentitiesBalancesRequest v0. + * @member {org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.IGetIdentitiesBalancesRequestV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest + * @instance + */ + GetIdentitiesBalancesRequest.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetIdentitiesBalancesRequest version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest + * @instance + */ + Object.defineProperty(GetIdentitiesBalancesRequest.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetIdentitiesBalancesRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentitiesBalancesRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest} GetIdentitiesBalancesRequest instance + */ + GetIdentitiesBalancesRequest.create = function create(properties) { + return new GetIdentitiesBalancesRequest(properties); + }; + + /** + * Encodes the specified GetIdentitiesBalancesRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentitiesBalancesRequest} message GetIdentitiesBalancesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentitiesBalancesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetIdentitiesBalancesRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentitiesBalancesRequest} message GetIdentitiesBalancesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentitiesBalancesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentitiesBalancesRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest} GetIdentitiesBalancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentitiesBalancesRequest.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.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentitiesBalancesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest} GetIdentitiesBalancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentitiesBalancesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentitiesBalancesRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentitiesBalancesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetIdentitiesBalancesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest} GetIdentitiesBalancesRequest + */ + GetIdentitiesBalancesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetIdentitiesBalancesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest} message GetIdentitiesBalancesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentitiesBalancesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetIdentitiesBalancesRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest + * @instance + * @returns {Object.} JSON object + */ + GetIdentitiesBalancesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0 = (function() { + + /** + * Properties of a GetIdentitiesBalancesRequestV0. + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest + * @interface IGetIdentitiesBalancesRequestV0 + * @property {Array.|null} [ids] GetIdentitiesBalancesRequestV0 ids + * @property {boolean|null} [prove] GetIdentitiesBalancesRequestV0 prove + */ + + /** + * Constructs a new GetIdentitiesBalancesRequestV0. + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest + * @classdesc Represents a GetIdentitiesBalancesRequestV0. + * @implements IGetIdentitiesBalancesRequestV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.IGetIdentitiesBalancesRequestV0=} [properties] Properties to set + */ + function GetIdentitiesBalancesRequestV0(properties) { + this.ids = []; + 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]]; + } + + /** + * GetIdentitiesBalancesRequestV0 ids. + * @member {Array.} ids + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0 + * @instance + */ + GetIdentitiesBalancesRequestV0.prototype.ids = $util.emptyArray; + + /** + * GetIdentitiesBalancesRequestV0 prove. + * @member {boolean} prove + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0 + * @instance + */ + GetIdentitiesBalancesRequestV0.prototype.prove = false; + + /** + * Creates a new GetIdentitiesBalancesRequestV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.IGetIdentitiesBalancesRequestV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0} GetIdentitiesBalancesRequestV0 instance + */ + GetIdentitiesBalancesRequestV0.create = function create(properties) { + return new GetIdentitiesBalancesRequestV0(properties); + }; + + /** + * Encodes the specified GetIdentitiesBalancesRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.IGetIdentitiesBalancesRequestV0} message GetIdentitiesBalancesRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentitiesBalancesRequestV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ids != null && message.ids.length) + for (var i = 0; i < message.ids.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.ids[i]); + if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.prove); + return writer; + }; + + /** + * Encodes the specified GetIdentitiesBalancesRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.IGetIdentitiesBalancesRequestV0} message GetIdentitiesBalancesRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentitiesBalancesRequestV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentitiesBalancesRequestV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0} GetIdentitiesBalancesRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentitiesBalancesRequestV0.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.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.ids && message.ids.length)) + message.ids = []; + message.ids.push(reader.bytes()); + break; + case 2: + message.prove = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentitiesBalancesRequestV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0} GetIdentitiesBalancesRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentitiesBalancesRequestV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentitiesBalancesRequestV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentitiesBalancesRequestV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ids != null && message.hasOwnProperty("ids")) { + if (!Array.isArray(message.ids)) + return "ids: array expected"; + for (var i = 0; i < message.ids.length; ++i) + if (!(message.ids[i] && typeof message.ids[i].length === "number" || $util.isString(message.ids[i]))) + return "ids: buffer[] expected"; + } + if (message.prove != null && message.hasOwnProperty("prove")) + if (typeof message.prove !== "boolean") + return "prove: boolean expected"; + return null; + }; + + /** + * Creates a GetIdentitiesBalancesRequestV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0} GetIdentitiesBalancesRequestV0 + */ + GetIdentitiesBalancesRequestV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0(); + if (object.ids) { + if (!Array.isArray(object.ids)) + throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.ids: array expected"); + message.ids = []; + for (var i = 0; i < object.ids.length; ++i) + if (typeof object.ids[i] === "string") + $util.base64.decode(object.ids[i], message.ids[i] = $util.newBuffer($util.base64.length(object.ids[i])), 0); + else if (object.ids[i].length >= 0) + message.ids[i] = object.ids[i]; + } + if (object.prove != null) + message.prove = Boolean(object.prove); + return message; + }; + + /** + * Creates a plain object from a GetIdentitiesBalancesRequestV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0} message GetIdentitiesBalancesRequestV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentitiesBalancesRequestV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.ids = []; + if (options.defaults) + object.prove = false; + if (message.ids && message.ids.length) { + object.ids = []; + for (var j = 0; j < message.ids.length; ++j) + object.ids[j] = options.bytes === String ? $util.base64.encode(message.ids[j], 0, message.ids[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.ids[j]) : message.ids[j]; + } + if (message.prove != null && message.hasOwnProperty("prove")) + object.prove = message.prove; + return object; + }; + + /** + * Converts this GetIdentitiesBalancesRequestV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0 + * @instance + * @returns {Object.} JSON object + */ + GetIdentitiesBalancesRequestV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetIdentitiesBalancesRequestV0; + })(); + + return GetIdentitiesBalancesRequest; + })(); + + v0.GetIdentitiesBalancesResponse = (function() { + + /** + * Properties of a GetIdentitiesBalancesResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetIdentitiesBalancesResponse + * @property {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.IGetIdentitiesBalancesResponseV0|null} [v0] GetIdentitiesBalancesResponse v0 + */ + + /** + * Constructs a new GetIdentitiesBalancesResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetIdentitiesBalancesResponse. + * @implements IGetIdentitiesBalancesResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IGetIdentitiesBalancesResponse=} [properties] Properties to set + */ + function GetIdentitiesBalancesResponse(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]]; + } + + /** + * GetIdentitiesBalancesResponse v0. + * @member {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.IGetIdentitiesBalancesResponseV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse + * @instance + */ + GetIdentitiesBalancesResponse.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetIdentitiesBalancesResponse version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse + * @instance + */ + Object.defineProperty(GetIdentitiesBalancesResponse.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetIdentitiesBalancesResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentitiesBalancesResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse} GetIdentitiesBalancesResponse instance + */ + GetIdentitiesBalancesResponse.create = function create(properties) { + return new GetIdentitiesBalancesResponse(properties); + }; + + /** + * Encodes the specified GetIdentitiesBalancesResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentitiesBalancesResponse} message GetIdentitiesBalancesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentitiesBalancesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetIdentitiesBalancesResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentitiesBalancesResponse} message GetIdentitiesBalancesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentitiesBalancesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentitiesBalancesResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse} GetIdentitiesBalancesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentitiesBalancesResponse.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.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentitiesBalancesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse} GetIdentitiesBalancesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentitiesBalancesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentitiesBalancesResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentitiesBalancesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetIdentitiesBalancesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse} GetIdentitiesBalancesResponse + */ + GetIdentitiesBalancesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetIdentitiesBalancesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse} message GetIdentitiesBalancesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentitiesBalancesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetIdentitiesBalancesResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse + * @instance + * @returns {Object.} JSON object + */ + GetIdentitiesBalancesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0 = (function() { + + /** + * Properties of a GetIdentitiesBalancesResponseV0. + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse + * @interface IGetIdentitiesBalancesResponseV0 + * @property {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IIdentitiesBalances|null} [identitiesBalances] GetIdentitiesBalancesResponseV0 identitiesBalances + * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetIdentitiesBalancesResponseV0 proof + * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetIdentitiesBalancesResponseV0 metadata + */ + + /** + * Constructs a new GetIdentitiesBalancesResponseV0. + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse + * @classdesc Represents a GetIdentitiesBalancesResponseV0. + * @implements IGetIdentitiesBalancesResponseV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.IGetIdentitiesBalancesResponseV0=} [properties] Properties to set + */ + function GetIdentitiesBalancesResponseV0(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]]; + } + + /** + * GetIdentitiesBalancesResponseV0 identitiesBalances. + * @member {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IIdentitiesBalances|null|undefined} identitiesBalances + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0 + * @instance + */ + GetIdentitiesBalancesResponseV0.prototype.identitiesBalances = null; + + /** + * GetIdentitiesBalancesResponseV0 proof. + * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0 + * @instance + */ + GetIdentitiesBalancesResponseV0.prototype.proof = null; + + /** + * GetIdentitiesBalancesResponseV0 metadata. + * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0 + * @instance + */ + GetIdentitiesBalancesResponseV0.prototype.metadata = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetIdentitiesBalancesResponseV0 result. + * @member {"identitiesBalances"|"proof"|undefined} result + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0 + * @instance + */ + Object.defineProperty(GetIdentitiesBalancesResponseV0.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["identitiesBalances", "proof"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetIdentitiesBalancesResponseV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.IGetIdentitiesBalancesResponseV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0} GetIdentitiesBalancesResponseV0 instance + */ + GetIdentitiesBalancesResponseV0.create = function create(properties) { + return new GetIdentitiesBalancesResponseV0(properties); + }; + + /** + * Encodes the specified GetIdentitiesBalancesResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.IGetIdentitiesBalancesResponseV0} message GetIdentitiesBalancesResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentitiesBalancesResponseV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.identitiesBalances != null && Object.hasOwnProperty.call(message, "identitiesBalances")) + $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances.encode(message.identitiesBalances, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetIdentitiesBalancesResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.IGetIdentitiesBalancesResponseV0} message GetIdentitiesBalancesResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentitiesBalancesResponseV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentitiesBalancesResponseV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0} GetIdentitiesBalancesResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentitiesBalancesResponseV0.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.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.identitiesBalances = $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances.decode(reader, reader.uint32()); + break; + case 2: + message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); + break; + case 3: + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentitiesBalancesResponseV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0} GetIdentitiesBalancesResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentitiesBalancesResponseV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentitiesBalancesResponseV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentitiesBalancesResponseV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.identitiesBalances != null && message.hasOwnProperty("identitiesBalances")) { + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances.verify(message.identitiesBalances); + if (error) + return "identitiesBalances." + error; + } + } + if (message.proof != null && message.hasOwnProperty("proof")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); + if (error) + return "proof." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a GetIdentitiesBalancesResponseV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0} GetIdentitiesBalancesResponseV0 + */ + GetIdentitiesBalancesResponseV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0(); + if (object.identitiesBalances != null) { + if (typeof object.identitiesBalances !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.identitiesBalances: object expected"); + message.identitiesBalances = $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances.fromObject(object.identitiesBalances); + } + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.proof: object expected"); + message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.metadata: object expected"); + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a GetIdentitiesBalancesResponseV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0} message GetIdentitiesBalancesResponseV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentitiesBalancesResponseV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.metadata = null; + if (message.identitiesBalances != null && message.hasOwnProperty("identitiesBalances")) { + object.identitiesBalances = $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances.toObject(message.identitiesBalances, options); + if (options.oneofs) + object.result = "identitiesBalances"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); + if (options.oneofs) + object.result = "proof"; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this GetIdentitiesBalancesResponseV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0 + * @instance + * @returns {Object.} JSON object + */ + GetIdentitiesBalancesResponseV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetIdentitiesBalancesResponseV0.IdentityBalance = (function() { + + /** + * Properties of an IdentityBalance. + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0 + * @interface IIdentityBalance + * @property {Uint8Array|null} [identityId] IdentityBalance identityId + * @property {number|Long|null} [balance] IdentityBalance balance + */ + + /** + * Constructs a new IdentityBalance. + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0 + * @classdesc Represents an IdentityBalance. + * @implements IIdentityBalance + * @constructor + * @param {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IIdentityBalance=} [properties] Properties to set + */ + function IdentityBalance(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]]; + } + + /** + * IdentityBalance identityId. + * @member {Uint8Array} identityId + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance + * @instance + */ + IdentityBalance.prototype.identityId = $util.newBuffer([]); + + /** + * IdentityBalance balance. + * @member {number|Long} balance + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance + * @instance + */ + IdentityBalance.prototype.balance = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new IdentityBalance instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IIdentityBalance=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance} IdentityBalance instance + */ + IdentityBalance.create = function create(properties) { + return new IdentityBalance(properties); + }; + + /** + * Encodes the specified IdentityBalance message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IIdentityBalance} message IdentityBalance message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IdentityBalance.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.identityId != null && Object.hasOwnProperty.call(message, "identityId")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.identityId); + if (message.balance != null && Object.hasOwnProperty.call(message, "balance")) + writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.balance); + return writer; + }; + + /** + * Encodes the specified IdentityBalance message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IIdentityBalance} message IdentityBalance message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IdentityBalance.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IdentityBalance message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance} IdentityBalance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IdentityBalance.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.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.identityId = reader.bytes(); + break; + case 2: + message.balance = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IdentityBalance message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance} IdentityBalance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IdentityBalance.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IdentityBalance message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IdentityBalance.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.identityId != null && message.hasOwnProperty("identityId")) + if (!(message.identityId && typeof message.identityId.length === "number" || $util.isString(message.identityId))) + return "identityId: buffer expected"; + if (message.balance != null && message.hasOwnProperty("balance")) + if (!$util.isInteger(message.balance) && !(message.balance && $util.isInteger(message.balance.low) && $util.isInteger(message.balance.high))) + return "balance: integer|Long expected"; + return null; + }; + + /** + * Creates an IdentityBalance message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance} IdentityBalance + */ + IdentityBalance.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance(); + if (object.identityId != null) + if (typeof object.identityId === "string") + $util.base64.decode(object.identityId, message.identityId = $util.newBuffer($util.base64.length(object.identityId)), 0); + else if (object.identityId.length >= 0) + message.identityId = object.identityId; + if (object.balance != null) + if ($util.Long) + (message.balance = $util.Long.fromValue(object.balance)).unsigned = true; + else if (typeof object.balance === "string") + message.balance = parseInt(object.balance, 10); + else if (typeof object.balance === "number") + message.balance = object.balance; + else if (typeof object.balance === "object") + message.balance = new $util.LongBits(object.balance.low >>> 0, object.balance.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from an IdentityBalance message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance} message IdentityBalance + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IdentityBalance.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.identityId = ""; + else { + object.identityId = []; + if (options.bytes !== Array) + object.identityId = $util.newBuffer(object.identityId); + } + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.balance = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.balance = options.longs === String ? "0" : 0; + } + if (message.identityId != null && message.hasOwnProperty("identityId")) + object.identityId = options.bytes === String ? $util.base64.encode(message.identityId, 0, message.identityId.length) : options.bytes === Array ? Array.prototype.slice.call(message.identityId) : message.identityId; + if (message.balance != null && message.hasOwnProperty("balance")) + if (typeof message.balance === "number") + object.balance = options.longs === String ? String(message.balance) : message.balance; + else + object.balance = options.longs === String ? $util.Long.prototype.toString.call(message.balance) : options.longs === Number ? new $util.LongBits(message.balance.low >>> 0, message.balance.high >>> 0).toNumber(true) : message.balance; + return object; + }; + + /** + * Converts this IdentityBalance to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance + * @instance + * @returns {Object.} JSON object + */ + IdentityBalance.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return IdentityBalance; + })(); + + GetIdentitiesBalancesResponseV0.IdentitiesBalances = (function() { + + /** + * Properties of an IdentitiesBalances. + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0 + * @interface IIdentitiesBalances + * @property {Array.|null} [entries] IdentitiesBalances entries + */ + + /** + * Constructs a new IdentitiesBalances. + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0 + * @classdesc Represents an IdentitiesBalances. + * @implements IIdentitiesBalances + * @constructor + * @param {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IIdentitiesBalances=} [properties] Properties to set + */ + function IdentitiesBalances(properties) { + this.entries = []; + 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]]; + } + + /** + * IdentitiesBalances entries. + * @member {Array.} entries + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances + * @instance + */ + IdentitiesBalances.prototype.entries = $util.emptyArray; + + /** + * Creates a new IdentitiesBalances instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IIdentitiesBalances=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances} IdentitiesBalances instance + */ + IdentitiesBalances.create = function create(properties) { + return new IdentitiesBalances(properties); + }; + + /** + * Encodes the specified IdentitiesBalances message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IIdentitiesBalances} message IdentitiesBalances message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IdentitiesBalances.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.entries != null && message.entries.length) + for (var i = 0; i < message.entries.length; ++i) + $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance.encode(message.entries[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified IdentitiesBalances message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IIdentitiesBalances} message IdentitiesBalances message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IdentitiesBalances.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IdentitiesBalances message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances} IdentitiesBalances + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IdentitiesBalances.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.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.entries && message.entries.length)) + message.entries = []; + message.entries.push($root.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IdentitiesBalances message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances} IdentitiesBalances + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IdentitiesBalances.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IdentitiesBalances message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IdentitiesBalances.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.entries != null && message.hasOwnProperty("entries")) { + if (!Array.isArray(message.entries)) + return "entries: array expected"; + for (var i = 0; i < message.entries.length; ++i) { + var error = $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance.verify(message.entries[i]); + if (error) + return "entries." + error; + } + } + return null; + }; + + /** + * Creates an IdentitiesBalances message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances} IdentitiesBalances + */ + IdentitiesBalances.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances(); + if (object.entries) { + if (!Array.isArray(object.entries)) + throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances.entries: array expected"); + message.entries = []; + for (var i = 0; i < object.entries.length; ++i) { + if (typeof object.entries[i] !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances.entries: object expected"); + message.entries[i] = $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance.fromObject(object.entries[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an IdentitiesBalances message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances} message IdentitiesBalances + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IdentitiesBalances.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.entries = []; + if (message.entries && message.entries.length) { + object.entries = []; + for (var j = 0; j < message.entries.length; ++j) + object.entries[j] = $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance.toObject(message.entries[j], options); + } + return object; + }; + + /** + * Converts this IdentitiesBalances to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances + * @instance + * @returns {Object.} JSON object + */ + IdentitiesBalances.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return IdentitiesBalances; + })(); + + return GetIdentitiesBalancesResponseV0; + })(); + + return GetIdentitiesBalancesResponse; + })(); + + v0.GetDataContractRequest = (function() { + + /** + * Properties of a GetDataContractRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetDataContractRequest + * @property {org.dash.platform.dapi.v0.GetDataContractRequest.IGetDataContractRequestV0|null} [v0] GetDataContractRequest v0 + */ + + /** + * Constructs a new GetDataContractRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetDataContractRequest. + * @implements IGetDataContractRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IGetDataContractRequest=} [properties] Properties to set + */ + function GetDataContractRequest(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]]; + } + + /** + * GetDataContractRequest v0. + * @member {org.dash.platform.dapi.v0.GetDataContractRequest.IGetDataContractRequestV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetDataContractRequest + * @instance + */ + GetDataContractRequest.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetDataContractRequest version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetDataContractRequest + * @instance + */ + Object.defineProperty(GetDataContractRequest.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetDataContractRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetDataContractRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetDataContractRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetDataContractRequest} GetDataContractRequest instance + */ + GetDataContractRequest.create = function create(properties) { + return new GetDataContractRequest(properties); + }; + + /** + * Encodes the specified GetDataContractRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetDataContractRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetDataContractRequest} message GetDataContractRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDataContractRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetDataContractRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDataContractRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetDataContractRequest} message GetDataContractRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDataContractRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetDataContractRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetDataContractRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetDataContractRequest} GetDataContractRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDataContractRequest.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.org.dash.platform.dapi.v0.GetDataContractRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetDataContractRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDataContractRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetDataContractRequest} GetDataContractRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDataContractRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetDataContractRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetDataContractRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetDataContractRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetDataContractRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetDataContractRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetDataContractRequest} GetDataContractRequest + */ + GetDataContractRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetDataContractRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetDataContractRequest(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetDataContractRequest.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetDataContractRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetDataContractRequest + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractRequest} message GetDataContractRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetDataContractRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetDataContractRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetDataContractRequest + * @instance + * @returns {Object.} JSON object + */ + GetDataContractRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetDataContractRequest.GetDataContractRequestV0 = (function() { + + /** + * Properties of a GetDataContractRequestV0. + * @memberof org.dash.platform.dapi.v0.GetDataContractRequest + * @interface IGetDataContractRequestV0 + * @property {Uint8Array|null} [id] GetDataContractRequestV0 id + * @property {boolean|null} [prove] GetDataContractRequestV0 prove + */ + + /** + * Constructs a new GetDataContractRequestV0. + * @memberof org.dash.platform.dapi.v0.GetDataContractRequest + * @classdesc Represents a GetDataContractRequestV0. + * @implements IGetDataContractRequestV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetDataContractRequest.IGetDataContractRequestV0=} [properties] Properties to set + */ + function GetDataContractRequestV0(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]]; + } + + /** + * GetDataContractRequestV0 id. + * @member {Uint8Array} id + * @memberof org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0 + * @instance + */ + GetDataContractRequestV0.prototype.id = $util.newBuffer([]); + + /** + * GetDataContractRequestV0 prove. + * @member {boolean} prove + * @memberof org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0 + * @instance + */ + GetDataContractRequestV0.prototype.prove = false; + + /** + * Creates a new GetDataContractRequestV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractRequest.IGetDataContractRequestV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0} GetDataContractRequestV0 instance + */ + GetDataContractRequestV0.create = function create(properties) { + return new GetDataContractRequestV0(properties); + }; + + /** + * Encodes the specified GetDataContractRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractRequest.IGetDataContractRequestV0} message GetDataContractRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDataContractRequestV0.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).bytes(message.id); + if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.prove); + return writer; + }; + + /** + * Encodes the specified GetDataContractRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractRequest.IGetDataContractRequestV0} message GetDataContractRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDataContractRequestV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetDataContractRequestV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0} GetDataContractRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDataContractRequestV0.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.org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.bytes(); + break; + case 2: + message.prove = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetDataContractRequestV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0} GetDataContractRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDataContractRequestV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetDataContractRequestV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetDataContractRequestV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.id != null && message.hasOwnProperty("id")) + if (!(message.id && typeof message.id.length === "number" || $util.isString(message.id))) + return "id: buffer expected"; + if (message.prove != null && message.hasOwnProperty("prove")) + if (typeof message.prove !== "boolean") + return "prove: boolean expected"; + return null; + }; + + /** + * Creates a GetDataContractRequestV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0} GetDataContractRequestV0 + */ + GetDataContractRequestV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0(); + if (object.id != null) + if (typeof object.id === "string") + $util.base64.decode(object.id, message.id = $util.newBuffer($util.base64.length(object.id)), 0); + else if (object.id.length >= 0) + message.id = object.id; + if (object.prove != null) + message.prove = Boolean(object.prove); + return message; + }; + + /** + * Creates a plain object from a GetDataContractRequestV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0} message GetDataContractRequestV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetDataContractRequestV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.id = ""; + else { + object.id = []; + if (options.bytes !== Array) + object.id = $util.newBuffer(object.id); + } + object.prove = false; + } + if (message.id != null && message.hasOwnProperty("id")) + object.id = options.bytes === String ? $util.base64.encode(message.id, 0, message.id.length) : options.bytes === Array ? Array.prototype.slice.call(message.id) : message.id; + if (message.prove != null && message.hasOwnProperty("prove")) + object.prove = message.prove; + return object; + }; + + /** + * Converts this GetDataContractRequestV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0 + * @instance + * @returns {Object.} JSON object + */ + GetDataContractRequestV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetDataContractRequestV0; + })(); + + return GetDataContractRequest; + })(); + + v0.GetDataContractResponse = (function() { + + /** + * Properties of a GetDataContractResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetDataContractResponse + * @property {org.dash.platform.dapi.v0.GetDataContractResponse.IGetDataContractResponseV0|null} [v0] GetDataContractResponse v0 + */ + + /** + * Constructs a new GetDataContractResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetDataContractResponse. + * @implements IGetDataContractResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IGetDataContractResponse=} [properties] Properties to set + */ + function GetDataContractResponse(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]]; + } + + /** + * GetDataContractResponse v0. + * @member {org.dash.platform.dapi.v0.GetDataContractResponse.IGetDataContractResponseV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetDataContractResponse + * @instance + */ + GetDataContractResponse.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetDataContractResponse version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetDataContractResponse + * @instance + */ + Object.defineProperty(GetDataContractResponse.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetDataContractResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetDataContractResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetDataContractResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetDataContractResponse} GetDataContractResponse instance + */ + GetDataContractResponse.create = function create(properties) { + return new GetDataContractResponse(properties); + }; + + /** + * Encodes the specified GetDataContractResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetDataContractResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetDataContractResponse} message GetDataContractResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDataContractResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetDataContractResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDataContractResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetDataContractResponse} message GetDataContractResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDataContractResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetDataContractResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetDataContractResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetDataContractResponse} GetDataContractResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDataContractResponse.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.org.dash.platform.dapi.v0.GetDataContractResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetDataContractResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDataContractResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetDataContractResponse} GetDataContractResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDataContractResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetDataContractResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetDataContractResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetDataContractResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetDataContractResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetDataContractResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetDataContractResponse} GetDataContractResponse + */ + GetDataContractResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetDataContractResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetDataContractResponse(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetDataContractResponse.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetDataContractResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetDataContractResponse + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractResponse} message GetDataContractResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetDataContractResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetDataContractResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetDataContractResponse + * @instance + * @returns {Object.} JSON object + */ + GetDataContractResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetDataContractResponse.GetDataContractResponseV0 = (function() { + + /** + * Properties of a GetDataContractResponseV0. + * @memberof org.dash.platform.dapi.v0.GetDataContractResponse + * @interface IGetDataContractResponseV0 + * @property {Uint8Array|null} [dataContract] GetDataContractResponseV0 dataContract + * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetDataContractResponseV0 proof + * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetDataContractResponseV0 metadata + */ + + /** + * Constructs a new GetDataContractResponseV0. + * @memberof org.dash.platform.dapi.v0.GetDataContractResponse + * @classdesc Represents a GetDataContractResponseV0. + * @implements IGetDataContractResponseV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetDataContractResponse.IGetDataContractResponseV0=} [properties] Properties to set + */ + function GetDataContractResponseV0(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]]; + } + + /** + * GetDataContractResponseV0 dataContract. + * @member {Uint8Array} dataContract + * @memberof org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0 + * @instance + */ + GetDataContractResponseV0.prototype.dataContract = $util.newBuffer([]); + + /** + * GetDataContractResponseV0 proof. + * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof + * @memberof org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0 + * @instance + */ + GetDataContractResponseV0.prototype.proof = null; + + /** + * GetDataContractResponseV0 metadata. + * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata + * @memberof org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0 + * @instance + */ + GetDataContractResponseV0.prototype.metadata = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetDataContractResponseV0 result. + * @member {"dataContract"|"proof"|undefined} result + * @memberof org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0 + * @instance + */ + Object.defineProperty(GetDataContractResponseV0.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["dataContract", "proof"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetDataContractResponseV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractResponse.IGetDataContractResponseV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0} GetDataContractResponseV0 instance + */ + GetDataContractResponseV0.create = function create(properties) { + return new GetDataContractResponseV0(properties); + }; + + /** + * Encodes the specified GetDataContractResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractResponse.IGetDataContractResponseV0} message GetDataContractResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDataContractResponseV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dataContract != null && Object.hasOwnProperty.call(message, "dataContract")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.dataContract); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetDataContractResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractResponse.IGetDataContractResponseV0} message GetDataContractResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDataContractResponseV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetDataContractResponseV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0} GetDataContractResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDataContractResponseV0.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.org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.dataContract = reader.bytes(); + break; + case 2: + message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); + break; + case 3: + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetDataContractResponseV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0} GetDataContractResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDataContractResponseV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetDataContractResponseV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetDataContractResponseV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.dataContract != null && message.hasOwnProperty("dataContract")) { + properties.result = 1; + if (!(message.dataContract && typeof message.dataContract.length === "number" || $util.isString(message.dataContract))) + return "dataContract: buffer expected"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); + if (error) + return "proof." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a GetDataContractResponseV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0} GetDataContractResponseV0 + */ + GetDataContractResponseV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0(); + if (object.dataContract != null) + if (typeof object.dataContract === "string") + $util.base64.decode(object.dataContract, message.dataContract = $util.newBuffer($util.base64.length(object.dataContract)), 0); + else if (object.dataContract.length >= 0) + message.dataContract = object.dataContract; + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0.proof: object expected"); + message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0.metadata: object expected"); + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a GetDataContractResponseV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0} message GetDataContractResponseV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetDataContractResponseV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.metadata = null; + if (message.dataContract != null && message.hasOwnProperty("dataContract")) { + object.dataContract = options.bytes === String ? $util.base64.encode(message.dataContract, 0, message.dataContract.length) : options.bytes === Array ? Array.prototype.slice.call(message.dataContract) : message.dataContract; + if (options.oneofs) + object.result = "dataContract"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); + if (options.oneofs) + object.result = "proof"; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this GetDataContractResponseV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0 + * @instance + * @returns {Object.} JSON object + */ + GetDataContractResponseV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetDataContractResponseV0; + })(); + + return GetDataContractResponse; + })(); + + v0.GetDataContractsRequest = (function() { + + /** + * Properties of a GetDataContractsRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetDataContractsRequest + * @property {org.dash.platform.dapi.v0.GetDataContractsRequest.IGetDataContractsRequestV0|null} [v0] GetDataContractsRequest v0 + */ + + /** + * Constructs a new GetDataContractsRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetDataContractsRequest. + * @implements IGetDataContractsRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IGetDataContractsRequest=} [properties] Properties to set + */ + function GetDataContractsRequest(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]]; + } + + /** + * GetDataContractsRequest v0. + * @member {org.dash.platform.dapi.v0.GetDataContractsRequest.IGetDataContractsRequestV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetDataContractsRequest + * @instance + */ + GetDataContractsRequest.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetDataContractsRequest version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetDataContractsRequest + * @instance + */ + Object.defineProperty(GetDataContractsRequest.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetDataContractsRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetDataContractsRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetDataContractsRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetDataContractsRequest} GetDataContractsRequest instance + */ + GetDataContractsRequest.create = function create(properties) { + return new GetDataContractsRequest(properties); + }; + + /** + * Encodes the specified GetDataContractsRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractsRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetDataContractsRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetDataContractsRequest} message GetDataContractsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDataContractsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetDataContractsRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDataContractsRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetDataContractsRequest} message GetDataContractsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDataContractsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetDataContractsRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetDataContractsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetDataContractsRequest} GetDataContractsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDataContractsRequest.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.org.dash.platform.dapi.v0.GetDataContractsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetDataContractsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDataContractsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetDataContractsRequest} GetDataContractsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDataContractsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetDataContractsRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetDataContractsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetDataContractsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetDataContractsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetDataContractsRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetDataContractsRequest} GetDataContractsRequest + */ + GetDataContractsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetDataContractsRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetDataContractsRequest(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetDataContractsRequest.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetDataContractsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetDataContractsRequest + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractsRequest} message GetDataContractsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetDataContractsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetDataContractsRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetDataContractsRequest + * @instance + * @returns {Object.} JSON object + */ + GetDataContractsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetDataContractsRequest.GetDataContractsRequestV0 = (function() { + + /** + * Properties of a GetDataContractsRequestV0. + * @memberof org.dash.platform.dapi.v0.GetDataContractsRequest + * @interface IGetDataContractsRequestV0 + * @property {Array.|null} [ids] GetDataContractsRequestV0 ids + * @property {boolean|null} [prove] GetDataContractsRequestV0 prove + */ + + /** + * Constructs a new GetDataContractsRequestV0. + * @memberof org.dash.platform.dapi.v0.GetDataContractsRequest + * @classdesc Represents a GetDataContractsRequestV0. + * @implements IGetDataContractsRequestV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetDataContractsRequest.IGetDataContractsRequestV0=} [properties] Properties to set + */ + function GetDataContractsRequestV0(properties) { + this.ids = []; + 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]]; + } + + /** + * GetDataContractsRequestV0 ids. + * @member {Array.} ids + * @memberof org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0 + * @instance + */ + GetDataContractsRequestV0.prototype.ids = $util.emptyArray; + + /** + * GetDataContractsRequestV0 prove. + * @member {boolean} prove + * @memberof org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0 + * @instance + */ + GetDataContractsRequestV0.prototype.prove = false; + + /** + * Creates a new GetDataContractsRequestV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractsRequest.IGetDataContractsRequestV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0} GetDataContractsRequestV0 instance + */ + GetDataContractsRequestV0.create = function create(properties) { + return new GetDataContractsRequestV0(properties); + }; + + /** + * Encodes the specified GetDataContractsRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractsRequest.IGetDataContractsRequestV0} message GetDataContractsRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDataContractsRequestV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ids != null && message.ids.length) + for (var i = 0; i < message.ids.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.ids[i]); + if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.prove); + return writer; + }; + + /** + * Encodes the specified GetDataContractsRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractsRequest.IGetDataContractsRequestV0} message GetDataContractsRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDataContractsRequestV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetDataContractsRequestV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0} GetDataContractsRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDataContractsRequestV0.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.org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.ids && message.ids.length)) + message.ids = []; + message.ids.push(reader.bytes()); + break; + case 2: + message.prove = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetDataContractsRequestV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0} GetDataContractsRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDataContractsRequestV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetDataContractsRequestV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetDataContractsRequestV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ids != null && message.hasOwnProperty("ids")) { + if (!Array.isArray(message.ids)) + return "ids: array expected"; + for (var i = 0; i < message.ids.length; ++i) + if (!(message.ids[i] && typeof message.ids[i].length === "number" || $util.isString(message.ids[i]))) + return "ids: buffer[] expected"; + } + if (message.prove != null && message.hasOwnProperty("prove")) + if (typeof message.prove !== "boolean") + return "prove: boolean expected"; + return null; + }; + + /** + * Creates a GetDataContractsRequestV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0} GetDataContractsRequestV0 + */ + GetDataContractsRequestV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0(); + if (object.ids) { + if (!Array.isArray(object.ids)) + throw TypeError(".org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0.ids: array expected"); + message.ids = []; + for (var i = 0; i < object.ids.length; ++i) + if (typeof object.ids[i] === "string") + $util.base64.decode(object.ids[i], message.ids[i] = $util.newBuffer($util.base64.length(object.ids[i])), 0); + else if (object.ids[i].length >= 0) + message.ids[i] = object.ids[i]; + } + if (object.prove != null) + message.prove = Boolean(object.prove); + return message; + }; + + /** + * Creates a plain object from a GetDataContractsRequestV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0} message GetDataContractsRequestV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetDataContractsRequestV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.ids = []; + if (options.defaults) + object.prove = false; + if (message.ids && message.ids.length) { + object.ids = []; + for (var j = 0; j < message.ids.length; ++j) + object.ids[j] = options.bytes === String ? $util.base64.encode(message.ids[j], 0, message.ids[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.ids[j]) : message.ids[j]; + } + if (message.prove != null && message.hasOwnProperty("prove")) + object.prove = message.prove; + return object; + }; + + /** + * Converts this GetDataContractsRequestV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0 + * @instance + * @returns {Object.} JSON object + */ + GetDataContractsRequestV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetDataContractsRequestV0; + })(); + + return GetDataContractsRequest; + })(); + + v0.GetDataContractsResponse = (function() { + + /** + * Properties of a GetDataContractsResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetDataContractsResponse + * @property {org.dash.platform.dapi.v0.GetDataContractsResponse.IGetDataContractsResponseV0|null} [v0] GetDataContractsResponse v0 + */ + + /** + * Constructs a new GetDataContractsResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetDataContractsResponse. + * @implements IGetDataContractsResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IGetDataContractsResponse=} [properties] Properties to set + */ + function GetDataContractsResponse(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]]; + } + + /** + * GetDataContractsResponse v0. + * @member {org.dash.platform.dapi.v0.GetDataContractsResponse.IGetDataContractsResponseV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse + * @instance + */ + GetDataContractsResponse.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetDataContractsResponse version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse + * @instance + */ + Object.defineProperty(GetDataContractsResponse.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetDataContractsResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetDataContractsResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetDataContractsResponse} GetDataContractsResponse instance + */ + GetDataContractsResponse.create = function create(properties) { + return new GetDataContractsResponse(properties); + }; + + /** + * Encodes the specified GetDataContractsResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractsResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetDataContractsResponse} message GetDataContractsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDataContractsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetDataContractsResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetDataContractsResponse} message GetDataContractsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDataContractsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetDataContractsResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetDataContractsResponse} GetDataContractsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDataContractsResponse.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.org.dash.platform.dapi.v0.GetDataContractsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetDataContractsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetDataContractsResponse} GetDataContractsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDataContractsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetDataContractsResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetDataContractsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetDataContractsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetDataContractsResponse} GetDataContractsResponse + */ + GetDataContractsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetDataContractsResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetDataContractsResponse(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetDataContractsResponse.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetDataContractsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractsResponse} message GetDataContractsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetDataContractsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetDataContractsResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse + * @instance + * @returns {Object.} JSON object + */ + GetDataContractsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetDataContractsResponse.DataContractEntry = (function() { + + /** + * Properties of a DataContractEntry. + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse + * @interface IDataContractEntry + * @property {Uint8Array|null} [identifier] DataContractEntry identifier + * @property {google.protobuf.IBytesValue|null} [dataContract] DataContractEntry dataContract + */ + + /** + * Constructs a new DataContractEntry. + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse + * @classdesc Represents a DataContractEntry. + * @implements IDataContractEntry + * @constructor + * @param {org.dash.platform.dapi.v0.GetDataContractsResponse.IDataContractEntry=} [properties] Properties to set + */ + function DataContractEntry(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]]; + } + + /** + * DataContractEntry identifier. + * @member {Uint8Array} identifier + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry + * @instance + */ + DataContractEntry.prototype.identifier = $util.newBuffer([]); + + /** + * DataContractEntry dataContract. + * @member {google.protobuf.IBytesValue|null|undefined} dataContract + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry + * @instance + */ + DataContractEntry.prototype.dataContract = null; + + /** + * Creates a new DataContractEntry instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractsResponse.IDataContractEntry=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry} DataContractEntry instance + */ + DataContractEntry.create = function create(properties) { + return new DataContractEntry(properties); + }; + + /** + * Encodes the specified DataContractEntry message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractsResponse.IDataContractEntry} message DataContractEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataContractEntry.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.identifier != null && Object.hasOwnProperty.call(message, "identifier")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.identifier); + if (message.dataContract != null && Object.hasOwnProperty.call(message, "dataContract")) + $root.google.protobuf.BytesValue.encode(message.dataContract, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DataContractEntry message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractsResponse.IDataContractEntry} message DataContractEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataContractEntry.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DataContractEntry message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry} DataContractEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataContractEntry.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.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.identifier = reader.bytes(); + break; + case 2: + message.dataContract = $root.google.protobuf.BytesValue.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DataContractEntry message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry} DataContractEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataContractEntry.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DataContractEntry message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DataContractEntry.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.identifier != null && message.hasOwnProperty("identifier")) + if (!(message.identifier && typeof message.identifier.length === "number" || $util.isString(message.identifier))) + return "identifier: buffer expected"; + if (message.dataContract != null && message.hasOwnProperty("dataContract")) { + var error = $root.google.protobuf.BytesValue.verify(message.dataContract); + if (error) + return "dataContract." + error; + } + return null; + }; + + /** + * Creates a DataContractEntry message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry} DataContractEntry + */ + DataContractEntry.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry(); + if (object.identifier != null) + if (typeof object.identifier === "string") + $util.base64.decode(object.identifier, message.identifier = $util.newBuffer($util.base64.length(object.identifier)), 0); + else if (object.identifier.length >= 0) + message.identifier = object.identifier; + if (object.dataContract != null) { + if (typeof object.dataContract !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry.dataContract: object expected"); + message.dataContract = $root.google.protobuf.BytesValue.fromObject(object.dataContract); + } + return message; + }; + + /** + * Creates a plain object from a DataContractEntry message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry} message DataContractEntry + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DataContractEntry.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.identifier = ""; + else { + object.identifier = []; + if (options.bytes !== Array) + object.identifier = $util.newBuffer(object.identifier); + } + object.dataContract = null; + } + if (message.identifier != null && message.hasOwnProperty("identifier")) + object.identifier = options.bytes === String ? $util.base64.encode(message.identifier, 0, message.identifier.length) : options.bytes === Array ? Array.prototype.slice.call(message.identifier) : message.identifier; + if (message.dataContract != null && message.hasOwnProperty("dataContract")) + object.dataContract = $root.google.protobuf.BytesValue.toObject(message.dataContract, options); + return object; + }; + + /** + * Converts this DataContractEntry to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry + * @instance + * @returns {Object.} JSON object + */ + DataContractEntry.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DataContractEntry; + })(); + + GetDataContractsResponse.DataContracts = (function() { + + /** + * Properties of a DataContracts. + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse + * @interface IDataContracts + * @property {Array.|null} [dataContractEntries] DataContracts dataContractEntries + */ + + /** + * Constructs a new DataContracts. + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse + * @classdesc Represents a DataContracts. + * @implements IDataContracts + * @constructor + * @param {org.dash.platform.dapi.v0.GetDataContractsResponse.IDataContracts=} [properties] Properties to set + */ + function DataContracts(properties) { + this.dataContractEntries = []; + 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]]; + } + + /** + * DataContracts dataContractEntries. + * @member {Array.} dataContractEntries + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts + * @instance + */ + DataContracts.prototype.dataContractEntries = $util.emptyArray; + + /** + * Creates a new DataContracts instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractsResponse.IDataContracts=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts} DataContracts instance + */ + DataContracts.create = function create(properties) { + return new DataContracts(properties); + }; + + /** + * Encodes the specified DataContracts message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractsResponse.IDataContracts} message DataContracts message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataContracts.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dataContractEntries != null && message.dataContractEntries.length) + for (var i = 0; i < message.dataContractEntries.length; ++i) + $root.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry.encode(message.dataContractEntries[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DataContracts message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractsResponse.IDataContracts} message DataContracts message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataContracts.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DataContracts message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts} DataContracts + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataContracts.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.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.dataContractEntries && message.dataContractEntries.length)) + message.dataContractEntries = []; + message.dataContractEntries.push($root.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DataContracts message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts} DataContracts + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataContracts.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DataContracts message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DataContracts.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.dataContractEntries != null && message.hasOwnProperty("dataContractEntries")) { + if (!Array.isArray(message.dataContractEntries)) + return "dataContractEntries: array expected"; + for (var i = 0; i < message.dataContractEntries.length; ++i) { + var error = $root.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry.verify(message.dataContractEntries[i]); + if (error) + return "dataContractEntries." + error; + } + } + return null; + }; + + /** + * Creates a DataContracts message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts} DataContracts + */ + DataContracts.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts(); + if (object.dataContractEntries) { + if (!Array.isArray(object.dataContractEntries)) + throw TypeError(".org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts.dataContractEntries: array expected"); + message.dataContractEntries = []; + for (var i = 0; i < object.dataContractEntries.length; ++i) { + if (typeof object.dataContractEntries[i] !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts.dataContractEntries: object expected"); + message.dataContractEntries[i] = $root.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry.fromObject(object.dataContractEntries[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a DataContracts message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts} message DataContracts + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DataContracts.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.dataContractEntries = []; + if (message.dataContractEntries && message.dataContractEntries.length) { + object.dataContractEntries = []; + for (var j = 0; j < message.dataContractEntries.length; ++j) + object.dataContractEntries[j] = $root.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry.toObject(message.dataContractEntries[j], options); + } + return object; + }; + + /** + * Converts this DataContracts to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts + * @instance + * @returns {Object.} JSON object + */ + DataContracts.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DataContracts; + })(); + + GetDataContractsResponse.GetDataContractsResponseV0 = (function() { + + /** + * Properties of a GetDataContractsResponseV0. + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse + * @interface IGetDataContractsResponseV0 + * @property {org.dash.platform.dapi.v0.GetDataContractsResponse.IDataContracts|null} [dataContracts] GetDataContractsResponseV0 dataContracts + * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetDataContractsResponseV0 proof + * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetDataContractsResponseV0 metadata + */ + + /** + * Constructs a new GetDataContractsResponseV0. + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse + * @classdesc Represents a GetDataContractsResponseV0. + * @implements IGetDataContractsResponseV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetDataContractsResponse.IGetDataContractsResponseV0=} [properties] Properties to set + */ + function GetDataContractsResponseV0(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]]; + } + + /** + * GetDataContractsResponseV0 dataContracts. + * @member {org.dash.platform.dapi.v0.GetDataContractsResponse.IDataContracts|null|undefined} dataContracts + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0 + * @instance + */ + GetDataContractsResponseV0.prototype.dataContracts = null; + + /** + * GetDataContractsResponseV0 proof. + * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0 + * @instance + */ + GetDataContractsResponseV0.prototype.proof = null; + + /** + * GetDataContractsResponseV0 metadata. + * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0 + * @instance + */ + GetDataContractsResponseV0.prototype.metadata = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetDataContractsResponseV0 result. + * @member {"dataContracts"|"proof"|undefined} result + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0 + * @instance + */ + Object.defineProperty(GetDataContractsResponseV0.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["dataContracts", "proof"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetDataContractsResponseV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractsResponse.IGetDataContractsResponseV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0} GetDataContractsResponseV0 instance + */ + GetDataContractsResponseV0.create = function create(properties) { + return new GetDataContractsResponseV0(properties); + }; + + /** + * Encodes the specified GetDataContractsResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractsResponse.IGetDataContractsResponseV0} message GetDataContractsResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDataContractsResponseV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dataContracts != null && Object.hasOwnProperty.call(message, "dataContracts")) + $root.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts.encode(message.dataContracts, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetDataContractsResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractsResponse.IGetDataContractsResponseV0} message GetDataContractsResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDataContractsResponseV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetDataContractsResponseV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0} GetDataContractsResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDataContractsResponseV0.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.org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.dataContracts = $root.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts.decode(reader, reader.uint32()); + break; + case 2: + message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); + break; + case 3: + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetDataContractsResponseV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0} GetDataContractsResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDataContractsResponseV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetDataContractsResponseV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetDataContractsResponseV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.dataContracts != null && message.hasOwnProperty("dataContracts")) { + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts.verify(message.dataContracts); + if (error) + return "dataContracts." + error; + } + } + if (message.proof != null && message.hasOwnProperty("proof")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); + if (error) + return "proof." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a GetDataContractsResponseV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0} GetDataContractsResponseV0 + */ + GetDataContractsResponseV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0(); + if (object.dataContracts != null) { + if (typeof object.dataContracts !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0.dataContracts: object expected"); + message.dataContracts = $root.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts.fromObject(object.dataContracts); + } + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0.proof: object expected"); + message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0.metadata: object expected"); + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a GetDataContractsResponseV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0} message GetDataContractsResponseV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetDataContractsResponseV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.metadata = null; + if (message.dataContracts != null && message.hasOwnProperty("dataContracts")) { + object.dataContracts = $root.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts.toObject(message.dataContracts, options); + if (options.oneofs) + object.result = "dataContracts"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); + if (options.oneofs) + object.result = "proof"; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this GetDataContractsResponseV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0 + * @instance + * @returns {Object.} JSON object + */ + GetDataContractsResponseV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetDataContractsResponseV0; + })(); + + return GetDataContractsResponse; + })(); + + v0.GetDataContractHistoryRequest = (function() { + + /** + * Properties of a GetDataContractHistoryRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetDataContractHistoryRequest + * @property {org.dash.platform.dapi.v0.GetDataContractHistoryRequest.IGetDataContractHistoryRequestV0|null} [v0] GetDataContractHistoryRequest v0 + */ + + /** + * Constructs a new GetDataContractHistoryRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetDataContractHistoryRequest. + * @implements IGetDataContractHistoryRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IGetDataContractHistoryRequest=} [properties] Properties to set + */ + function GetDataContractHistoryRequest(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]]; + } + + /** + * GetDataContractHistoryRequest v0. + * @member {org.dash.platform.dapi.v0.GetDataContractHistoryRequest.IGetDataContractHistoryRequestV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryRequest + * @instance + */ + GetDataContractHistoryRequest.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetDataContractHistoryRequest version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryRequest + * @instance + */ + Object.defineProperty(GetDataContractHistoryRequest.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetDataContractHistoryRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetDataContractHistoryRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetDataContractHistoryRequest} GetDataContractHistoryRequest instance + */ + GetDataContractHistoryRequest.create = function create(properties) { + return new GetDataContractHistoryRequest(properties); + }; + + /** + * Encodes the specified GetDataContractHistoryRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractHistoryRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetDataContractHistoryRequest} message GetDataContractHistoryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDataContractHistoryRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetDataContractHistoryRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractHistoryRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetDataContractHistoryRequest} message GetDataContractHistoryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDataContractHistoryRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetDataContractHistoryRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetDataContractHistoryRequest} GetDataContractHistoryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDataContractHistoryRequest.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.org.dash.platform.dapi.v0.GetDataContractHistoryRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetDataContractHistoryRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetDataContractHistoryRequest} GetDataContractHistoryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDataContractHistoryRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetDataContractHistoryRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetDataContractHistoryRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetDataContractHistoryRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetDataContractHistoryRequest} GetDataContractHistoryRequest + */ + GetDataContractHistoryRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetDataContractHistoryRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetDataContractHistoryRequest(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetDataContractHistoryRequest.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetDataContractHistoryRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryRequest + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractHistoryRequest} message GetDataContractHistoryRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetDataContractHistoryRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetDataContractHistoryRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryRequest + * @instance + * @returns {Object.} JSON object + */ + GetDataContractHistoryRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetDataContractHistoryRequest.GetDataContractHistoryRequestV0 = (function() { + + /** + * Properties of a GetDataContractHistoryRequestV0. + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryRequest + * @interface IGetDataContractHistoryRequestV0 + * @property {Uint8Array|null} [id] GetDataContractHistoryRequestV0 id + * @property {google.protobuf.IUInt32Value|null} [limit] GetDataContractHistoryRequestV0 limit + * @property {google.protobuf.IUInt32Value|null} [offset] GetDataContractHistoryRequestV0 offset + * @property {number|Long|null} [startAtMs] GetDataContractHistoryRequestV0 startAtMs + * @property {boolean|null} [prove] GetDataContractHistoryRequestV0 prove + */ + + /** + * Constructs a new GetDataContractHistoryRequestV0. + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryRequest + * @classdesc Represents a GetDataContractHistoryRequestV0. + * @implements IGetDataContractHistoryRequestV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetDataContractHistoryRequest.IGetDataContractHistoryRequestV0=} [properties] Properties to set + */ + function GetDataContractHistoryRequestV0(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]]; + } + + /** + * GetDataContractHistoryRequestV0 id. + * @member {Uint8Array} id + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0 + * @instance + */ + GetDataContractHistoryRequestV0.prototype.id = $util.newBuffer([]); + + /** + * GetDataContractHistoryRequestV0 limit. + * @member {google.protobuf.IUInt32Value|null|undefined} limit + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0 + * @instance + */ + GetDataContractHistoryRequestV0.prototype.limit = null; + + /** + * GetDataContractHistoryRequestV0 offset. + * @member {google.protobuf.IUInt32Value|null|undefined} offset + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0 + * @instance + */ + GetDataContractHistoryRequestV0.prototype.offset = null; + + /** + * GetDataContractHistoryRequestV0 startAtMs. + * @member {number|Long} startAtMs + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0 + * @instance + */ + GetDataContractHistoryRequestV0.prototype.startAtMs = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * GetDataContractHistoryRequestV0 prove. + * @member {boolean} prove + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0 + * @instance + */ + GetDataContractHistoryRequestV0.prototype.prove = false; + + /** + * Creates a new GetDataContractHistoryRequestV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractHistoryRequest.IGetDataContractHistoryRequestV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0} GetDataContractHistoryRequestV0 instance + */ + GetDataContractHistoryRequestV0.create = function create(properties) { + return new GetDataContractHistoryRequestV0(properties); + }; + + /** + * Encodes the specified GetDataContractHistoryRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractHistoryRequest.IGetDataContractHistoryRequestV0} message GetDataContractHistoryRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDataContractHistoryRequestV0.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).bytes(message.id); + if (message.limit != null && Object.hasOwnProperty.call(message, "limit")) + $root.google.protobuf.UInt32Value.encode(message.limit, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.offset != null && Object.hasOwnProperty.call(message, "offset")) + $root.google.protobuf.UInt32Value.encode(message.offset, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.startAtMs != null && Object.hasOwnProperty.call(message, "startAtMs")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.startAtMs); + if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.prove); + return writer; + }; + + /** + * Encodes the specified GetDataContractHistoryRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractHistoryRequest.IGetDataContractHistoryRequestV0} message GetDataContractHistoryRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDataContractHistoryRequestV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetDataContractHistoryRequestV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0} GetDataContractHistoryRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDataContractHistoryRequestV0.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.org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.bytes(); + break; + case 2: + message.limit = $root.google.protobuf.UInt32Value.decode(reader, reader.uint32()); + break; + case 3: + message.offset = $root.google.protobuf.UInt32Value.decode(reader, reader.uint32()); + break; + case 4: + message.startAtMs = reader.uint64(); + break; + case 5: + message.prove = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetDataContractHistoryRequestV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0} GetDataContractHistoryRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDataContractHistoryRequestV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetDataContractHistoryRequestV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetDataContractHistoryRequestV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.id != null && message.hasOwnProperty("id")) + if (!(message.id && typeof message.id.length === "number" || $util.isString(message.id))) + return "id: buffer expected"; + if (message.limit != null && message.hasOwnProperty("limit")) { + var error = $root.google.protobuf.UInt32Value.verify(message.limit); + if (error) + return "limit." + error; + } + if (message.offset != null && message.hasOwnProperty("offset")) { + var error = $root.google.protobuf.UInt32Value.verify(message.offset); + if (error) + return "offset." + error; + } + if (message.startAtMs != null && message.hasOwnProperty("startAtMs")) + if (!$util.isInteger(message.startAtMs) && !(message.startAtMs && $util.isInteger(message.startAtMs.low) && $util.isInteger(message.startAtMs.high))) + return "startAtMs: integer|Long expected"; + if (message.prove != null && message.hasOwnProperty("prove")) + if (typeof message.prove !== "boolean") + return "prove: boolean expected"; + return null; + }; + + /** + * Creates a GetDataContractHistoryRequestV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0} GetDataContractHistoryRequestV0 + */ + GetDataContractHistoryRequestV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0(); + if (object.id != null) + if (typeof object.id === "string") + $util.base64.decode(object.id, message.id = $util.newBuffer($util.base64.length(object.id)), 0); + else if (object.id.length >= 0) + message.id = object.id; + if (object.limit != null) { + if (typeof object.limit !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0.limit: object expected"); + message.limit = $root.google.protobuf.UInt32Value.fromObject(object.limit); + } + if (object.offset != null) { + if (typeof object.offset !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0.offset: object expected"); + message.offset = $root.google.protobuf.UInt32Value.fromObject(object.offset); + } + if (object.startAtMs != null) + if ($util.Long) + (message.startAtMs = $util.Long.fromValue(object.startAtMs)).unsigned = true; + else if (typeof object.startAtMs === "string") + message.startAtMs = parseInt(object.startAtMs, 10); + else if (typeof object.startAtMs === "number") + message.startAtMs = object.startAtMs; + else if (typeof object.startAtMs === "object") + message.startAtMs = new $util.LongBits(object.startAtMs.low >>> 0, object.startAtMs.high >>> 0).toNumber(true); + if (object.prove != null) + message.prove = Boolean(object.prove); + return message; + }; + + /** + * Creates a plain object from a GetDataContractHistoryRequestV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0} message GetDataContractHistoryRequestV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetDataContractHistoryRequestV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.id = ""; + else { + object.id = []; + if (options.bytes !== Array) + object.id = $util.newBuffer(object.id); + } + object.limit = null; + object.offset = null; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.startAtMs = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.startAtMs = options.longs === String ? "0" : 0; + object.prove = false; + } + if (message.id != null && message.hasOwnProperty("id")) + object.id = options.bytes === String ? $util.base64.encode(message.id, 0, message.id.length) : options.bytes === Array ? Array.prototype.slice.call(message.id) : message.id; + if (message.limit != null && message.hasOwnProperty("limit")) + object.limit = $root.google.protobuf.UInt32Value.toObject(message.limit, options); + if (message.offset != null && message.hasOwnProperty("offset")) + object.offset = $root.google.protobuf.UInt32Value.toObject(message.offset, options); + if (message.startAtMs != null && message.hasOwnProperty("startAtMs")) + if (typeof message.startAtMs === "number") + object.startAtMs = options.longs === String ? String(message.startAtMs) : message.startAtMs; + else + object.startAtMs = options.longs === String ? $util.Long.prototype.toString.call(message.startAtMs) : options.longs === Number ? new $util.LongBits(message.startAtMs.low >>> 0, message.startAtMs.high >>> 0).toNumber(true) : message.startAtMs; + if (message.prove != null && message.hasOwnProperty("prove")) + object.prove = message.prove; + return object; + }; + + /** + * Converts this GetDataContractHistoryRequestV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0 + * @instance + * @returns {Object.} JSON object + */ + GetDataContractHistoryRequestV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetDataContractHistoryRequestV0; + })(); + + return GetDataContractHistoryRequest; + })(); + + v0.GetDataContractHistoryResponse = (function() { + + /** + * Properties of a GetDataContractHistoryResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetDataContractHistoryResponse + * @property {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.IGetDataContractHistoryResponseV0|null} [v0] GetDataContractHistoryResponse v0 + */ + + /** + * Constructs a new GetDataContractHistoryResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetDataContractHistoryResponse. + * @implements IGetDataContractHistoryResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IGetDataContractHistoryResponse=} [properties] Properties to set + */ + function GetDataContractHistoryResponse(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]]; + } + + /** + * GetDataContractHistoryResponse v0. + * @member {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.IGetDataContractHistoryResponseV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse + * @instance + */ + GetDataContractHistoryResponse.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetDataContractHistoryResponse version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse + * @instance + */ + Object.defineProperty(GetDataContractHistoryResponse.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetDataContractHistoryResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetDataContractHistoryResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetDataContractHistoryResponse} GetDataContractHistoryResponse instance + */ + GetDataContractHistoryResponse.create = function create(properties) { + return new GetDataContractHistoryResponse(properties); + }; + + /** + * Encodes the specified GetDataContractHistoryResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractHistoryResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetDataContractHistoryResponse} message GetDataContractHistoryResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDataContractHistoryResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetDataContractHistoryResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractHistoryResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetDataContractHistoryResponse} message GetDataContractHistoryResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDataContractHistoryResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetDataContractHistoryResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetDataContractHistoryResponse} GetDataContractHistoryResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDataContractHistoryResponse.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.org.dash.platform.dapi.v0.GetDataContractHistoryResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetDataContractHistoryResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetDataContractHistoryResponse} GetDataContractHistoryResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDataContractHistoryResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetDataContractHistoryResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetDataContractHistoryResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetDataContractHistoryResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetDataContractHistoryResponse} GetDataContractHistoryResponse + */ + GetDataContractHistoryResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetDataContractHistoryResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetDataContractHistoryResponse(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetDataContractHistoryResponse.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetDataContractHistoryResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractHistoryResponse} message GetDataContractHistoryResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetDataContractHistoryResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetDataContractHistoryResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse + * @instance + * @returns {Object.} JSON object + */ + GetDataContractHistoryResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetDataContractHistoryResponse.GetDataContractHistoryResponseV0 = (function() { + + /** + * Properties of a GetDataContractHistoryResponseV0. + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse + * @interface IGetDataContractHistoryResponseV0 + * @property {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.IDataContractHistory|null} [dataContractHistory] GetDataContractHistoryResponseV0 dataContractHistory + * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetDataContractHistoryResponseV0 proof + * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetDataContractHistoryResponseV0 metadata + */ + + /** + * Constructs a new GetDataContractHistoryResponseV0. + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse + * @classdesc Represents a GetDataContractHistoryResponseV0. + * @implements IGetDataContractHistoryResponseV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.IGetDataContractHistoryResponseV0=} [properties] Properties to set + */ + function GetDataContractHistoryResponseV0(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]]; + } + + /** + * GetDataContractHistoryResponseV0 dataContractHistory. + * @member {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.IDataContractHistory|null|undefined} dataContractHistory + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0 + * @instance + */ + GetDataContractHistoryResponseV0.prototype.dataContractHistory = null; + + /** + * GetDataContractHistoryResponseV0 proof. + * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0 + * @instance + */ + GetDataContractHistoryResponseV0.prototype.proof = null; + + /** + * GetDataContractHistoryResponseV0 metadata. + * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0 + * @instance + */ + GetDataContractHistoryResponseV0.prototype.metadata = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetDataContractHistoryResponseV0 result. + * @member {"dataContractHistory"|"proof"|undefined} result + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0 + * @instance + */ + Object.defineProperty(GetDataContractHistoryResponseV0.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["dataContractHistory", "proof"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetDataContractHistoryResponseV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.IGetDataContractHistoryResponseV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0} GetDataContractHistoryResponseV0 instance + */ + GetDataContractHistoryResponseV0.create = function create(properties) { + return new GetDataContractHistoryResponseV0(properties); + }; + + /** + * Encodes the specified GetDataContractHistoryResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.IGetDataContractHistoryResponseV0} message GetDataContractHistoryResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDataContractHistoryResponseV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dataContractHistory != null && Object.hasOwnProperty.call(message, "dataContractHistory")) + $root.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistory.encode(message.dataContractHistory, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetDataContractHistoryResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.IGetDataContractHistoryResponseV0} message GetDataContractHistoryResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDataContractHistoryResponseV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetDataContractHistoryResponseV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0} GetDataContractHistoryResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDataContractHistoryResponseV0.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.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.dataContractHistory = $root.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistory.decode(reader, reader.uint32()); + break; + case 2: + message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); + break; + case 3: + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetDataContractHistoryResponseV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0} GetDataContractHistoryResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDataContractHistoryResponseV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetDataContractHistoryResponseV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetDataContractHistoryResponseV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.dataContractHistory != null && message.hasOwnProperty("dataContractHistory")) { + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistory.verify(message.dataContractHistory); + if (error) + return "dataContractHistory." + error; + } + } + if (message.proof != null && message.hasOwnProperty("proof")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); + if (error) + return "proof." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a GetDataContractHistoryResponseV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0} GetDataContractHistoryResponseV0 + */ + GetDataContractHistoryResponseV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0(); + if (object.dataContractHistory != null) { + if (typeof object.dataContractHistory !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.dataContractHistory: object expected"); + message.dataContractHistory = $root.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistory.fromObject(object.dataContractHistory); + } + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.proof: object expected"); + message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.metadata: object expected"); + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a GetDataContractHistoryResponseV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0} message GetDataContractHistoryResponseV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetDataContractHistoryResponseV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.metadata = null; + if (message.dataContractHistory != null && message.hasOwnProperty("dataContractHistory")) { + object.dataContractHistory = $root.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistory.toObject(message.dataContractHistory, options); + if (options.oneofs) + object.result = "dataContractHistory"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); + if (options.oneofs) + object.result = "proof"; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this GetDataContractHistoryResponseV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0 + * @instance + * @returns {Object.} JSON object + */ + GetDataContractHistoryResponseV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetDataContractHistoryResponseV0.DataContractHistoryEntry = (function() { + + /** + * Properties of a DataContractHistoryEntry. + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0 + * @interface IDataContractHistoryEntry + * @property {number|Long|null} [date] DataContractHistoryEntry date + * @property {Uint8Array|null} [value] DataContractHistoryEntry value + */ + + /** + * Constructs a new DataContractHistoryEntry. + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0 + * @classdesc Represents a DataContractHistoryEntry. + * @implements IDataContractHistoryEntry + * @constructor + * @param {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.IDataContractHistoryEntry=} [properties] Properties to set + */ + function DataContractHistoryEntry(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]]; + } + + /** + * DataContractHistoryEntry date. + * @member {number|Long} date + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntry + * @instance + */ + DataContractHistoryEntry.prototype.date = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * DataContractHistoryEntry value. + * @member {Uint8Array} value + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntry + * @instance + */ + DataContractHistoryEntry.prototype.value = $util.newBuffer([]); + + /** + * Creates a new DataContractHistoryEntry instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntry + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.IDataContractHistoryEntry=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntry} DataContractHistoryEntry instance + */ + DataContractHistoryEntry.create = function create(properties) { + return new DataContractHistoryEntry(properties); + }; + + /** + * Encodes the specified DataContractHistoryEntry message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntry.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntry + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.IDataContractHistoryEntry} message DataContractHistoryEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataContractHistoryEntry.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.date != null && Object.hasOwnProperty.call(message, "date")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.date); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value); + return writer; + }; + + /** + * Encodes the specified DataContractHistoryEntry message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntry.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntry + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.IDataContractHistoryEntry} message DataContractHistoryEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataContractHistoryEntry.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DataContractHistoryEntry message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntry} DataContractHistoryEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataContractHistoryEntry.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.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntry(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.date = reader.uint64(); + break; + case 2: + message.value = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DataContractHistoryEntry message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntry} DataContractHistoryEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataContractHistoryEntry.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DataContractHistoryEntry message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntry + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DataContractHistoryEntry.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.date != null && message.hasOwnProperty("date")) + if (!$util.isInteger(message.date) && !(message.date && $util.isInteger(message.date.low) && $util.isInteger(message.date.high))) + return "date: integer|Long expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) + return "value: buffer expected"; + return null; + }; + + /** + * Creates a DataContractHistoryEntry message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntry + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntry} DataContractHistoryEntry + */ + DataContractHistoryEntry.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntry) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntry(); + if (object.date != null) + if ($util.Long) + (message.date = $util.Long.fromValue(object.date)).unsigned = true; + else if (typeof object.date === "string") + message.date = parseInt(object.date, 10); + else if (typeof object.date === "number") + message.date = object.date; + else if (typeof object.date === "object") + message.date = new $util.LongBits(object.date.low >>> 0, object.date.high >>> 0).toNumber(true); + if (object.value != null) + if (typeof object.value === "string") + $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); + else if (object.value.length >= 0) + message.value = object.value; + return message; + }; + + /** + * Creates a plain object from a DataContractHistoryEntry message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntry + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntry} message DataContractHistoryEntry + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DataContractHistoryEntry.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.date = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.date = options.longs === String ? "0" : 0; + if (options.bytes === String) + object.value = ""; + else { + object.value = []; + if (options.bytes !== Array) + object.value = $util.newBuffer(object.value); + } + } + if (message.date != null && message.hasOwnProperty("date")) + if (typeof message.date === "number") + object.date = options.longs === String ? String(message.date) : message.date; + else + object.date = options.longs === String ? $util.Long.prototype.toString.call(message.date) : options.longs === Number ? new $util.LongBits(message.date.low >>> 0, message.date.high >>> 0).toNumber(true) : message.date; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; + return object; + }; + + /** + * Converts this DataContractHistoryEntry to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntry + * @instance + * @returns {Object.} JSON object + */ + DataContractHistoryEntry.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DataContractHistoryEntry; + })(); + + GetDataContractHistoryResponseV0.DataContractHistory = (function() { + + /** + * Properties of a DataContractHistory. + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0 + * @interface IDataContractHistory + * @property {Array.|null} [dataContractEntries] DataContractHistory dataContractEntries + */ + + /** + * Constructs a new DataContractHistory. + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0 + * @classdesc Represents a DataContractHistory. + * @implements IDataContractHistory + * @constructor + * @param {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.IDataContractHistory=} [properties] Properties to set + */ + function DataContractHistory(properties) { + this.dataContractEntries = []; + 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]]; + } + + /** + * DataContractHistory dataContractEntries. + * @member {Array.} dataContractEntries + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistory + * @instance + */ + DataContractHistory.prototype.dataContractEntries = $util.emptyArray; + + /** + * Creates a new DataContractHistory instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistory + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.IDataContractHistory=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistory} DataContractHistory instance + */ + DataContractHistory.create = function create(properties) { + return new DataContractHistory(properties); + }; + + /** + * Encodes the specified DataContractHistory message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistory.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistory + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.IDataContractHistory} message DataContractHistory message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataContractHistory.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dataContractEntries != null && message.dataContractEntries.length) + for (var i = 0; i < message.dataContractEntries.length; ++i) + $root.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntry.encode(message.dataContractEntries[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DataContractHistory message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistory.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistory + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.IDataContractHistory} message DataContractHistory message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataContractHistory.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DataContractHistory message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistory + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistory} DataContractHistory + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataContractHistory.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.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistory(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.dataContractEntries && message.dataContractEntries.length)) + message.dataContractEntries = []; + message.dataContractEntries.push($root.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntry.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DataContractHistory message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistory + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistory} DataContractHistory + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataContractHistory.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DataContractHistory message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistory + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DataContractHistory.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.dataContractEntries != null && message.hasOwnProperty("dataContractEntries")) { + if (!Array.isArray(message.dataContractEntries)) + return "dataContractEntries: array expected"; + for (var i = 0; i < message.dataContractEntries.length; ++i) { + var error = $root.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntry.verify(message.dataContractEntries[i]); + if (error) + return "dataContractEntries." + error; + } + } + return null; + }; + + /** + * Creates a DataContractHistory message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistory + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistory} DataContractHistory + */ + DataContractHistory.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistory) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistory(); + if (object.dataContractEntries) { + if (!Array.isArray(object.dataContractEntries)) + throw TypeError(".org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistory.dataContractEntries: array expected"); + message.dataContractEntries = []; + for (var i = 0; i < object.dataContractEntries.length; ++i) { + if (typeof object.dataContractEntries[i] !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistory.dataContractEntries: object expected"); + message.dataContractEntries[i] = $root.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntry.fromObject(object.dataContractEntries[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a DataContractHistory message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistory + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistory} message DataContractHistory + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DataContractHistory.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.dataContractEntries = []; + if (message.dataContractEntries && message.dataContractEntries.length) { + object.dataContractEntries = []; + for (var j = 0; j < message.dataContractEntries.length; ++j) + object.dataContractEntries[j] = $root.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntry.toObject(message.dataContractEntries[j], options); + } + return object; + }; + + /** + * Converts this DataContractHistory to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistory + * @instance + * @returns {Object.} JSON object + */ + DataContractHistory.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DataContractHistory; + })(); + + return GetDataContractHistoryResponseV0; + })(); + + return GetDataContractHistoryResponse; + })(); + + v0.GetDocumentsRequest = (function() { + + /** + * Properties of a GetDocumentsRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetDocumentsRequest + * @property {org.dash.platform.dapi.v0.GetDocumentsRequest.IGetDocumentsRequestV0|null} [v0] GetDocumentsRequest v0 + */ + + /** + * Constructs a new GetDocumentsRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetDocumentsRequest. + * @implements IGetDocumentsRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IGetDocumentsRequest=} [properties] Properties to set + */ + function GetDocumentsRequest(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]]; + } + + /** + * GetDocumentsRequest v0. + * @member {org.dash.platform.dapi.v0.GetDocumentsRequest.IGetDocumentsRequestV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest + * @instance + */ + GetDocumentsRequest.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetDocumentsRequest version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest + * @instance + */ + Object.defineProperty(GetDocumentsRequest.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetDocumentsRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetDocumentsRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetDocumentsRequest} GetDocumentsRequest instance + */ + GetDocumentsRequest.create = function create(properties) { + return new GetDocumentsRequest(properties); + }; + + /** + * Encodes the specified GetDocumentsRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDocumentsRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetDocumentsRequest} message GetDocumentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDocumentsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetDocumentsRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDocumentsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetDocumentsRequest} message GetDocumentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDocumentsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetDocumentsRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetDocumentsRequest} GetDocumentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDocumentsRequest.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.org.dash.platform.dapi.v0.GetDocumentsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetDocumentsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetDocumentsRequest} GetDocumentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDocumentsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetDocumentsRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetDocumentsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetDocumentsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetDocumentsRequest} GetDocumentsRequest + */ + GetDocumentsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetDocumentsRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetDocumentsRequest(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetDocumentsRequest.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetDocumentsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest + * @static + * @param {org.dash.platform.dapi.v0.GetDocumentsRequest} message GetDocumentsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetDocumentsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetDocumentsRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest + * @instance + * @returns {Object.} JSON object + */ + GetDocumentsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetDocumentsRequest.GetDocumentsRequestV0 = (function() { + + /** + * Properties of a GetDocumentsRequestV0. + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest + * @interface IGetDocumentsRequestV0 + * @property {Uint8Array|null} [dataContractId] GetDocumentsRequestV0 dataContractId + * @property {string|null} [documentType] GetDocumentsRequestV0 documentType + * @property {Uint8Array|null} [where] GetDocumentsRequestV0 where + * @property {Uint8Array|null} [orderBy] GetDocumentsRequestV0 orderBy + * @property {number|null} [limit] GetDocumentsRequestV0 limit + * @property {Uint8Array|null} [startAfter] GetDocumentsRequestV0 startAfter + * @property {Uint8Array|null} [startAt] GetDocumentsRequestV0 startAt + * @property {boolean|null} [prove] GetDocumentsRequestV0 prove + */ + + /** + * Constructs a new GetDocumentsRequestV0. + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest + * @classdesc Represents a GetDocumentsRequestV0. + * @implements IGetDocumentsRequestV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetDocumentsRequest.IGetDocumentsRequestV0=} [properties] Properties to set + */ + function GetDocumentsRequestV0(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]]; + } + + /** + * GetDocumentsRequestV0 dataContractId. + * @member {Uint8Array} dataContractId + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0 + * @instance + */ + GetDocumentsRequestV0.prototype.dataContractId = $util.newBuffer([]); + + /** + * GetDocumentsRequestV0 documentType. + * @member {string} documentType + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0 + * @instance + */ + GetDocumentsRequestV0.prototype.documentType = ""; + + /** + * GetDocumentsRequestV0 where. + * @member {Uint8Array} where + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0 + * @instance + */ + GetDocumentsRequestV0.prototype.where = $util.newBuffer([]); + + /** + * GetDocumentsRequestV0 orderBy. + * @member {Uint8Array} orderBy + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0 + * @instance + */ + GetDocumentsRequestV0.prototype.orderBy = $util.newBuffer([]); + + /** + * GetDocumentsRequestV0 limit. + * @member {number} limit + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0 + * @instance + */ + GetDocumentsRequestV0.prototype.limit = 0; + + /** + * GetDocumentsRequestV0 startAfter. + * @member {Uint8Array} startAfter + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0 + * @instance + */ + GetDocumentsRequestV0.prototype.startAfter = $util.newBuffer([]); + + /** + * GetDocumentsRequestV0 startAt. + * @member {Uint8Array} startAt + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0 + * @instance + */ + GetDocumentsRequestV0.prototype.startAt = $util.newBuffer([]); + + /** + * GetDocumentsRequestV0 prove. + * @member {boolean} prove + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0 + * @instance + */ + GetDocumentsRequestV0.prototype.prove = false; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetDocumentsRequestV0 start. + * @member {"startAfter"|"startAt"|undefined} start + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0 + * @instance + */ + Object.defineProperty(GetDocumentsRequestV0.prototype, "start", { + get: $util.oneOfGetter($oneOfFields = ["startAfter", "startAt"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetDocumentsRequestV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetDocumentsRequest.IGetDocumentsRequestV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0} GetDocumentsRequestV0 instance + */ + GetDocumentsRequestV0.create = function create(properties) { + return new GetDocumentsRequestV0(properties); + }; + + /** + * Encodes the specified GetDocumentsRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetDocumentsRequest.IGetDocumentsRequestV0} message GetDocumentsRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDocumentsRequestV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dataContractId != null && Object.hasOwnProperty.call(message, "dataContractId")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.dataContractId); + if (message.documentType != null && Object.hasOwnProperty.call(message, "documentType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.documentType); + if (message.where != null && Object.hasOwnProperty.call(message, "where")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.where); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.orderBy); + if (message.limit != null && Object.hasOwnProperty.call(message, "limit")) + writer.uint32(/* id 5, wireType 0 =*/40).uint32(message.limit); + if (message.startAfter != null && Object.hasOwnProperty.call(message, "startAfter")) + writer.uint32(/* id 6, wireType 2 =*/50).bytes(message.startAfter); + if (message.startAt != null && Object.hasOwnProperty.call(message, "startAt")) + writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.startAt); + if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) + writer.uint32(/* id 8, wireType 0 =*/64).bool(message.prove); + return writer; + }; + + /** + * Encodes the specified GetDocumentsRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetDocumentsRequest.IGetDocumentsRequestV0} message GetDocumentsRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDocumentsRequestV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetDocumentsRequestV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0} GetDocumentsRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDocumentsRequestV0.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.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.dataContractId = reader.bytes(); + break; + case 2: + message.documentType = reader.string(); + break; + case 3: + message.where = reader.bytes(); + break; + case 4: + message.orderBy = reader.bytes(); + break; + case 5: + message.limit = reader.uint32(); + break; + case 6: + message.startAfter = reader.bytes(); + break; + case 7: + message.startAt = reader.bytes(); + break; + case 8: + message.prove = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetDocumentsRequestV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0} GetDocumentsRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDocumentsRequestV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetDocumentsRequestV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetDocumentsRequestV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.dataContractId != null && message.hasOwnProperty("dataContractId")) + if (!(message.dataContractId && typeof message.dataContractId.length === "number" || $util.isString(message.dataContractId))) + return "dataContractId: buffer expected"; + if (message.documentType != null && message.hasOwnProperty("documentType")) + if (!$util.isString(message.documentType)) + return "documentType: string expected"; + if (message.where != null && message.hasOwnProperty("where")) + if (!(message.where && typeof message.where.length === "number" || $util.isString(message.where))) + return "where: buffer expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!(message.orderBy && typeof message.orderBy.length === "number" || $util.isString(message.orderBy))) + return "orderBy: buffer expected"; + if (message.limit != null && message.hasOwnProperty("limit")) + if (!$util.isInteger(message.limit)) + return "limit: integer expected"; + if (message.startAfter != null && message.hasOwnProperty("startAfter")) { + properties.start = 1; + if (!(message.startAfter && typeof message.startAfter.length === "number" || $util.isString(message.startAfter))) + return "startAfter: buffer expected"; + } + if (message.startAt != null && message.hasOwnProperty("startAt")) { + if (properties.start === 1) + return "start: multiple values"; + properties.start = 1; + if (!(message.startAt && typeof message.startAt.length === "number" || $util.isString(message.startAt))) + return "startAt: buffer expected"; + } + if (message.prove != null && message.hasOwnProperty("prove")) + if (typeof message.prove !== "boolean") + return "prove: boolean expected"; + return null; + }; + + /** + * Creates a GetDocumentsRequestV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0} GetDocumentsRequestV0 + */ + GetDocumentsRequestV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0(); + if (object.dataContractId != null) + if (typeof object.dataContractId === "string") + $util.base64.decode(object.dataContractId, message.dataContractId = $util.newBuffer($util.base64.length(object.dataContractId)), 0); + else if (object.dataContractId.length >= 0) + message.dataContractId = object.dataContractId; + if (object.documentType != null) + message.documentType = String(object.documentType); + if (object.where != null) + if (typeof object.where === "string") + $util.base64.decode(object.where, message.where = $util.newBuffer($util.base64.length(object.where)), 0); + else if (object.where.length >= 0) + message.where = object.where; + if (object.orderBy != null) + if (typeof object.orderBy === "string") + $util.base64.decode(object.orderBy, message.orderBy = $util.newBuffer($util.base64.length(object.orderBy)), 0); + else if (object.orderBy.length >= 0) + message.orderBy = object.orderBy; + if (object.limit != null) + message.limit = object.limit >>> 0; + if (object.startAfter != null) + if (typeof object.startAfter === "string") + $util.base64.decode(object.startAfter, message.startAfter = $util.newBuffer($util.base64.length(object.startAfter)), 0); + else if (object.startAfter.length >= 0) + message.startAfter = object.startAfter; + if (object.startAt != null) + if (typeof object.startAt === "string") + $util.base64.decode(object.startAt, message.startAt = $util.newBuffer($util.base64.length(object.startAt)), 0); + else if (object.startAt.length >= 0) + message.startAt = object.startAt; + if (object.prove != null) + message.prove = Boolean(object.prove); + return message; + }; + + /** + * Creates a plain object from a GetDocumentsRequestV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0} message GetDocumentsRequestV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetDocumentsRequestV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.dataContractId = ""; + else { + object.dataContractId = []; + if (options.bytes !== Array) + object.dataContractId = $util.newBuffer(object.dataContractId); + } + object.documentType = ""; + if (options.bytes === String) + object.where = ""; + else { + object.where = []; + if (options.bytes !== Array) + object.where = $util.newBuffer(object.where); + } + if (options.bytes === String) + object.orderBy = ""; + else { + object.orderBy = []; + if (options.bytes !== Array) + object.orderBy = $util.newBuffer(object.orderBy); + } + object.limit = 0; + object.prove = false; + } + if (message.dataContractId != null && message.hasOwnProperty("dataContractId")) + object.dataContractId = options.bytes === String ? $util.base64.encode(message.dataContractId, 0, message.dataContractId.length) : options.bytes === Array ? Array.prototype.slice.call(message.dataContractId) : message.dataContractId; + if (message.documentType != null && message.hasOwnProperty("documentType")) + object.documentType = message.documentType; + if (message.where != null && message.hasOwnProperty("where")) + object.where = options.bytes === String ? $util.base64.encode(message.where, 0, message.where.length) : options.bytes === Array ? Array.prototype.slice.call(message.where) : message.where; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = options.bytes === String ? $util.base64.encode(message.orderBy, 0, message.orderBy.length) : options.bytes === Array ? Array.prototype.slice.call(message.orderBy) : message.orderBy; + if (message.limit != null && message.hasOwnProperty("limit")) + object.limit = message.limit; + if (message.startAfter != null && message.hasOwnProperty("startAfter")) { + object.startAfter = options.bytes === String ? $util.base64.encode(message.startAfter, 0, message.startAfter.length) : options.bytes === Array ? Array.prototype.slice.call(message.startAfter) : message.startAfter; + if (options.oneofs) + object.start = "startAfter"; + } + if (message.startAt != null && message.hasOwnProperty("startAt")) { + object.startAt = options.bytes === String ? $util.base64.encode(message.startAt, 0, message.startAt.length) : options.bytes === Array ? Array.prototype.slice.call(message.startAt) : message.startAt; + if (options.oneofs) + object.start = "startAt"; + } + if (message.prove != null && message.hasOwnProperty("prove")) + object.prove = message.prove; + return object; + }; + + /** + * Converts this GetDocumentsRequestV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0 + * @instance + * @returns {Object.} JSON object + */ + GetDocumentsRequestV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetDocumentsRequestV0; + })(); + + return GetDocumentsRequest; + })(); + + v0.GetDocumentsResponse = (function() { + + /** + * Properties of a GetDocumentsResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetDocumentsResponse + * @property {org.dash.platform.dapi.v0.GetDocumentsResponse.IGetDocumentsResponseV0|null} [v0] GetDocumentsResponse v0 + */ + + /** + * Constructs a new GetDocumentsResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetDocumentsResponse. + * @implements IGetDocumentsResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IGetDocumentsResponse=} [properties] Properties to set + */ + function GetDocumentsResponse(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]]; + } + + /** + * GetDocumentsResponse v0. + * @member {org.dash.platform.dapi.v0.GetDocumentsResponse.IGetDocumentsResponseV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse + * @instance + */ + GetDocumentsResponse.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetDocumentsResponse version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse + * @instance + */ + Object.defineProperty(GetDocumentsResponse.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetDocumentsResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetDocumentsResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse} GetDocumentsResponse instance + */ + GetDocumentsResponse.create = function create(properties) { + return new GetDocumentsResponse(properties); + }; + + /** + * Encodes the specified GetDocumentsResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDocumentsResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetDocumentsResponse} message GetDocumentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDocumentsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetDocumentsResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDocumentsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetDocumentsResponse} message GetDocumentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDocumentsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetDocumentsResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse} GetDocumentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDocumentsResponse.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.org.dash.platform.dapi.v0.GetDocumentsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetDocumentsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse} GetDocumentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDocumentsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetDocumentsResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetDocumentsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetDocumentsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse} GetDocumentsResponse + */ + GetDocumentsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetDocumentsResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetDocumentsResponse(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetDocumentsResponse.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetDocumentsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse + * @static + * @param {org.dash.platform.dapi.v0.GetDocumentsResponse} message GetDocumentsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetDocumentsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetDocumentsResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse + * @instance + * @returns {Object.} JSON object + */ + GetDocumentsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetDocumentsResponse.GetDocumentsResponseV0 = (function() { + + /** + * Properties of a GetDocumentsResponseV0. + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse + * @interface IGetDocumentsResponseV0 + * @property {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.IDocuments|null} [documents] GetDocumentsResponseV0 documents + * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetDocumentsResponseV0 proof + * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetDocumentsResponseV0 metadata + */ + + /** + * Constructs a new GetDocumentsResponseV0. + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse + * @classdesc Represents a GetDocumentsResponseV0. + * @implements IGetDocumentsResponseV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.IGetDocumentsResponseV0=} [properties] Properties to set + */ + function GetDocumentsResponseV0(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]]; + } + + /** + * GetDocumentsResponseV0 documents. + * @member {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.IDocuments|null|undefined} documents + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 + * @instance + */ + GetDocumentsResponseV0.prototype.documents = null; + + /** + * GetDocumentsResponseV0 proof. + * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 + * @instance + */ + GetDocumentsResponseV0.prototype.proof = null; + + /** + * GetDocumentsResponseV0 metadata. + * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 + * @instance + */ + GetDocumentsResponseV0.prototype.metadata = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetDocumentsResponseV0 result. + * @member {"documents"|"proof"|undefined} result + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 + * @instance + */ + Object.defineProperty(GetDocumentsResponseV0.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["documents", "proof"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetDocumentsResponseV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.IGetDocumentsResponseV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0} GetDocumentsResponseV0 instance + */ + GetDocumentsResponseV0.create = function create(properties) { + return new GetDocumentsResponseV0(properties); + }; + + /** + * Encodes the specified GetDocumentsResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.IGetDocumentsResponseV0} message GetDocumentsResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDocumentsResponseV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.documents != null && Object.hasOwnProperty.call(message, "documents")) + $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.encode(message.documents, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetDocumentsResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.IGetDocumentsResponseV0} message GetDocumentsResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDocumentsResponseV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetDocumentsResponseV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0} GetDocumentsResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDocumentsResponseV0.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.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.documents = $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.decode(reader, reader.uint32()); + break; + case 2: + message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); + break; + case 3: + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetDocumentsResponseV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0} GetDocumentsResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDocumentsResponseV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetDocumentsResponseV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetDocumentsResponseV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.documents != null && message.hasOwnProperty("documents")) { + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.verify(message.documents); + if (error) + return "documents." + error; + } + } + if (message.proof != null && message.hasOwnProperty("proof")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); + if (error) + return "proof." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a GetDocumentsResponseV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0} GetDocumentsResponseV0 + */ + GetDocumentsResponseV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0(); + if (object.documents != null) { + if (typeof object.documents !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.documents: object expected"); + message.documents = $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.fromObject(object.documents); + } + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.proof: object expected"); + message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.metadata: object expected"); + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a GetDocumentsResponseV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0} message GetDocumentsResponseV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetDocumentsResponseV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.metadata = null; + if (message.documents != null && message.hasOwnProperty("documents")) { + object.documents = $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.toObject(message.documents, options); + if (options.oneofs) + object.result = "documents"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); + if (options.oneofs) + object.result = "proof"; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this GetDocumentsResponseV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 + * @instance + * @returns {Object.} JSON object + */ + GetDocumentsResponseV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetDocumentsResponseV0.Documents = (function() { + + /** + * Properties of a Documents. + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 + * @interface IDocuments + * @property {Array.|null} [documents] Documents documents + */ + + /** + * Constructs a new Documents. + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 + * @classdesc Represents a Documents. + * @implements IDocuments + * @constructor + * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.IDocuments=} [properties] Properties to set + */ + function Documents(properties) { + this.documents = []; + 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]]; + } + + /** + * Documents documents. + * @member {Array.} documents + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents + * @instance + */ + Documents.prototype.documents = $util.emptyArray; + + /** + * Creates a new Documents instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents + * @static + * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.IDocuments=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents} Documents instance + */ + Documents.create = function create(properties) { + return new Documents(properties); + }; + + /** + * Encodes the specified Documents message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents + * @static + * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.IDocuments} message Documents message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Documents.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.documents != null && message.documents.length) + for (var i = 0; i < message.documents.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.documents[i]); + return writer; + }; + + /** + * Encodes the specified Documents message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents + * @static + * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.IDocuments} message Documents message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Documents.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Documents message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents} Documents + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Documents.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.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.documents && message.documents.length)) + message.documents = []; + message.documents.push(reader.bytes()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Documents message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents} Documents + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Documents.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Documents message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Documents.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.documents != null && message.hasOwnProperty("documents")) { + if (!Array.isArray(message.documents)) + return "documents: array expected"; + for (var i = 0; i < message.documents.length; ++i) + if (!(message.documents[i] && typeof message.documents[i].length === "number" || $util.isString(message.documents[i]))) + return "documents: buffer[] expected"; + } + return null; + }; + + /** + * Creates a Documents message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents} Documents + */ + Documents.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents(); + if (object.documents) { + if (!Array.isArray(object.documents)) + throw TypeError(".org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.documents: array expected"); + message.documents = []; + for (var i = 0; i < object.documents.length; ++i) + if (typeof object.documents[i] === "string") + $util.base64.decode(object.documents[i], message.documents[i] = $util.newBuffer($util.base64.length(object.documents[i])), 0); + else if (object.documents[i].length >= 0) + message.documents[i] = object.documents[i]; + } + return message; + }; + + /** + * Creates a plain object from a Documents message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents + * @static + * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents} message Documents + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Documents.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.documents = []; + if (message.documents && message.documents.length) { + object.documents = []; + for (var j = 0; j < message.documents.length; ++j) + object.documents[j] = options.bytes === String ? $util.base64.encode(message.documents[j], 0, message.documents[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.documents[j]) : message.documents[j]; + } + return object; + }; + + /** + * Converts this Documents to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents + * @instance + * @returns {Object.} JSON object + */ + Documents.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Documents; + })(); + + return GetDocumentsResponseV0; + })(); + + return GetDocumentsResponse; + })(); + + v0.GetIdentityByPublicKeyHashRequest = (function() { + + /** + * Properties of a GetIdentityByPublicKeyHashRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetIdentityByPublicKeyHashRequest + * @property {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.IGetIdentityByPublicKeyHashRequestV0|null} [v0] GetIdentityByPublicKeyHashRequest v0 + */ + + /** + * Constructs a new GetIdentityByPublicKeyHashRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetIdentityByPublicKeyHashRequest. + * @implements IGetIdentityByPublicKeyHashRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IGetIdentityByPublicKeyHashRequest=} [properties] Properties to set + */ + function GetIdentityByPublicKeyHashRequest(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]]; + } + + /** + * GetIdentityByPublicKeyHashRequest v0. + * @member {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.IGetIdentityByPublicKeyHashRequestV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest + * @instance + */ + GetIdentityByPublicKeyHashRequest.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetIdentityByPublicKeyHashRequest version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest + * @instance + */ + Object.defineProperty(GetIdentityByPublicKeyHashRequest.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetIdentityByPublicKeyHashRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityByPublicKeyHashRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest} GetIdentityByPublicKeyHashRequest instance + */ + GetIdentityByPublicKeyHashRequest.create = function create(properties) { + return new GetIdentityByPublicKeyHashRequest(properties); + }; + + /** + * Encodes the specified GetIdentityByPublicKeyHashRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityByPublicKeyHashRequest} message GetIdentityByPublicKeyHashRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityByPublicKeyHashRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetIdentityByPublicKeyHashRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityByPublicKeyHashRequest} message GetIdentityByPublicKeyHashRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityByPublicKeyHashRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentityByPublicKeyHashRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest} GetIdentityByPublicKeyHashRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityByPublicKeyHashRequest.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.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentityByPublicKeyHashRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest} GetIdentityByPublicKeyHashRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityByPublicKeyHashRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentityByPublicKeyHashRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentityByPublicKeyHashRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetIdentityByPublicKeyHashRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest} GetIdentityByPublicKeyHashRequest + */ + GetIdentityByPublicKeyHashRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetIdentityByPublicKeyHashRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest} message GetIdentityByPublicKeyHashRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentityByPublicKeyHashRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetIdentityByPublicKeyHashRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest + * @instance + * @returns {Object.} JSON object + */ + GetIdentityByPublicKeyHashRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0 = (function() { + + /** + * Properties of a GetIdentityByPublicKeyHashRequestV0. + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest + * @interface IGetIdentityByPublicKeyHashRequestV0 + * @property {Uint8Array|null} [publicKeyHash] GetIdentityByPublicKeyHashRequestV0 publicKeyHash + * @property {boolean|null} [prove] GetIdentityByPublicKeyHashRequestV0 prove + */ + + /** + * Constructs a new GetIdentityByPublicKeyHashRequestV0. + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest + * @classdesc Represents a GetIdentityByPublicKeyHashRequestV0. + * @implements IGetIdentityByPublicKeyHashRequestV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.IGetIdentityByPublicKeyHashRequestV0=} [properties] Properties to set + */ + function GetIdentityByPublicKeyHashRequestV0(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]]; + } + + /** + * GetIdentityByPublicKeyHashRequestV0 publicKeyHash. + * @member {Uint8Array} publicKeyHash + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0 + * @instance + */ + GetIdentityByPublicKeyHashRequestV0.prototype.publicKeyHash = $util.newBuffer([]); + + /** + * GetIdentityByPublicKeyHashRequestV0 prove. + * @member {boolean} prove + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0 + * @instance + */ + GetIdentityByPublicKeyHashRequestV0.prototype.prove = false; + + /** + * Creates a new GetIdentityByPublicKeyHashRequestV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.IGetIdentityByPublicKeyHashRequestV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0} GetIdentityByPublicKeyHashRequestV0 instance + */ + GetIdentityByPublicKeyHashRequestV0.create = function create(properties) { + return new GetIdentityByPublicKeyHashRequestV0(properties); + }; + + /** + * Encodes the specified GetIdentityByPublicKeyHashRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.IGetIdentityByPublicKeyHashRequestV0} message GetIdentityByPublicKeyHashRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityByPublicKeyHashRequestV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.publicKeyHash != null && Object.hasOwnProperty.call(message, "publicKeyHash")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.publicKeyHash); + if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.prove); + return writer; + }; + + /** + * Encodes the specified GetIdentityByPublicKeyHashRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.IGetIdentityByPublicKeyHashRequestV0} message GetIdentityByPublicKeyHashRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityByPublicKeyHashRequestV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentityByPublicKeyHashRequestV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0} GetIdentityByPublicKeyHashRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityByPublicKeyHashRequestV0.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.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.publicKeyHash = reader.bytes(); + break; + case 2: + message.prove = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentityByPublicKeyHashRequestV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0} GetIdentityByPublicKeyHashRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityByPublicKeyHashRequestV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentityByPublicKeyHashRequestV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentityByPublicKeyHashRequestV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.publicKeyHash != null && message.hasOwnProperty("publicKeyHash")) + if (!(message.publicKeyHash && typeof message.publicKeyHash.length === "number" || $util.isString(message.publicKeyHash))) + return "publicKeyHash: buffer expected"; + if (message.prove != null && message.hasOwnProperty("prove")) + if (typeof message.prove !== "boolean") + return "prove: boolean expected"; + return null; + }; + + /** + * Creates a GetIdentityByPublicKeyHashRequestV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0} GetIdentityByPublicKeyHashRequestV0 + */ + GetIdentityByPublicKeyHashRequestV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0(); + if (object.publicKeyHash != null) + if (typeof object.publicKeyHash === "string") + $util.base64.decode(object.publicKeyHash, message.publicKeyHash = $util.newBuffer($util.base64.length(object.publicKeyHash)), 0); + else if (object.publicKeyHash.length >= 0) + message.publicKeyHash = object.publicKeyHash; + if (object.prove != null) + message.prove = Boolean(object.prove); + return message; + }; + + /** + * Creates a plain object from a GetIdentityByPublicKeyHashRequestV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0} message GetIdentityByPublicKeyHashRequestV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentityByPublicKeyHashRequestV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.publicKeyHash = ""; + else { + object.publicKeyHash = []; + if (options.bytes !== Array) + object.publicKeyHash = $util.newBuffer(object.publicKeyHash); + } + object.prove = false; + } + if (message.publicKeyHash != null && message.hasOwnProperty("publicKeyHash")) + object.publicKeyHash = options.bytes === String ? $util.base64.encode(message.publicKeyHash, 0, message.publicKeyHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.publicKeyHash) : message.publicKeyHash; + if (message.prove != null && message.hasOwnProperty("prove")) + object.prove = message.prove; + return object; + }; + + /** + * Converts this GetIdentityByPublicKeyHashRequestV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0 + * @instance + * @returns {Object.} JSON object + */ + GetIdentityByPublicKeyHashRequestV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetIdentityByPublicKeyHashRequestV0; + })(); + + return GetIdentityByPublicKeyHashRequest; + })(); + + v0.GetIdentityByPublicKeyHashResponse = (function() { + + /** + * Properties of a GetIdentityByPublicKeyHashResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetIdentityByPublicKeyHashResponse + * @property {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.IGetIdentityByPublicKeyHashResponseV0|null} [v0] GetIdentityByPublicKeyHashResponse v0 + */ + + /** + * Constructs a new GetIdentityByPublicKeyHashResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetIdentityByPublicKeyHashResponse. + * @implements IGetIdentityByPublicKeyHashResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IGetIdentityByPublicKeyHashResponse=} [properties] Properties to set + */ + function GetIdentityByPublicKeyHashResponse(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]]; + } + + /** + * GetIdentityByPublicKeyHashResponse v0. + * @member {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.IGetIdentityByPublicKeyHashResponseV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse + * @instance + */ + GetIdentityByPublicKeyHashResponse.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetIdentityByPublicKeyHashResponse version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse + * @instance + */ + Object.defineProperty(GetIdentityByPublicKeyHashResponse.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetIdentityByPublicKeyHashResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityByPublicKeyHashResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse} GetIdentityByPublicKeyHashResponse instance + */ + GetIdentityByPublicKeyHashResponse.create = function create(properties) { + return new GetIdentityByPublicKeyHashResponse(properties); + }; + + /** + * Encodes the specified GetIdentityByPublicKeyHashResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityByPublicKeyHashResponse} message GetIdentityByPublicKeyHashResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityByPublicKeyHashResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetIdentityByPublicKeyHashResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityByPublicKeyHashResponse} message GetIdentityByPublicKeyHashResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityByPublicKeyHashResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentityByPublicKeyHashResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse} GetIdentityByPublicKeyHashResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityByPublicKeyHashResponse.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.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentityByPublicKeyHashResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse} GetIdentityByPublicKeyHashResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityByPublicKeyHashResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentityByPublicKeyHashResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentityByPublicKeyHashResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetIdentityByPublicKeyHashResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse} GetIdentityByPublicKeyHashResponse + */ + GetIdentityByPublicKeyHashResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetIdentityByPublicKeyHashResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse} message GetIdentityByPublicKeyHashResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentityByPublicKeyHashResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetIdentityByPublicKeyHashResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse + * @instance + * @returns {Object.} JSON object + */ + GetIdentityByPublicKeyHashResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0 = (function() { + + /** + * Properties of a GetIdentityByPublicKeyHashResponseV0. + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse + * @interface IGetIdentityByPublicKeyHashResponseV0 + * @property {Uint8Array|null} [identity] GetIdentityByPublicKeyHashResponseV0 identity + * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetIdentityByPublicKeyHashResponseV0 proof + * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetIdentityByPublicKeyHashResponseV0 metadata + */ + + /** + * Constructs a new GetIdentityByPublicKeyHashResponseV0. + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse + * @classdesc Represents a GetIdentityByPublicKeyHashResponseV0. + * @implements IGetIdentityByPublicKeyHashResponseV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.IGetIdentityByPublicKeyHashResponseV0=} [properties] Properties to set + */ + function GetIdentityByPublicKeyHashResponseV0(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]]; + } + + /** + * GetIdentityByPublicKeyHashResponseV0 identity. + * @member {Uint8Array} identity + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0 + * @instance + */ + GetIdentityByPublicKeyHashResponseV0.prototype.identity = $util.newBuffer([]); + + /** + * GetIdentityByPublicKeyHashResponseV0 proof. + * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0 + * @instance + */ + GetIdentityByPublicKeyHashResponseV0.prototype.proof = null; + + /** + * GetIdentityByPublicKeyHashResponseV0 metadata. + * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0 + * @instance + */ + GetIdentityByPublicKeyHashResponseV0.prototype.metadata = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetIdentityByPublicKeyHashResponseV0 result. + * @member {"identity"|"proof"|undefined} result + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0 + * @instance + */ + Object.defineProperty(GetIdentityByPublicKeyHashResponseV0.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["identity", "proof"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetIdentityByPublicKeyHashResponseV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.IGetIdentityByPublicKeyHashResponseV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0} GetIdentityByPublicKeyHashResponseV0 instance + */ + GetIdentityByPublicKeyHashResponseV0.create = function create(properties) { + return new GetIdentityByPublicKeyHashResponseV0(properties); + }; + + /** + * Encodes the specified GetIdentityByPublicKeyHashResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.IGetIdentityByPublicKeyHashResponseV0} message GetIdentityByPublicKeyHashResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityByPublicKeyHashResponseV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.identity != null && Object.hasOwnProperty.call(message, "identity")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.identity); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetIdentityByPublicKeyHashResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.IGetIdentityByPublicKeyHashResponseV0} message GetIdentityByPublicKeyHashResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityByPublicKeyHashResponseV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentityByPublicKeyHashResponseV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0} GetIdentityByPublicKeyHashResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityByPublicKeyHashResponseV0.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.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.identity = reader.bytes(); + break; + case 2: + message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); + break; + case 3: + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentityByPublicKeyHashResponseV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0} GetIdentityByPublicKeyHashResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityByPublicKeyHashResponseV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentityByPublicKeyHashResponseV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentityByPublicKeyHashResponseV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.identity != null && message.hasOwnProperty("identity")) { + properties.result = 1; + if (!(message.identity && typeof message.identity.length === "number" || $util.isString(message.identity))) + return "identity: buffer expected"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); + if (error) + return "proof." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a GetIdentityByPublicKeyHashResponseV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0} GetIdentityByPublicKeyHashResponseV0 + */ + GetIdentityByPublicKeyHashResponseV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0(); + if (object.identity != null) + if (typeof object.identity === "string") + $util.base64.decode(object.identity, message.identity = $util.newBuffer($util.base64.length(object.identity)), 0); + else if (object.identity.length >= 0) + message.identity = object.identity; + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0.proof: object expected"); + message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0.metadata: object expected"); + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a GetIdentityByPublicKeyHashResponseV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0} message GetIdentityByPublicKeyHashResponseV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentityByPublicKeyHashResponseV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.metadata = null; + if (message.identity != null && message.hasOwnProperty("identity")) { + object.identity = options.bytes === String ? $util.base64.encode(message.identity, 0, message.identity.length) : options.bytes === Array ? Array.prototype.slice.call(message.identity) : message.identity; + if (options.oneofs) + object.result = "identity"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); + if (options.oneofs) + object.result = "proof"; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this GetIdentityByPublicKeyHashResponseV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0 + * @instance + * @returns {Object.} JSON object + */ + GetIdentityByPublicKeyHashResponseV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetIdentityByPublicKeyHashResponseV0; + })(); + + return GetIdentityByPublicKeyHashResponse; + })(); + + v0.WaitForStateTransitionResultRequest = (function() { + + /** + * Properties of a WaitForStateTransitionResultRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IWaitForStateTransitionResultRequest + * @property {org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.IWaitForStateTransitionResultRequestV0|null} [v0] WaitForStateTransitionResultRequest v0 + */ + + /** + * Constructs a new WaitForStateTransitionResultRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a WaitForStateTransitionResultRequest. + * @implements IWaitForStateTransitionResultRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IWaitForStateTransitionResultRequest=} [properties] Properties to set + */ + function WaitForStateTransitionResultRequest(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]]; + } + + /** + * WaitForStateTransitionResultRequest v0. + * @member {org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.IWaitForStateTransitionResultRequestV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest + * @instance + */ + WaitForStateTransitionResultRequest.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * WaitForStateTransitionResultRequest version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest + * @instance + */ + Object.defineProperty(WaitForStateTransitionResultRequest.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new WaitForStateTransitionResultRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest + * @static + * @param {org.dash.platform.dapi.v0.IWaitForStateTransitionResultRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest} WaitForStateTransitionResultRequest instance + */ + WaitForStateTransitionResultRequest.create = function create(properties) { + return new WaitForStateTransitionResultRequest(properties); + }; + + /** + * Encodes the specified WaitForStateTransitionResultRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest + * @static + * @param {org.dash.platform.dapi.v0.IWaitForStateTransitionResultRequest} message WaitForStateTransitionResultRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WaitForStateTransitionResultRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified WaitForStateTransitionResultRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest + * @static + * @param {org.dash.platform.dapi.v0.IWaitForStateTransitionResultRequest} message WaitForStateTransitionResultRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WaitForStateTransitionResultRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WaitForStateTransitionResultRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest} WaitForStateTransitionResultRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WaitForStateTransitionResultRequest.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.org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WaitForStateTransitionResultRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest} WaitForStateTransitionResultRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WaitForStateTransitionResultRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WaitForStateTransitionResultRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WaitForStateTransitionResultRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a WaitForStateTransitionResultRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest} WaitForStateTransitionResultRequest + */ + WaitForStateTransitionResultRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a WaitForStateTransitionResultRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest + * @static + * @param {org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest} message WaitForStateTransitionResultRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WaitForStateTransitionResultRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this WaitForStateTransitionResultRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest + * @instance + * @returns {Object.} JSON object + */ + WaitForStateTransitionResultRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0 = (function() { + + /** + * Properties of a WaitForStateTransitionResultRequestV0. + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest + * @interface IWaitForStateTransitionResultRequestV0 + * @property {Uint8Array|null} [stateTransitionHash] WaitForStateTransitionResultRequestV0 stateTransitionHash + * @property {boolean|null} [prove] WaitForStateTransitionResultRequestV0 prove + */ + + /** + * Constructs a new WaitForStateTransitionResultRequestV0. + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest + * @classdesc Represents a WaitForStateTransitionResultRequestV0. + * @implements IWaitForStateTransitionResultRequestV0 + * @constructor + * @param {org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.IWaitForStateTransitionResultRequestV0=} [properties] Properties to set + */ + function WaitForStateTransitionResultRequestV0(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]]; + } + + /** + * WaitForStateTransitionResultRequestV0 stateTransitionHash. + * @member {Uint8Array} stateTransitionHash + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0 + * @instance + */ + WaitForStateTransitionResultRequestV0.prototype.stateTransitionHash = $util.newBuffer([]); + + /** + * WaitForStateTransitionResultRequestV0 prove. + * @member {boolean} prove + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0 + * @instance + */ + WaitForStateTransitionResultRequestV0.prototype.prove = false; + + /** + * Creates a new WaitForStateTransitionResultRequestV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.IWaitForStateTransitionResultRequestV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0} WaitForStateTransitionResultRequestV0 instance + */ + WaitForStateTransitionResultRequestV0.create = function create(properties) { + return new WaitForStateTransitionResultRequestV0(properties); + }; + + /** + * Encodes the specified WaitForStateTransitionResultRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.IWaitForStateTransitionResultRequestV0} message WaitForStateTransitionResultRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WaitForStateTransitionResultRequestV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.stateTransitionHash != null && Object.hasOwnProperty.call(message, "stateTransitionHash")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.stateTransitionHash); + if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.prove); + return writer; + }; + + /** + * Encodes the specified WaitForStateTransitionResultRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.IWaitForStateTransitionResultRequestV0} message WaitForStateTransitionResultRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WaitForStateTransitionResultRequestV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WaitForStateTransitionResultRequestV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0} WaitForStateTransitionResultRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WaitForStateTransitionResultRequestV0.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.org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.stateTransitionHash = reader.bytes(); + break; + case 2: + message.prove = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WaitForStateTransitionResultRequestV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0} WaitForStateTransitionResultRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WaitForStateTransitionResultRequestV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WaitForStateTransitionResultRequestV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WaitForStateTransitionResultRequestV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.stateTransitionHash != null && message.hasOwnProperty("stateTransitionHash")) + if (!(message.stateTransitionHash && typeof message.stateTransitionHash.length === "number" || $util.isString(message.stateTransitionHash))) + return "stateTransitionHash: buffer expected"; + if (message.prove != null && message.hasOwnProperty("prove")) + if (typeof message.prove !== "boolean") + return "prove: boolean expected"; + return null; + }; + + /** + * Creates a WaitForStateTransitionResultRequestV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0} WaitForStateTransitionResultRequestV0 + */ + WaitForStateTransitionResultRequestV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0(); + if (object.stateTransitionHash != null) + if (typeof object.stateTransitionHash === "string") + $util.base64.decode(object.stateTransitionHash, message.stateTransitionHash = $util.newBuffer($util.base64.length(object.stateTransitionHash)), 0); + else if (object.stateTransitionHash.length >= 0) + message.stateTransitionHash = object.stateTransitionHash; + if (object.prove != null) + message.prove = Boolean(object.prove); + return message; + }; + + /** + * Creates a plain object from a WaitForStateTransitionResultRequestV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0} message WaitForStateTransitionResultRequestV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WaitForStateTransitionResultRequestV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.stateTransitionHash = ""; + else { + object.stateTransitionHash = []; + if (options.bytes !== Array) + object.stateTransitionHash = $util.newBuffer(object.stateTransitionHash); + } + object.prove = false; + } + if (message.stateTransitionHash != null && message.hasOwnProperty("stateTransitionHash")) + object.stateTransitionHash = options.bytes === String ? $util.base64.encode(message.stateTransitionHash, 0, message.stateTransitionHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.stateTransitionHash) : message.stateTransitionHash; + if (message.prove != null && message.hasOwnProperty("prove")) + object.prove = message.prove; + return object; + }; + + /** + * Converts this WaitForStateTransitionResultRequestV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0 + * @instance + * @returns {Object.} JSON object + */ + WaitForStateTransitionResultRequestV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return WaitForStateTransitionResultRequestV0; + })(); + + return WaitForStateTransitionResultRequest; + })(); + + v0.WaitForStateTransitionResultResponse = (function() { + + /** + * Properties of a WaitForStateTransitionResultResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IWaitForStateTransitionResultResponse + * @property {org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.IWaitForStateTransitionResultResponseV0|null} [v0] WaitForStateTransitionResultResponse v0 + */ + + /** + * Constructs a new WaitForStateTransitionResultResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a WaitForStateTransitionResultResponse. + * @implements IWaitForStateTransitionResultResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IWaitForStateTransitionResultResponse=} [properties] Properties to set + */ + function WaitForStateTransitionResultResponse(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]]; + } + + /** + * WaitForStateTransitionResultResponse v0. + * @member {org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.IWaitForStateTransitionResultResponseV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse + * @instance + */ + WaitForStateTransitionResultResponse.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * WaitForStateTransitionResultResponse version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse + * @instance + */ + Object.defineProperty(WaitForStateTransitionResultResponse.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new WaitForStateTransitionResultResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse + * @static + * @param {org.dash.platform.dapi.v0.IWaitForStateTransitionResultResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse} WaitForStateTransitionResultResponse instance + */ + WaitForStateTransitionResultResponse.create = function create(properties) { + return new WaitForStateTransitionResultResponse(properties); + }; + + /** + * Encodes the specified WaitForStateTransitionResultResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse + * @static + * @param {org.dash.platform.dapi.v0.IWaitForStateTransitionResultResponse} message WaitForStateTransitionResultResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WaitForStateTransitionResultResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified WaitForStateTransitionResultResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse + * @static + * @param {org.dash.platform.dapi.v0.IWaitForStateTransitionResultResponse} message WaitForStateTransitionResultResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WaitForStateTransitionResultResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WaitForStateTransitionResultResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse} WaitForStateTransitionResultResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WaitForStateTransitionResultResponse.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.org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WaitForStateTransitionResultResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse} WaitForStateTransitionResultResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WaitForStateTransitionResultResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WaitForStateTransitionResultResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WaitForStateTransitionResultResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a WaitForStateTransitionResultResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse} WaitForStateTransitionResultResponse + */ + WaitForStateTransitionResultResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a WaitForStateTransitionResultResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse + * @static + * @param {org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse} message WaitForStateTransitionResultResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WaitForStateTransitionResultResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this WaitForStateTransitionResultResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse + * @instance + * @returns {Object.} JSON object + */ + WaitForStateTransitionResultResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0 = (function() { + + /** + * Properties of a WaitForStateTransitionResultResponseV0. + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse + * @interface IWaitForStateTransitionResultResponseV0 + * @property {org.dash.platform.dapi.v0.IStateTransitionBroadcastError|null} [error] WaitForStateTransitionResultResponseV0 error + * @property {org.dash.platform.dapi.v0.IProof|null} [proof] WaitForStateTransitionResultResponseV0 proof + * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] WaitForStateTransitionResultResponseV0 metadata + */ + + /** + * Constructs a new WaitForStateTransitionResultResponseV0. + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse + * @classdesc Represents a WaitForStateTransitionResultResponseV0. + * @implements IWaitForStateTransitionResultResponseV0 + * @constructor + * @param {org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.IWaitForStateTransitionResultResponseV0=} [properties] Properties to set + */ + function WaitForStateTransitionResultResponseV0(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]]; + } + + /** + * WaitForStateTransitionResultResponseV0 error. + * @member {org.dash.platform.dapi.v0.IStateTransitionBroadcastError|null|undefined} error + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0 + * @instance + */ + WaitForStateTransitionResultResponseV0.prototype.error = null; + + /** + * WaitForStateTransitionResultResponseV0 proof. + * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0 + * @instance + */ + WaitForStateTransitionResultResponseV0.prototype.proof = null; + + /** + * WaitForStateTransitionResultResponseV0 metadata. + * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0 + * @instance + */ + WaitForStateTransitionResultResponseV0.prototype.metadata = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * WaitForStateTransitionResultResponseV0 result. + * @member {"error"|"proof"|undefined} result + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0 + * @instance + */ + Object.defineProperty(WaitForStateTransitionResultResponseV0.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["error", "proof"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new WaitForStateTransitionResultResponseV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.IWaitForStateTransitionResultResponseV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0} WaitForStateTransitionResultResponseV0 instance + */ + WaitForStateTransitionResultResponseV0.create = function create(properties) { + return new WaitForStateTransitionResultResponseV0(properties); + }; + + /** + * Encodes the specified WaitForStateTransitionResultResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.IWaitForStateTransitionResultResponseV0} message WaitForStateTransitionResultResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WaitForStateTransitionResultResponseV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.error != null && Object.hasOwnProperty.call(message, "error")) + $root.org.dash.platform.dapi.v0.StateTransitionBroadcastError.encode(message.error, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified WaitForStateTransitionResultResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.IWaitForStateTransitionResultResponseV0} message WaitForStateTransitionResultResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WaitForStateTransitionResultResponseV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WaitForStateTransitionResultResponseV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0} WaitForStateTransitionResultResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WaitForStateTransitionResultResponseV0.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.org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.error = $root.org.dash.platform.dapi.v0.StateTransitionBroadcastError.decode(reader, reader.uint32()); + break; + case 2: + message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); + break; + case 3: + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WaitForStateTransitionResultResponseV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0} WaitForStateTransitionResultResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WaitForStateTransitionResultResponseV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WaitForStateTransitionResultResponseV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WaitForStateTransitionResultResponseV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.error != null && message.hasOwnProperty("error")) { + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.StateTransitionBroadcastError.verify(message.error); + if (error) + return "error." + error; + } + } + if (message.proof != null && message.hasOwnProperty("proof")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); + if (error) + return "proof." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a WaitForStateTransitionResultResponseV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0} WaitForStateTransitionResultResponseV0 + */ + WaitForStateTransitionResultResponseV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0(); + if (object.error != null) { + if (typeof object.error !== "object") + throw TypeError(".org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0.error: object expected"); + message.error = $root.org.dash.platform.dapi.v0.StateTransitionBroadcastError.fromObject(object.error); + } + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0.proof: object expected"); + message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0.metadata: object expected"); + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a WaitForStateTransitionResultResponseV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0} message WaitForStateTransitionResultResponseV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WaitForStateTransitionResultResponseV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.metadata = null; + if (message.error != null && message.hasOwnProperty("error")) { + object.error = $root.org.dash.platform.dapi.v0.StateTransitionBroadcastError.toObject(message.error, options); + if (options.oneofs) + object.result = "error"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); + if (options.oneofs) + object.result = "proof"; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this WaitForStateTransitionResultResponseV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0 + * @instance + * @returns {Object.} JSON object + */ + WaitForStateTransitionResultResponseV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return WaitForStateTransitionResultResponseV0; + })(); + + return WaitForStateTransitionResultResponse; + })(); + + v0.GetConsensusParamsRequest = (function() { + + /** + * Properties of a GetConsensusParamsRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetConsensusParamsRequest + * @property {org.dash.platform.dapi.v0.GetConsensusParamsRequest.IGetConsensusParamsRequestV0|null} [v0] GetConsensusParamsRequest v0 + */ + + /** + * Constructs a new GetConsensusParamsRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetConsensusParamsRequest. + * @implements IGetConsensusParamsRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IGetConsensusParamsRequest=} [properties] Properties to set + */ + function GetConsensusParamsRequest(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]]; + } + + /** + * GetConsensusParamsRequest v0. + * @member {org.dash.platform.dapi.v0.GetConsensusParamsRequest.IGetConsensusParamsRequestV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest + * @instance + */ + GetConsensusParamsRequest.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetConsensusParamsRequest version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest + * @instance + */ + Object.defineProperty(GetConsensusParamsRequest.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetConsensusParamsRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetConsensusParamsRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetConsensusParamsRequest} GetConsensusParamsRequest instance + */ + GetConsensusParamsRequest.create = function create(properties) { + return new GetConsensusParamsRequest(properties); + }; + + /** + * Encodes the specified GetConsensusParamsRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetConsensusParamsRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetConsensusParamsRequest} message GetConsensusParamsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetConsensusParamsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetConsensusParamsRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetConsensusParamsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetConsensusParamsRequest} message GetConsensusParamsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetConsensusParamsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetConsensusParamsRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetConsensusParamsRequest} GetConsensusParamsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetConsensusParamsRequest.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.org.dash.platform.dapi.v0.GetConsensusParamsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetConsensusParamsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetConsensusParamsRequest} GetConsensusParamsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetConsensusParamsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetConsensusParamsRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetConsensusParamsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetConsensusParamsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetConsensusParamsRequest} GetConsensusParamsRequest + */ + GetConsensusParamsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetConsensusParamsRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetConsensusParamsRequest(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetConsensusParamsRequest.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetConsensusParamsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest + * @static + * @param {org.dash.platform.dapi.v0.GetConsensusParamsRequest} message GetConsensusParamsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetConsensusParamsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetConsensusParamsRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest + * @instance + * @returns {Object.} JSON object + */ + GetConsensusParamsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetConsensusParamsRequest.GetConsensusParamsRequestV0 = (function() { + + /** + * Properties of a GetConsensusParamsRequestV0. + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest + * @interface IGetConsensusParamsRequestV0 + * @property {number|null} [height] GetConsensusParamsRequestV0 height + * @property {boolean|null} [prove] GetConsensusParamsRequestV0 prove + */ + + /** + * Constructs a new GetConsensusParamsRequestV0. + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest + * @classdesc Represents a GetConsensusParamsRequestV0. + * @implements IGetConsensusParamsRequestV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetConsensusParamsRequest.IGetConsensusParamsRequestV0=} [properties] Properties to set + */ + function GetConsensusParamsRequestV0(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]]; + } + + /** + * GetConsensusParamsRequestV0 height. + * @member {number} height + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0 + * @instance + */ + GetConsensusParamsRequestV0.prototype.height = 0; + + /** + * GetConsensusParamsRequestV0 prove. + * @member {boolean} prove + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0 + * @instance + */ + GetConsensusParamsRequestV0.prototype.prove = false; + + /** + * Creates a new GetConsensusParamsRequestV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetConsensusParamsRequest.IGetConsensusParamsRequestV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0} GetConsensusParamsRequestV0 instance + */ + GetConsensusParamsRequestV0.create = function create(properties) { + return new GetConsensusParamsRequestV0(properties); + }; + + /** + * Encodes the specified GetConsensusParamsRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetConsensusParamsRequest.IGetConsensusParamsRequestV0} message GetConsensusParamsRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetConsensusParamsRequestV0.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).int32(message.height); + if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.prove); + return writer; + }; + + /** + * Encodes the specified GetConsensusParamsRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetConsensusParamsRequest.IGetConsensusParamsRequestV0} message GetConsensusParamsRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetConsensusParamsRequestV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetConsensusParamsRequestV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0} GetConsensusParamsRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetConsensusParamsRequestV0.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.org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.height = reader.int32(); + break; + case 2: + message.prove = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetConsensusParamsRequestV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0} GetConsensusParamsRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetConsensusParamsRequestV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetConsensusParamsRequestV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetConsensusParamsRequestV0.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)) + return "height: integer expected"; + if (message.prove != null && message.hasOwnProperty("prove")) + if (typeof message.prove !== "boolean") + return "prove: boolean expected"; + return null; + }; + + /** + * Creates a GetConsensusParamsRequestV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0} GetConsensusParamsRequestV0 + */ + GetConsensusParamsRequestV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0(); + if (object.height != null) + message.height = object.height | 0; + if (object.prove != null) + message.prove = Boolean(object.prove); + return message; + }; + + /** + * Creates a plain object from a GetConsensusParamsRequestV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0} message GetConsensusParamsRequestV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetConsensusParamsRequestV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.height = 0; + object.prove = false; + } + if (message.height != null && message.hasOwnProperty("height")) + object.height = message.height; + if (message.prove != null && message.hasOwnProperty("prove")) + object.prove = message.prove; + return object; + }; + + /** + * Converts this GetConsensusParamsRequestV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0 + * @instance + * @returns {Object.} JSON object + */ + GetConsensusParamsRequestV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetConsensusParamsRequestV0; + })(); + + return GetConsensusParamsRequest; + })(); + + v0.GetConsensusParamsResponse = (function() { + + /** + * Properties of a GetConsensusParamsResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetConsensusParamsResponse + * @property {org.dash.platform.dapi.v0.GetConsensusParamsResponse.IGetConsensusParamsResponseV0|null} [v0] GetConsensusParamsResponse v0 + */ + + /** + * Constructs a new GetConsensusParamsResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetConsensusParamsResponse. + * @implements IGetConsensusParamsResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IGetConsensusParamsResponse=} [properties] Properties to set + */ + function GetConsensusParamsResponse(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]]; + } + + /** + * GetConsensusParamsResponse v0. + * @member {org.dash.platform.dapi.v0.GetConsensusParamsResponse.IGetConsensusParamsResponseV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse + * @instance + */ + GetConsensusParamsResponse.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetConsensusParamsResponse version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse + * @instance + */ + Object.defineProperty(GetConsensusParamsResponse.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetConsensusParamsResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetConsensusParamsResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetConsensusParamsResponse} GetConsensusParamsResponse instance + */ + GetConsensusParamsResponse.create = function create(properties) { + return new GetConsensusParamsResponse(properties); + }; + + /** + * Encodes the specified GetConsensusParamsResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetConsensusParamsResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetConsensusParamsResponse} message GetConsensusParamsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetConsensusParamsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetConsensusParamsResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetConsensusParamsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetConsensusParamsResponse} message GetConsensusParamsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetConsensusParamsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetConsensusParamsResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetConsensusParamsResponse} GetConsensusParamsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetConsensusParamsResponse.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.org.dash.platform.dapi.v0.GetConsensusParamsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetConsensusParamsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetConsensusParamsResponse} GetConsensusParamsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetConsensusParamsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetConsensusParamsResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetConsensusParamsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetConsensusParamsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetConsensusParamsResponse} GetConsensusParamsResponse + */ + GetConsensusParamsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetConsensusParamsResponse.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetConsensusParamsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse + * @static + * @param {org.dash.platform.dapi.v0.GetConsensusParamsResponse} message GetConsensusParamsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetConsensusParamsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetConsensusParamsResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse + * @instance + * @returns {Object.} JSON object + */ + GetConsensusParamsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetConsensusParamsResponse.ConsensusParamsBlock = (function() { + + /** + * Properties of a ConsensusParamsBlock. + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse + * @interface IConsensusParamsBlock + * @property {string|null} [maxBytes] ConsensusParamsBlock maxBytes + * @property {string|null} [maxGas] ConsensusParamsBlock maxGas + * @property {string|null} [timeIotaMs] ConsensusParamsBlock timeIotaMs + */ + + /** + * Constructs a new ConsensusParamsBlock. + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse + * @classdesc Represents a ConsensusParamsBlock. + * @implements IConsensusParamsBlock + * @constructor + * @param {org.dash.platform.dapi.v0.GetConsensusParamsResponse.IConsensusParamsBlock=} [properties] Properties to set + */ + function ConsensusParamsBlock(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]]; + } + + /** + * ConsensusParamsBlock maxBytes. + * @member {string} maxBytes + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock + * @instance + */ + ConsensusParamsBlock.prototype.maxBytes = ""; + + /** + * ConsensusParamsBlock maxGas. + * @member {string} maxGas + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock + * @instance + */ + ConsensusParamsBlock.prototype.maxGas = ""; + + /** + * ConsensusParamsBlock timeIotaMs. + * @member {string} timeIotaMs + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock + * @instance + */ + ConsensusParamsBlock.prototype.timeIotaMs = ""; + + /** + * Creates a new ConsensusParamsBlock instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock + * @static + * @param {org.dash.platform.dapi.v0.GetConsensusParamsResponse.IConsensusParamsBlock=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock} ConsensusParamsBlock instance + */ + ConsensusParamsBlock.create = function create(properties) { + return new ConsensusParamsBlock(properties); + }; + + /** + * Encodes the specified ConsensusParamsBlock message. Does not implicitly {@link org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock + * @static + * @param {org.dash.platform.dapi.v0.GetConsensusParamsResponse.IConsensusParamsBlock} message ConsensusParamsBlock message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConsensusParamsBlock.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.maxBytes != null && Object.hasOwnProperty.call(message, "maxBytes")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.maxBytes); + if (message.maxGas != null && Object.hasOwnProperty.call(message, "maxGas")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.maxGas); + if (message.timeIotaMs != null && Object.hasOwnProperty.call(message, "timeIotaMs")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.timeIotaMs); + return writer; + }; + + /** + * Encodes the specified ConsensusParamsBlock message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock + * @static + * @param {org.dash.platform.dapi.v0.GetConsensusParamsResponse.IConsensusParamsBlock} message ConsensusParamsBlock message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConsensusParamsBlock.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConsensusParamsBlock message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock} ConsensusParamsBlock + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConsensusParamsBlock.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.org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.maxBytes = reader.string(); + break; + case 2: + message.maxGas = reader.string(); + break; + case 3: + message.timeIotaMs = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ConsensusParamsBlock message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock} ConsensusParamsBlock + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConsensusParamsBlock.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConsensusParamsBlock message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConsensusParamsBlock.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.maxBytes != null && message.hasOwnProperty("maxBytes")) + if (!$util.isString(message.maxBytes)) + return "maxBytes: string expected"; + if (message.maxGas != null && message.hasOwnProperty("maxGas")) + if (!$util.isString(message.maxGas)) + return "maxGas: string expected"; + if (message.timeIotaMs != null && message.hasOwnProperty("timeIotaMs")) + if (!$util.isString(message.timeIotaMs)) + return "timeIotaMs: string expected"; + return null; + }; + + /** + * Creates a ConsensusParamsBlock message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock} ConsensusParamsBlock + */ + ConsensusParamsBlock.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock(); + if (object.maxBytes != null) + message.maxBytes = String(object.maxBytes); + if (object.maxGas != null) + message.maxGas = String(object.maxGas); + if (object.timeIotaMs != null) + message.timeIotaMs = String(object.timeIotaMs); + return message; + }; + + /** + * Creates a plain object from a ConsensusParamsBlock message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock + * @static + * @param {org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock} message ConsensusParamsBlock + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConsensusParamsBlock.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.maxBytes = ""; + object.maxGas = ""; + object.timeIotaMs = ""; + } + if (message.maxBytes != null && message.hasOwnProperty("maxBytes")) + object.maxBytes = message.maxBytes; + if (message.maxGas != null && message.hasOwnProperty("maxGas")) + object.maxGas = message.maxGas; + if (message.timeIotaMs != null && message.hasOwnProperty("timeIotaMs")) + object.timeIotaMs = message.timeIotaMs; + return object; + }; + + /** + * Converts this ConsensusParamsBlock to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock + * @instance + * @returns {Object.} JSON object + */ + ConsensusParamsBlock.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ConsensusParamsBlock; + })(); + + GetConsensusParamsResponse.ConsensusParamsEvidence = (function() { + + /** + * Properties of a ConsensusParamsEvidence. + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse + * @interface IConsensusParamsEvidence + * @property {string|null} [maxAgeNumBlocks] ConsensusParamsEvidence maxAgeNumBlocks + * @property {string|null} [maxAgeDuration] ConsensusParamsEvidence maxAgeDuration + * @property {string|null} [maxBytes] ConsensusParamsEvidence maxBytes + */ + + /** + * Constructs a new ConsensusParamsEvidence. + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse + * @classdesc Represents a ConsensusParamsEvidence. + * @implements IConsensusParamsEvidence + * @constructor + * @param {org.dash.platform.dapi.v0.GetConsensusParamsResponse.IConsensusParamsEvidence=} [properties] Properties to set + */ + function ConsensusParamsEvidence(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]]; + } + + /** + * ConsensusParamsEvidence maxAgeNumBlocks. + * @member {string} maxAgeNumBlocks + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidence + * @instance + */ + ConsensusParamsEvidence.prototype.maxAgeNumBlocks = ""; + + /** + * ConsensusParamsEvidence maxAgeDuration. + * @member {string} maxAgeDuration + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidence + * @instance + */ + ConsensusParamsEvidence.prototype.maxAgeDuration = ""; + + /** + * ConsensusParamsEvidence maxBytes. + * @member {string} maxBytes + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidence + * @instance + */ + ConsensusParamsEvidence.prototype.maxBytes = ""; + + /** + * Creates a new ConsensusParamsEvidence instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidence + * @static + * @param {org.dash.platform.dapi.v0.GetConsensusParamsResponse.IConsensusParamsEvidence=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidence} ConsensusParamsEvidence instance + */ + ConsensusParamsEvidence.create = function create(properties) { + return new ConsensusParamsEvidence(properties); + }; + + /** + * Encodes the specified ConsensusParamsEvidence message. Does not implicitly {@link org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidence.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidence + * @static + * @param {org.dash.platform.dapi.v0.GetConsensusParamsResponse.IConsensusParamsEvidence} message ConsensusParamsEvidence message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConsensusParamsEvidence.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.maxAgeNumBlocks != null && Object.hasOwnProperty.call(message, "maxAgeNumBlocks")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.maxAgeNumBlocks); + if (message.maxAgeDuration != null && Object.hasOwnProperty.call(message, "maxAgeDuration")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.maxAgeDuration); + if (message.maxBytes != null && Object.hasOwnProperty.call(message, "maxBytes")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.maxBytes); + return writer; + }; + + /** + * Encodes the specified ConsensusParamsEvidence message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidence.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidence + * @static + * @param {org.dash.platform.dapi.v0.GetConsensusParamsResponse.IConsensusParamsEvidence} message ConsensusParamsEvidence message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConsensusParamsEvidence.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConsensusParamsEvidence message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidence + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidence} ConsensusParamsEvidence + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConsensusParamsEvidence.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.org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidence(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.maxAgeNumBlocks = reader.string(); + break; + case 2: + message.maxAgeDuration = reader.string(); + break; + case 3: + message.maxBytes = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ConsensusParamsEvidence message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidence + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidence} ConsensusParamsEvidence + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConsensusParamsEvidence.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConsensusParamsEvidence message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidence + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConsensusParamsEvidence.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.maxAgeNumBlocks != null && message.hasOwnProperty("maxAgeNumBlocks")) + if (!$util.isString(message.maxAgeNumBlocks)) + return "maxAgeNumBlocks: string expected"; + if (message.maxAgeDuration != null && message.hasOwnProperty("maxAgeDuration")) + if (!$util.isString(message.maxAgeDuration)) + return "maxAgeDuration: string expected"; + if (message.maxBytes != null && message.hasOwnProperty("maxBytes")) + if (!$util.isString(message.maxBytes)) + return "maxBytes: string expected"; + return null; + }; + + /** + * Creates a ConsensusParamsEvidence message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidence + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidence} ConsensusParamsEvidence + */ + ConsensusParamsEvidence.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidence) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidence(); + if (object.maxAgeNumBlocks != null) + message.maxAgeNumBlocks = String(object.maxAgeNumBlocks); + if (object.maxAgeDuration != null) + message.maxAgeDuration = String(object.maxAgeDuration); + if (object.maxBytes != null) + message.maxBytes = String(object.maxBytes); + return message; + }; + + /** + * Creates a plain object from a ConsensusParamsEvidence message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidence + * @static + * @param {org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidence} message ConsensusParamsEvidence + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConsensusParamsEvidence.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.maxAgeNumBlocks = ""; + object.maxAgeDuration = ""; + object.maxBytes = ""; + } + if (message.maxAgeNumBlocks != null && message.hasOwnProperty("maxAgeNumBlocks")) + object.maxAgeNumBlocks = message.maxAgeNumBlocks; + if (message.maxAgeDuration != null && message.hasOwnProperty("maxAgeDuration")) + object.maxAgeDuration = message.maxAgeDuration; + if (message.maxBytes != null && message.hasOwnProperty("maxBytes")) + object.maxBytes = message.maxBytes; + return object; + }; + + /** + * Converts this ConsensusParamsEvidence to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidence + * @instance + * @returns {Object.} JSON object + */ + ConsensusParamsEvidence.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ConsensusParamsEvidence; + })(); + + GetConsensusParamsResponse.GetConsensusParamsResponseV0 = (function() { + + /** + * Properties of a GetConsensusParamsResponseV0. + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse + * @interface IGetConsensusParamsResponseV0 + * @property {org.dash.platform.dapi.v0.GetConsensusParamsResponse.IConsensusParamsBlock|null} [block] GetConsensusParamsResponseV0 block + * @property {org.dash.platform.dapi.v0.GetConsensusParamsResponse.IConsensusParamsEvidence|null} [evidence] GetConsensusParamsResponseV0 evidence + */ + + /** + * Constructs a new GetConsensusParamsResponseV0. + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse + * @classdesc Represents a GetConsensusParamsResponseV0. + * @implements IGetConsensusParamsResponseV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetConsensusParamsResponse.IGetConsensusParamsResponseV0=} [properties] Properties to set + */ + function GetConsensusParamsResponseV0(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]]; + } + + /** + * GetConsensusParamsResponseV0 block. + * @member {org.dash.platform.dapi.v0.GetConsensusParamsResponse.IConsensusParamsBlock|null|undefined} block + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0 + * @instance + */ + GetConsensusParamsResponseV0.prototype.block = null; + + /** + * GetConsensusParamsResponseV0 evidence. + * @member {org.dash.platform.dapi.v0.GetConsensusParamsResponse.IConsensusParamsEvidence|null|undefined} evidence + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0 + * @instance + */ + GetConsensusParamsResponseV0.prototype.evidence = null; + + /** + * Creates a new GetConsensusParamsResponseV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetConsensusParamsResponse.IGetConsensusParamsResponseV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0} GetConsensusParamsResponseV0 instance + */ + GetConsensusParamsResponseV0.create = function create(properties) { + return new GetConsensusParamsResponseV0(properties); + }; + + /** + * Encodes the specified GetConsensusParamsResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetConsensusParamsResponse.IGetConsensusParamsResponseV0} message GetConsensusParamsResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetConsensusParamsResponseV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.block != null && Object.hasOwnProperty.call(message, "block")) + $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock.encode(message.block, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.evidence != null && Object.hasOwnProperty.call(message, "evidence")) + $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidence.encode(message.evidence, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetConsensusParamsResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetConsensusParamsResponse.IGetConsensusParamsResponseV0} message GetConsensusParamsResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetConsensusParamsResponseV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetConsensusParamsResponseV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0} GetConsensusParamsResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetConsensusParamsResponseV0.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.org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.block = $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock.decode(reader, reader.uint32()); + break; + case 2: + message.evidence = $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidence.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetConsensusParamsResponseV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0} GetConsensusParamsResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetConsensusParamsResponseV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetConsensusParamsResponseV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetConsensusParamsResponseV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.block != null && message.hasOwnProperty("block")) { + var error = $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock.verify(message.block); + if (error) + return "block." + error; + } + if (message.evidence != null && message.hasOwnProperty("evidence")) { + var error = $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidence.verify(message.evidence); + if (error) + return "evidence." + error; + } + return null; + }; + + /** + * Creates a GetConsensusParamsResponseV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0} GetConsensusParamsResponseV0 + */ + GetConsensusParamsResponseV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0(); + if (object.block != null) { + if (typeof object.block !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0.block: object expected"); + message.block = $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock.fromObject(object.block); + } + if (object.evidence != null) { + if (typeof object.evidence !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0.evidence: object expected"); + message.evidence = $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidence.fromObject(object.evidence); + } + return message; + }; + + /** + * Creates a plain object from a GetConsensusParamsResponseV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0} message GetConsensusParamsResponseV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetConsensusParamsResponseV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.block = null; + object.evidence = null; + } + if (message.block != null && message.hasOwnProperty("block")) + object.block = $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock.toObject(message.block, options); + if (message.evidence != null && message.hasOwnProperty("evidence")) + object.evidence = $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidence.toObject(message.evidence, options); + return object; + }; + + /** + * Converts this GetConsensusParamsResponseV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0 + * @instance + * @returns {Object.} JSON object + */ + GetConsensusParamsResponseV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetConsensusParamsResponseV0; + })(); + + return GetConsensusParamsResponse; + })(); + + v0.GetProtocolVersionUpgradeStateRequest = (function() { + + /** + * Properties of a GetProtocolVersionUpgradeStateRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetProtocolVersionUpgradeStateRequest + * @property {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.IGetProtocolVersionUpgradeStateRequestV0|null} [v0] GetProtocolVersionUpgradeStateRequest v0 + */ + + /** + * Constructs a new GetProtocolVersionUpgradeStateRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetProtocolVersionUpgradeStateRequest. + * @implements IGetProtocolVersionUpgradeStateRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IGetProtocolVersionUpgradeStateRequest=} [properties] Properties to set + */ + function GetProtocolVersionUpgradeStateRequest(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]]; + } + + /** + * GetProtocolVersionUpgradeStateRequest v0. + * @member {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.IGetProtocolVersionUpgradeStateRequestV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest + * @instance + */ + GetProtocolVersionUpgradeStateRequest.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetProtocolVersionUpgradeStateRequest version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest + * @instance + */ + Object.defineProperty(GetProtocolVersionUpgradeStateRequest.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetProtocolVersionUpgradeStateRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetProtocolVersionUpgradeStateRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest} GetProtocolVersionUpgradeStateRequest instance + */ + GetProtocolVersionUpgradeStateRequest.create = function create(properties) { + return new GetProtocolVersionUpgradeStateRequest(properties); + }; + + /** + * Encodes the specified GetProtocolVersionUpgradeStateRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetProtocolVersionUpgradeStateRequest} message GetProtocolVersionUpgradeStateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetProtocolVersionUpgradeStateRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetProtocolVersionUpgradeStateRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetProtocolVersionUpgradeStateRequest} message GetProtocolVersionUpgradeStateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetProtocolVersionUpgradeStateRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetProtocolVersionUpgradeStateRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest} GetProtocolVersionUpgradeStateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetProtocolVersionUpgradeStateRequest.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.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetProtocolVersionUpgradeStateRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest} GetProtocolVersionUpgradeStateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetProtocolVersionUpgradeStateRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetProtocolVersionUpgradeStateRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetProtocolVersionUpgradeStateRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetProtocolVersionUpgradeStateRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest} GetProtocolVersionUpgradeStateRequest + */ + GetProtocolVersionUpgradeStateRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetProtocolVersionUpgradeStateRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest + * @static + * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest} message GetProtocolVersionUpgradeStateRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetProtocolVersionUpgradeStateRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetProtocolVersionUpgradeStateRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest + * @instance + * @returns {Object.} JSON object + */ + GetProtocolVersionUpgradeStateRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0 = (function() { + + /** + * Properties of a GetProtocolVersionUpgradeStateRequestV0. + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest + * @interface IGetProtocolVersionUpgradeStateRequestV0 + * @property {boolean|null} [prove] GetProtocolVersionUpgradeStateRequestV0 prove + */ + + /** + * Constructs a new GetProtocolVersionUpgradeStateRequestV0. + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest + * @classdesc Represents a GetProtocolVersionUpgradeStateRequestV0. + * @implements IGetProtocolVersionUpgradeStateRequestV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.IGetProtocolVersionUpgradeStateRequestV0=} [properties] Properties to set + */ + function GetProtocolVersionUpgradeStateRequestV0(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]]; + } + + /** + * GetProtocolVersionUpgradeStateRequestV0 prove. + * @member {boolean} prove + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0 + * @instance + */ + GetProtocolVersionUpgradeStateRequestV0.prototype.prove = false; + + /** + * Creates a new GetProtocolVersionUpgradeStateRequestV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.IGetProtocolVersionUpgradeStateRequestV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0} GetProtocolVersionUpgradeStateRequestV0 instance + */ + GetProtocolVersionUpgradeStateRequestV0.create = function create(properties) { + return new GetProtocolVersionUpgradeStateRequestV0(properties); + }; + + /** + * Encodes the specified GetProtocolVersionUpgradeStateRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.IGetProtocolVersionUpgradeStateRequestV0} message GetProtocolVersionUpgradeStateRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetProtocolVersionUpgradeStateRequestV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.prove); + return writer; + }; + + /** + * Encodes the specified GetProtocolVersionUpgradeStateRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.IGetProtocolVersionUpgradeStateRequestV0} message GetProtocolVersionUpgradeStateRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetProtocolVersionUpgradeStateRequestV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetProtocolVersionUpgradeStateRequestV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0} GetProtocolVersionUpgradeStateRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetProtocolVersionUpgradeStateRequestV0.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.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.prove = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetProtocolVersionUpgradeStateRequestV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0} GetProtocolVersionUpgradeStateRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetProtocolVersionUpgradeStateRequestV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetProtocolVersionUpgradeStateRequestV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetProtocolVersionUpgradeStateRequestV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.prove != null && message.hasOwnProperty("prove")) + if (typeof message.prove !== "boolean") + return "prove: boolean expected"; + return null; + }; + + /** + * Creates a GetProtocolVersionUpgradeStateRequestV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0} GetProtocolVersionUpgradeStateRequestV0 + */ + GetProtocolVersionUpgradeStateRequestV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0(); + if (object.prove != null) + message.prove = Boolean(object.prove); + return message; + }; + + /** + * Creates a plain object from a GetProtocolVersionUpgradeStateRequestV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0} message GetProtocolVersionUpgradeStateRequestV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetProtocolVersionUpgradeStateRequestV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.prove = false; + if (message.prove != null && message.hasOwnProperty("prove")) + object.prove = message.prove; + return object; + }; + + /** + * Converts this GetProtocolVersionUpgradeStateRequestV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0 + * @instance + * @returns {Object.} JSON object + */ + GetProtocolVersionUpgradeStateRequestV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetProtocolVersionUpgradeStateRequestV0; + })(); + + return GetProtocolVersionUpgradeStateRequest; + })(); + + v0.GetProtocolVersionUpgradeStateResponse = (function() { + + /** + * Properties of a GetProtocolVersionUpgradeStateResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetProtocolVersionUpgradeStateResponse + * @property {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.IGetProtocolVersionUpgradeStateResponseV0|null} [v0] GetProtocolVersionUpgradeStateResponse v0 + */ + + /** + * Constructs a new GetProtocolVersionUpgradeStateResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetProtocolVersionUpgradeStateResponse. + * @implements IGetProtocolVersionUpgradeStateResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IGetProtocolVersionUpgradeStateResponse=} [properties] Properties to set + */ + function GetProtocolVersionUpgradeStateResponse(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]]; + } + + /** + * GetProtocolVersionUpgradeStateResponse v0. + * @member {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.IGetProtocolVersionUpgradeStateResponseV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse + * @instance + */ + GetProtocolVersionUpgradeStateResponse.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetProtocolVersionUpgradeStateResponse version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse + * @instance + */ + Object.defineProperty(GetProtocolVersionUpgradeStateResponse.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetProtocolVersionUpgradeStateResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetProtocolVersionUpgradeStateResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse} GetProtocolVersionUpgradeStateResponse instance + */ + GetProtocolVersionUpgradeStateResponse.create = function create(properties) { + return new GetProtocolVersionUpgradeStateResponse(properties); + }; + + /** + * Encodes the specified GetProtocolVersionUpgradeStateResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetProtocolVersionUpgradeStateResponse} message GetProtocolVersionUpgradeStateResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetProtocolVersionUpgradeStateResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetProtocolVersionUpgradeStateResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetProtocolVersionUpgradeStateResponse} message GetProtocolVersionUpgradeStateResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetProtocolVersionUpgradeStateResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetProtocolVersionUpgradeStateResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse} GetProtocolVersionUpgradeStateResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetProtocolVersionUpgradeStateResponse.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.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetProtocolVersionUpgradeStateResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse} GetProtocolVersionUpgradeStateResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetProtocolVersionUpgradeStateResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetProtocolVersionUpgradeStateResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetProtocolVersionUpgradeStateResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetProtocolVersionUpgradeStateResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse} GetProtocolVersionUpgradeStateResponse + */ + GetProtocolVersionUpgradeStateResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetProtocolVersionUpgradeStateResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse + * @static + * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse} message GetProtocolVersionUpgradeStateResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetProtocolVersionUpgradeStateResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetProtocolVersionUpgradeStateResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse + * @instance + * @returns {Object.} JSON object + */ + GetProtocolVersionUpgradeStateResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0 = (function() { + + /** + * Properties of a GetProtocolVersionUpgradeStateResponseV0. + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse + * @interface IGetProtocolVersionUpgradeStateResponseV0 + * @property {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.IVersions|null} [versions] GetProtocolVersionUpgradeStateResponseV0 versions + * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetProtocolVersionUpgradeStateResponseV0 proof + * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetProtocolVersionUpgradeStateResponseV0 metadata + */ + + /** + * Constructs a new GetProtocolVersionUpgradeStateResponseV0. + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse + * @classdesc Represents a GetProtocolVersionUpgradeStateResponseV0. + * @implements IGetProtocolVersionUpgradeStateResponseV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.IGetProtocolVersionUpgradeStateResponseV0=} [properties] Properties to set + */ + function GetProtocolVersionUpgradeStateResponseV0(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]]; + } + + /** + * GetProtocolVersionUpgradeStateResponseV0 versions. + * @member {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.IVersions|null|undefined} versions + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0 + * @instance + */ + GetProtocolVersionUpgradeStateResponseV0.prototype.versions = null; + + /** + * GetProtocolVersionUpgradeStateResponseV0 proof. + * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0 + * @instance + */ + GetProtocolVersionUpgradeStateResponseV0.prototype.proof = null; + + /** + * GetProtocolVersionUpgradeStateResponseV0 metadata. + * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0 + * @instance + */ + GetProtocolVersionUpgradeStateResponseV0.prototype.metadata = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetProtocolVersionUpgradeStateResponseV0 result. + * @member {"versions"|"proof"|undefined} result + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0 + * @instance + */ + Object.defineProperty(GetProtocolVersionUpgradeStateResponseV0.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["versions", "proof"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetProtocolVersionUpgradeStateResponseV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.IGetProtocolVersionUpgradeStateResponseV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0} GetProtocolVersionUpgradeStateResponseV0 instance + */ + GetProtocolVersionUpgradeStateResponseV0.create = function create(properties) { + return new GetProtocolVersionUpgradeStateResponseV0(properties); + }; + + /** + * Encodes the specified GetProtocolVersionUpgradeStateResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.IGetProtocolVersionUpgradeStateResponseV0} message GetProtocolVersionUpgradeStateResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetProtocolVersionUpgradeStateResponseV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.versions != null && Object.hasOwnProperty.call(message, "versions")) + $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.Versions.encode(message.versions, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetProtocolVersionUpgradeStateResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.IGetProtocolVersionUpgradeStateResponseV0} message GetProtocolVersionUpgradeStateResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetProtocolVersionUpgradeStateResponseV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetProtocolVersionUpgradeStateResponseV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0} GetProtocolVersionUpgradeStateResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetProtocolVersionUpgradeStateResponseV0.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.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.versions = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.Versions.decode(reader, reader.uint32()); + break; + case 2: + message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); + break; + case 3: + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetProtocolVersionUpgradeStateResponseV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0} GetProtocolVersionUpgradeStateResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetProtocolVersionUpgradeStateResponseV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetProtocolVersionUpgradeStateResponseV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetProtocolVersionUpgradeStateResponseV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.versions != null && message.hasOwnProperty("versions")) { + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.Versions.verify(message.versions); + if (error) + return "versions." + error; + } + } + if (message.proof != null && message.hasOwnProperty("proof")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); + if (error) + return "proof." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a GetProtocolVersionUpgradeStateResponseV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0} GetProtocolVersionUpgradeStateResponseV0 + */ + GetProtocolVersionUpgradeStateResponseV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0(); + if (object.versions != null) { + if (typeof object.versions !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.versions: object expected"); + message.versions = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.Versions.fromObject(object.versions); + } + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.proof: object expected"); + message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.metadata: object expected"); + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a GetProtocolVersionUpgradeStateResponseV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0} message GetProtocolVersionUpgradeStateResponseV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetProtocolVersionUpgradeStateResponseV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.metadata = null; + if (message.versions != null && message.hasOwnProperty("versions")) { + object.versions = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.Versions.toObject(message.versions, options); + if (options.oneofs) + object.result = "versions"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); + if (options.oneofs) + object.result = "proof"; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this GetProtocolVersionUpgradeStateResponseV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0 + * @instance + * @returns {Object.} JSON object + */ + GetProtocolVersionUpgradeStateResponseV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetProtocolVersionUpgradeStateResponseV0.Versions = (function() { + + /** + * Properties of a Versions. + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0 + * @interface IVersions + * @property {Array.|null} [versions] Versions versions + */ + + /** + * Constructs a new Versions. + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0 + * @classdesc Represents a Versions. + * @implements IVersions + * @constructor + * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.IVersions=} [properties] Properties to set + */ + function Versions(properties) { + this.versions = []; + 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]]; + } + + /** + * Versions versions. + * @member {Array.} versions + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.Versions + * @instance + */ + Versions.prototype.versions = $util.emptyArray; + + /** + * Creates a new Versions instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.Versions + * @static + * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.IVersions=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.Versions} Versions instance + */ + Versions.create = function create(properties) { + return new Versions(properties); + }; + + /** + * Encodes the specified Versions message. Does not implicitly {@link org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.Versions.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.Versions + * @static + * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.IVersions} message Versions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Versions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.versions != null && message.versions.length) + for (var i = 0; i < message.versions.length; ++i) + $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry.encode(message.versions[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Versions message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.Versions.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.Versions + * @static + * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.IVersions} message Versions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Versions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Versions message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.Versions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.Versions} Versions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Versions.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.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.Versions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.versions && message.versions.length)) + message.versions = []; + message.versions.push($root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Versions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.Versions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.Versions} Versions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Versions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Versions message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.Versions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Versions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.versions != null && message.hasOwnProperty("versions")) { + if (!Array.isArray(message.versions)) + return "versions: array expected"; + for (var i = 0; i < message.versions.length; ++i) { + var error = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry.verify(message.versions[i]); + if (error) + return "versions." + error; + } + } + return null; + }; + + /** + * Creates a Versions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.Versions + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.Versions} Versions + */ + Versions.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.Versions) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.Versions(); + if (object.versions) { + if (!Array.isArray(object.versions)) + throw TypeError(".org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.Versions.versions: array expected"); + message.versions = []; + for (var i = 0; i < object.versions.length; ++i) { + if (typeof object.versions[i] !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.Versions.versions: object expected"); + message.versions[i] = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry.fromObject(object.versions[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Versions message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.Versions + * @static + * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.Versions} message Versions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Versions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.versions = []; + if (message.versions && message.versions.length) { + object.versions = []; + for (var j = 0; j < message.versions.length; ++j) + object.versions[j] = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry.toObject(message.versions[j], options); + } + return object; + }; + + /** + * Converts this Versions to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.Versions + * @instance + * @returns {Object.} JSON object + */ + Versions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Versions; + })(); + + GetProtocolVersionUpgradeStateResponseV0.VersionEntry = (function() { + + /** + * Properties of a VersionEntry. + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0 + * @interface IVersionEntry + * @property {number|null} [versionNumber] VersionEntry versionNumber + * @property {number|null} [voteCount] VersionEntry voteCount + */ + + /** + * Constructs a new VersionEntry. + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0 + * @classdesc Represents a VersionEntry. + * @implements IVersionEntry + * @constructor + * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.IVersionEntry=} [properties] Properties to set + */ + function VersionEntry(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]]; + } + + /** + * VersionEntry versionNumber. + * @member {number} versionNumber + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry + * @instance + */ + VersionEntry.prototype.versionNumber = 0; + + /** + * VersionEntry voteCount. + * @member {number} voteCount + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry + * @instance + */ + VersionEntry.prototype.voteCount = 0; + + /** + * Creates a new VersionEntry instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry + * @static + * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.IVersionEntry=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry} VersionEntry instance + */ + VersionEntry.create = function create(properties) { + return new VersionEntry(properties); + }; + + /** + * Encodes the specified VersionEntry message. Does not implicitly {@link org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry + * @static + * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.IVersionEntry} message VersionEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VersionEntry.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.versionNumber != null && Object.hasOwnProperty.call(message, "versionNumber")) + writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.versionNumber); + if (message.voteCount != null && Object.hasOwnProperty.call(message, "voteCount")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.voteCount); + return writer; + }; + + /** + * Encodes the specified VersionEntry message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry + * @static + * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.IVersionEntry} message VersionEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VersionEntry.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VersionEntry message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry} VersionEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VersionEntry.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.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.versionNumber = reader.uint32(); + break; + case 2: + message.voteCount = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VersionEntry message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry} VersionEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VersionEntry.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VersionEntry message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VersionEntry.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.versionNumber != null && message.hasOwnProperty("versionNumber")) + if (!$util.isInteger(message.versionNumber)) + return "versionNumber: integer expected"; + if (message.voteCount != null && message.hasOwnProperty("voteCount")) + if (!$util.isInteger(message.voteCount)) + return "voteCount: integer expected"; + return null; + }; + + /** + * Creates a VersionEntry message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry} VersionEntry + */ + VersionEntry.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry(); + if (object.versionNumber != null) + message.versionNumber = object.versionNumber >>> 0; + if (object.voteCount != null) + message.voteCount = object.voteCount >>> 0; + return message; + }; + + /** + * Creates a plain object from a VersionEntry message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry + * @static + * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry} message VersionEntry + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VersionEntry.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.versionNumber = 0; + object.voteCount = 0; + } + if (message.versionNumber != null && message.hasOwnProperty("versionNumber")) + object.versionNumber = message.versionNumber; + if (message.voteCount != null && message.hasOwnProperty("voteCount")) + object.voteCount = message.voteCount; + return object; + }; + + /** + * Converts this VersionEntry to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry + * @instance + * @returns {Object.} JSON object + */ + VersionEntry.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return VersionEntry; + })(); + + return GetProtocolVersionUpgradeStateResponseV0; + })(); + + return GetProtocolVersionUpgradeStateResponse; + })(); + + v0.GetProtocolVersionUpgradeVoteStatusRequest = (function() { + + /** + * Properties of a GetProtocolVersionUpgradeVoteStatusRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetProtocolVersionUpgradeVoteStatusRequest + * @property {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.IGetProtocolVersionUpgradeVoteStatusRequestV0|null} [v0] GetProtocolVersionUpgradeVoteStatusRequest v0 + */ + + /** + * Constructs a new GetProtocolVersionUpgradeVoteStatusRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetProtocolVersionUpgradeVoteStatusRequest. + * @implements IGetProtocolVersionUpgradeVoteStatusRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IGetProtocolVersionUpgradeVoteStatusRequest=} [properties] Properties to set + */ + function GetProtocolVersionUpgradeVoteStatusRequest(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]]; + } + + /** + * GetProtocolVersionUpgradeVoteStatusRequest v0. + * @member {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.IGetProtocolVersionUpgradeVoteStatusRequestV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest + * @instance + */ + GetProtocolVersionUpgradeVoteStatusRequest.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetProtocolVersionUpgradeVoteStatusRequest version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest + * @instance + */ + Object.defineProperty(GetProtocolVersionUpgradeVoteStatusRequest.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetProtocolVersionUpgradeVoteStatusRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetProtocolVersionUpgradeVoteStatusRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest} GetProtocolVersionUpgradeVoteStatusRequest instance + */ + GetProtocolVersionUpgradeVoteStatusRequest.create = function create(properties) { + return new GetProtocolVersionUpgradeVoteStatusRequest(properties); + }; + + /** + * Encodes the specified GetProtocolVersionUpgradeVoteStatusRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetProtocolVersionUpgradeVoteStatusRequest} message GetProtocolVersionUpgradeVoteStatusRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetProtocolVersionUpgradeVoteStatusRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetProtocolVersionUpgradeVoteStatusRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetProtocolVersionUpgradeVoteStatusRequest} message GetProtocolVersionUpgradeVoteStatusRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetProtocolVersionUpgradeVoteStatusRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetProtocolVersionUpgradeVoteStatusRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest} GetProtocolVersionUpgradeVoteStatusRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetProtocolVersionUpgradeVoteStatusRequest.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.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetProtocolVersionUpgradeVoteStatusRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest} GetProtocolVersionUpgradeVoteStatusRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetProtocolVersionUpgradeVoteStatusRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetProtocolVersionUpgradeVoteStatusRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetProtocolVersionUpgradeVoteStatusRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetProtocolVersionUpgradeVoteStatusRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest} GetProtocolVersionUpgradeVoteStatusRequest + */ + GetProtocolVersionUpgradeVoteStatusRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetProtocolVersionUpgradeVoteStatusRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest + * @static + * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest} message GetProtocolVersionUpgradeVoteStatusRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetProtocolVersionUpgradeVoteStatusRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetProtocolVersionUpgradeVoteStatusRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest + * @instance + * @returns {Object.} JSON object + */ + GetProtocolVersionUpgradeVoteStatusRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0 = (function() { + + /** + * Properties of a GetProtocolVersionUpgradeVoteStatusRequestV0. + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest + * @interface IGetProtocolVersionUpgradeVoteStatusRequestV0 + * @property {Uint8Array|null} [startProTxHash] GetProtocolVersionUpgradeVoteStatusRequestV0 startProTxHash + * @property {number|null} [count] GetProtocolVersionUpgradeVoteStatusRequestV0 count + * @property {boolean|null} [prove] GetProtocolVersionUpgradeVoteStatusRequestV0 prove + */ + + /** + * Constructs a new GetProtocolVersionUpgradeVoteStatusRequestV0. + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest + * @classdesc Represents a GetProtocolVersionUpgradeVoteStatusRequestV0. + * @implements IGetProtocolVersionUpgradeVoteStatusRequestV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.IGetProtocolVersionUpgradeVoteStatusRequestV0=} [properties] Properties to set + */ + function GetProtocolVersionUpgradeVoteStatusRequestV0(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]]; + } + + /** + * GetProtocolVersionUpgradeVoteStatusRequestV0 startProTxHash. + * @member {Uint8Array} startProTxHash + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0 + * @instance + */ + GetProtocolVersionUpgradeVoteStatusRequestV0.prototype.startProTxHash = $util.newBuffer([]); + + /** + * GetProtocolVersionUpgradeVoteStatusRequestV0 count. + * @member {number} count + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0 + * @instance + */ + GetProtocolVersionUpgradeVoteStatusRequestV0.prototype.count = 0; + + /** + * GetProtocolVersionUpgradeVoteStatusRequestV0 prove. + * @member {boolean} prove + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0 + * @instance + */ + GetProtocolVersionUpgradeVoteStatusRequestV0.prototype.prove = false; + + /** + * Creates a new GetProtocolVersionUpgradeVoteStatusRequestV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.IGetProtocolVersionUpgradeVoteStatusRequestV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0} GetProtocolVersionUpgradeVoteStatusRequestV0 instance + */ + GetProtocolVersionUpgradeVoteStatusRequestV0.create = function create(properties) { + return new GetProtocolVersionUpgradeVoteStatusRequestV0(properties); + }; + + /** + * Encodes the specified GetProtocolVersionUpgradeVoteStatusRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.IGetProtocolVersionUpgradeVoteStatusRequestV0} message GetProtocolVersionUpgradeVoteStatusRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetProtocolVersionUpgradeVoteStatusRequestV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.startProTxHash != null && Object.hasOwnProperty.call(message, "startProTxHash")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.startProTxHash); + if (message.count != null && Object.hasOwnProperty.call(message, "count")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.count); + if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.prove); + return writer; + }; + + /** + * Encodes the specified GetProtocolVersionUpgradeVoteStatusRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.IGetProtocolVersionUpgradeVoteStatusRequestV0} message GetProtocolVersionUpgradeVoteStatusRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetProtocolVersionUpgradeVoteStatusRequestV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetProtocolVersionUpgradeVoteStatusRequestV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0} GetProtocolVersionUpgradeVoteStatusRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetProtocolVersionUpgradeVoteStatusRequestV0.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.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.startProTxHash = reader.bytes(); + break; + case 2: + message.count = reader.uint32(); + break; + case 3: + message.prove = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetProtocolVersionUpgradeVoteStatusRequestV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0} GetProtocolVersionUpgradeVoteStatusRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetProtocolVersionUpgradeVoteStatusRequestV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetProtocolVersionUpgradeVoteStatusRequestV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetProtocolVersionUpgradeVoteStatusRequestV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.startProTxHash != null && message.hasOwnProperty("startProTxHash")) + if (!(message.startProTxHash && typeof message.startProTxHash.length === "number" || $util.isString(message.startProTxHash))) + return "startProTxHash: buffer expected"; + if (message.count != null && message.hasOwnProperty("count")) + if (!$util.isInteger(message.count)) + return "count: integer expected"; + if (message.prove != null && message.hasOwnProperty("prove")) + if (typeof message.prove !== "boolean") + return "prove: boolean expected"; + return null; + }; + + /** + * Creates a GetProtocolVersionUpgradeVoteStatusRequestV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0} GetProtocolVersionUpgradeVoteStatusRequestV0 + */ + GetProtocolVersionUpgradeVoteStatusRequestV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0(); + if (object.startProTxHash != null) + if (typeof object.startProTxHash === "string") + $util.base64.decode(object.startProTxHash, message.startProTxHash = $util.newBuffer($util.base64.length(object.startProTxHash)), 0); + else if (object.startProTxHash.length >= 0) + message.startProTxHash = object.startProTxHash; + if (object.count != null) + message.count = object.count >>> 0; + if (object.prove != null) + message.prove = Boolean(object.prove); + return message; + }; + + /** + * Creates a plain object from a GetProtocolVersionUpgradeVoteStatusRequestV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0} message GetProtocolVersionUpgradeVoteStatusRequestV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetProtocolVersionUpgradeVoteStatusRequestV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.startProTxHash = ""; + else { + object.startProTxHash = []; + if (options.bytes !== Array) + object.startProTxHash = $util.newBuffer(object.startProTxHash); + } + object.count = 0; + object.prove = false; + } + if (message.startProTxHash != null && message.hasOwnProperty("startProTxHash")) + object.startProTxHash = options.bytes === String ? $util.base64.encode(message.startProTxHash, 0, message.startProTxHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.startProTxHash) : message.startProTxHash; + if (message.count != null && message.hasOwnProperty("count")) + object.count = message.count; + if (message.prove != null && message.hasOwnProperty("prove")) + object.prove = message.prove; + return object; + }; + + /** + * Converts this GetProtocolVersionUpgradeVoteStatusRequestV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0 + * @instance + * @returns {Object.} JSON object + */ + GetProtocolVersionUpgradeVoteStatusRequestV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetProtocolVersionUpgradeVoteStatusRequestV0; + })(); + + return GetProtocolVersionUpgradeVoteStatusRequest; + })(); + + v0.GetProtocolVersionUpgradeVoteStatusResponse = (function() { + + /** + * Properties of a GetProtocolVersionUpgradeVoteStatusResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetProtocolVersionUpgradeVoteStatusResponse + * @property {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.IGetProtocolVersionUpgradeVoteStatusResponseV0|null} [v0] GetProtocolVersionUpgradeVoteStatusResponse v0 + */ + + /** + * Constructs a new GetProtocolVersionUpgradeVoteStatusResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetProtocolVersionUpgradeVoteStatusResponse. + * @implements IGetProtocolVersionUpgradeVoteStatusResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IGetProtocolVersionUpgradeVoteStatusResponse=} [properties] Properties to set + */ + function GetProtocolVersionUpgradeVoteStatusResponse(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]]; + } + + /** + * GetProtocolVersionUpgradeVoteStatusResponse v0. + * @member {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.IGetProtocolVersionUpgradeVoteStatusResponseV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse + * @instance + */ + GetProtocolVersionUpgradeVoteStatusResponse.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetProtocolVersionUpgradeVoteStatusResponse version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse + * @instance + */ + Object.defineProperty(GetProtocolVersionUpgradeVoteStatusResponse.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetProtocolVersionUpgradeVoteStatusResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetProtocolVersionUpgradeVoteStatusResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse} GetProtocolVersionUpgradeVoteStatusResponse instance + */ + GetProtocolVersionUpgradeVoteStatusResponse.create = function create(properties) { + return new GetProtocolVersionUpgradeVoteStatusResponse(properties); + }; + + /** + * Encodes the specified GetProtocolVersionUpgradeVoteStatusResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetProtocolVersionUpgradeVoteStatusResponse} message GetProtocolVersionUpgradeVoteStatusResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetProtocolVersionUpgradeVoteStatusResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetProtocolVersionUpgradeVoteStatusResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetProtocolVersionUpgradeVoteStatusResponse} message GetProtocolVersionUpgradeVoteStatusResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetProtocolVersionUpgradeVoteStatusResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetProtocolVersionUpgradeVoteStatusResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse} GetProtocolVersionUpgradeVoteStatusResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetProtocolVersionUpgradeVoteStatusResponse.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.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetProtocolVersionUpgradeVoteStatusResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse} GetProtocolVersionUpgradeVoteStatusResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetProtocolVersionUpgradeVoteStatusResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetProtocolVersionUpgradeVoteStatusResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetProtocolVersionUpgradeVoteStatusResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetProtocolVersionUpgradeVoteStatusResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse} GetProtocolVersionUpgradeVoteStatusResponse + */ + GetProtocolVersionUpgradeVoteStatusResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetProtocolVersionUpgradeVoteStatusResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse + * @static + * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse} message GetProtocolVersionUpgradeVoteStatusResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetProtocolVersionUpgradeVoteStatusResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetProtocolVersionUpgradeVoteStatusResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse + * @instance + * @returns {Object.} JSON object + */ + GetProtocolVersionUpgradeVoteStatusResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0 = (function() { + + /** + * Properties of a GetProtocolVersionUpgradeVoteStatusResponseV0. + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse + * @interface IGetProtocolVersionUpgradeVoteStatusResponseV0 + * @property {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.IVersionSignals|null} [versions] GetProtocolVersionUpgradeVoteStatusResponseV0 versions + * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetProtocolVersionUpgradeVoteStatusResponseV0 proof + * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetProtocolVersionUpgradeVoteStatusResponseV0 metadata + */ + + /** + * Constructs a new GetProtocolVersionUpgradeVoteStatusResponseV0. + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse + * @classdesc Represents a GetProtocolVersionUpgradeVoteStatusResponseV0. + * @implements IGetProtocolVersionUpgradeVoteStatusResponseV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.IGetProtocolVersionUpgradeVoteStatusResponseV0=} [properties] Properties to set + */ + function GetProtocolVersionUpgradeVoteStatusResponseV0(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]]; + } + + /** + * GetProtocolVersionUpgradeVoteStatusResponseV0 versions. + * @member {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.IVersionSignals|null|undefined} versions + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0 + * @instance + */ + GetProtocolVersionUpgradeVoteStatusResponseV0.prototype.versions = null; + + /** + * GetProtocolVersionUpgradeVoteStatusResponseV0 proof. + * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0 + * @instance + */ + GetProtocolVersionUpgradeVoteStatusResponseV0.prototype.proof = null; + + /** + * GetProtocolVersionUpgradeVoteStatusResponseV0 metadata. + * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0 + * @instance + */ + GetProtocolVersionUpgradeVoteStatusResponseV0.prototype.metadata = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetProtocolVersionUpgradeVoteStatusResponseV0 result. + * @member {"versions"|"proof"|undefined} result + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0 + * @instance + */ + Object.defineProperty(GetProtocolVersionUpgradeVoteStatusResponseV0.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["versions", "proof"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetProtocolVersionUpgradeVoteStatusResponseV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.IGetProtocolVersionUpgradeVoteStatusResponseV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0} GetProtocolVersionUpgradeVoteStatusResponseV0 instance + */ + GetProtocolVersionUpgradeVoteStatusResponseV0.create = function create(properties) { + return new GetProtocolVersionUpgradeVoteStatusResponseV0(properties); + }; + + /** + * Encodes the specified GetProtocolVersionUpgradeVoteStatusResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.IGetProtocolVersionUpgradeVoteStatusResponseV0} message GetProtocolVersionUpgradeVoteStatusResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetProtocolVersionUpgradeVoteStatusResponseV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.versions != null && Object.hasOwnProperty.call(message, "versions")) + $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals.encode(message.versions, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetProtocolVersionUpgradeVoteStatusResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.IGetProtocolVersionUpgradeVoteStatusResponseV0} message GetProtocolVersionUpgradeVoteStatusResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetProtocolVersionUpgradeVoteStatusResponseV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetProtocolVersionUpgradeVoteStatusResponseV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0} GetProtocolVersionUpgradeVoteStatusResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetProtocolVersionUpgradeVoteStatusResponseV0.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.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.versions = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals.decode(reader, reader.uint32()); + break; + case 2: + message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); + break; + case 3: + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetProtocolVersionUpgradeVoteStatusResponseV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0} GetProtocolVersionUpgradeVoteStatusResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetProtocolVersionUpgradeVoteStatusResponseV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetProtocolVersionUpgradeVoteStatusResponseV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetProtocolVersionUpgradeVoteStatusResponseV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.versions != null && message.hasOwnProperty("versions")) { + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals.verify(message.versions); + if (error) + return "versions." + error; + } + } + if (message.proof != null && message.hasOwnProperty("proof")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); + if (error) + return "proof." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a GetProtocolVersionUpgradeVoteStatusResponseV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0} GetProtocolVersionUpgradeVoteStatusResponseV0 + */ + GetProtocolVersionUpgradeVoteStatusResponseV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0(); + if (object.versions != null) { + if (typeof object.versions !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.versions: object expected"); + message.versions = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals.fromObject(object.versions); + } + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.proof: object expected"); + message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.metadata: object expected"); + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a GetProtocolVersionUpgradeVoteStatusResponseV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0} message GetProtocolVersionUpgradeVoteStatusResponseV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetProtocolVersionUpgradeVoteStatusResponseV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.metadata = null; + if (message.versions != null && message.hasOwnProperty("versions")) { + object.versions = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals.toObject(message.versions, options); + if (options.oneofs) + object.result = "versions"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); + if (options.oneofs) + object.result = "proof"; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this GetProtocolVersionUpgradeVoteStatusResponseV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0 + * @instance + * @returns {Object.} JSON object + */ + GetProtocolVersionUpgradeVoteStatusResponseV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals = (function() { + + /** + * Properties of a VersionSignals. + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0 + * @interface IVersionSignals + * @property {Array.|null} [versionSignals] VersionSignals versionSignals + */ + + /** + * Constructs a new VersionSignals. + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0 + * @classdesc Represents a VersionSignals. + * @implements IVersionSignals + * @constructor + * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.IVersionSignals=} [properties] Properties to set + */ + function VersionSignals(properties) { + this.versionSignals = []; + 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]]; + } + + /** + * VersionSignals versionSignals. + * @member {Array.} versionSignals + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals + * @instance + */ + VersionSignals.prototype.versionSignals = $util.emptyArray; + + /** + * Creates a new VersionSignals instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals + * @static + * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.IVersionSignals=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals} VersionSignals instance + */ + VersionSignals.create = function create(properties) { + return new VersionSignals(properties); + }; + + /** + * Encodes the specified VersionSignals message. Does not implicitly {@link org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals + * @static + * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.IVersionSignals} message VersionSignals message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VersionSignals.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.versionSignals != null && message.versionSignals.length) + for (var i = 0; i < message.versionSignals.length; ++i) + $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal.encode(message.versionSignals[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified VersionSignals message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals + * @static + * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.IVersionSignals} message VersionSignals message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VersionSignals.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VersionSignals message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals} VersionSignals + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VersionSignals.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.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.versionSignals && message.versionSignals.length)) + message.versionSignals = []; + message.versionSignals.push($root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VersionSignals message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals} VersionSignals + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VersionSignals.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VersionSignals message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VersionSignals.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.versionSignals != null && message.hasOwnProperty("versionSignals")) { + if (!Array.isArray(message.versionSignals)) + return "versionSignals: array expected"; + for (var i = 0; i < message.versionSignals.length; ++i) { + var error = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal.verify(message.versionSignals[i]); + if (error) + return "versionSignals." + error; + } + } + return null; + }; + + /** + * Creates a VersionSignals message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals} VersionSignals + */ + VersionSignals.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals(); + if (object.versionSignals) { + if (!Array.isArray(object.versionSignals)) + throw TypeError(".org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals.versionSignals: array expected"); + message.versionSignals = []; + for (var i = 0; i < object.versionSignals.length; ++i) { + if (typeof object.versionSignals[i] !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals.versionSignals: object expected"); + message.versionSignals[i] = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal.fromObject(object.versionSignals[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a VersionSignals message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals + * @static + * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals} message VersionSignals + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VersionSignals.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.versionSignals = []; + if (message.versionSignals && message.versionSignals.length) { + object.versionSignals = []; + for (var j = 0; j < message.versionSignals.length; ++j) + object.versionSignals[j] = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal.toObject(message.versionSignals[j], options); + } + return object; + }; + + /** + * Converts this VersionSignals to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals + * @instance + * @returns {Object.} JSON object + */ + VersionSignals.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return VersionSignals; + })(); + + GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal = (function() { + + /** + * Properties of a VersionSignal. + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0 + * @interface IVersionSignal + * @property {Uint8Array|null} [proTxHash] VersionSignal proTxHash + * @property {number|null} [version] VersionSignal version + */ + + /** + * Constructs a new VersionSignal. + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0 + * @classdesc Represents a VersionSignal. + * @implements IVersionSignal + * @constructor + * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.IVersionSignal=} [properties] Properties to set + */ + function VersionSignal(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]]; + } + + /** + * VersionSignal proTxHash. + * @member {Uint8Array} proTxHash + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal + * @instance + */ + VersionSignal.prototype.proTxHash = $util.newBuffer([]); + + /** + * VersionSignal version. + * @member {number} version + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal + * @instance + */ + VersionSignal.prototype.version = 0; + + /** + * Creates a new VersionSignal instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal + * @static + * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.IVersionSignal=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal} VersionSignal instance + */ + VersionSignal.create = function create(properties) { + return new VersionSignal(properties); + }; + + /** + * Encodes the specified VersionSignal message. Does not implicitly {@link org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal + * @static + * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.IVersionSignal} message VersionSignal message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VersionSignal.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.proTxHash != null && Object.hasOwnProperty.call(message, "proTxHash")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.proTxHash); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.version); + return writer; + }; + + /** + * Encodes the specified VersionSignal message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal + * @static + * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.IVersionSignal} message VersionSignal message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VersionSignal.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VersionSignal message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal} VersionSignal + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VersionSignal.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.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proTxHash = reader.bytes(); + break; + case 2: + message.version = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VersionSignal message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal} VersionSignal + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VersionSignal.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VersionSignal message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VersionSignal.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.proTxHash != null && message.hasOwnProperty("proTxHash")) + if (!(message.proTxHash && typeof message.proTxHash.length === "number" || $util.isString(message.proTxHash))) + return "proTxHash: buffer expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isInteger(message.version)) + return "version: integer expected"; + return null; + }; + + /** + * Creates a VersionSignal message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal} VersionSignal + */ + VersionSignal.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal(); + if (object.proTxHash != null) + if (typeof object.proTxHash === "string") + $util.base64.decode(object.proTxHash, message.proTxHash = $util.newBuffer($util.base64.length(object.proTxHash)), 0); + else if (object.proTxHash.length >= 0) + message.proTxHash = object.proTxHash; + if (object.version != null) + message.version = object.version >>> 0; + return message; + }; + + /** + * Creates a plain object from a VersionSignal message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal + * @static + * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal} message VersionSignal + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VersionSignal.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.proTxHash = ""; + else { + object.proTxHash = []; + if (options.bytes !== Array) + object.proTxHash = $util.newBuffer(object.proTxHash); + } + object.version = 0; + } + if (message.proTxHash != null && message.hasOwnProperty("proTxHash")) + object.proTxHash = options.bytes === String ? $util.base64.encode(message.proTxHash, 0, message.proTxHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.proTxHash) : message.proTxHash; + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + return object; + }; + + /** + * Converts this VersionSignal to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal + * @instance + * @returns {Object.} JSON object + */ + VersionSignal.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return VersionSignal; + })(); + + return GetProtocolVersionUpgradeVoteStatusResponseV0; + })(); + + return GetProtocolVersionUpgradeVoteStatusResponse; + })(); + + v0.GetEpochsInfoRequest = (function() { + + /** + * Properties of a GetEpochsInfoRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetEpochsInfoRequest + * @property {org.dash.platform.dapi.v0.GetEpochsInfoRequest.IGetEpochsInfoRequestV0|null} [v0] GetEpochsInfoRequest v0 + */ + + /** + * Constructs a new GetEpochsInfoRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetEpochsInfoRequest. + * @implements IGetEpochsInfoRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IGetEpochsInfoRequest=} [properties] Properties to set + */ + function GetEpochsInfoRequest(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]]; + } + + /** + * GetEpochsInfoRequest v0. + * @member {org.dash.platform.dapi.v0.GetEpochsInfoRequest.IGetEpochsInfoRequestV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoRequest + * @instance + */ + GetEpochsInfoRequest.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetEpochsInfoRequest version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoRequest + * @instance + */ + Object.defineProperty(GetEpochsInfoRequest.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetEpochsInfoRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetEpochsInfoRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetEpochsInfoRequest} GetEpochsInfoRequest instance + */ + GetEpochsInfoRequest.create = function create(properties) { + return new GetEpochsInfoRequest(properties); + }; + + /** + * Encodes the specified GetEpochsInfoRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetEpochsInfoRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetEpochsInfoRequest} message GetEpochsInfoRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetEpochsInfoRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetEpochsInfoRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetEpochsInfoRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetEpochsInfoRequest} message GetEpochsInfoRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetEpochsInfoRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetEpochsInfoRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetEpochsInfoRequest} GetEpochsInfoRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetEpochsInfoRequest.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.org.dash.platform.dapi.v0.GetEpochsInfoRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetEpochsInfoRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetEpochsInfoRequest} GetEpochsInfoRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetEpochsInfoRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetEpochsInfoRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetEpochsInfoRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetEpochsInfoRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetEpochsInfoRequest} GetEpochsInfoRequest + */ + GetEpochsInfoRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetEpochsInfoRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetEpochsInfoRequest(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetEpochsInfoRequest.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetEpochsInfoRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoRequest + * @static + * @param {org.dash.platform.dapi.v0.GetEpochsInfoRequest} message GetEpochsInfoRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetEpochsInfoRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetEpochsInfoRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoRequest + * @instance + * @returns {Object.} JSON object + */ + GetEpochsInfoRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetEpochsInfoRequest.GetEpochsInfoRequestV0 = (function() { + + /** + * Properties of a GetEpochsInfoRequestV0. + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoRequest + * @interface IGetEpochsInfoRequestV0 + * @property {google.protobuf.IUInt32Value|null} [startEpoch] GetEpochsInfoRequestV0 startEpoch + * @property {number|null} [count] GetEpochsInfoRequestV0 count + * @property {boolean|null} [ascending] GetEpochsInfoRequestV0 ascending + * @property {boolean|null} [prove] GetEpochsInfoRequestV0 prove + */ + + /** + * Constructs a new GetEpochsInfoRequestV0. + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoRequest + * @classdesc Represents a GetEpochsInfoRequestV0. + * @implements IGetEpochsInfoRequestV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetEpochsInfoRequest.IGetEpochsInfoRequestV0=} [properties] Properties to set + */ + function GetEpochsInfoRequestV0(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]]; + } + + /** + * GetEpochsInfoRequestV0 startEpoch. + * @member {google.protobuf.IUInt32Value|null|undefined} startEpoch + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0 + * @instance + */ + GetEpochsInfoRequestV0.prototype.startEpoch = null; + + /** + * GetEpochsInfoRequestV0 count. + * @member {number} count + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0 + * @instance + */ + GetEpochsInfoRequestV0.prototype.count = 0; + + /** + * GetEpochsInfoRequestV0 ascending. + * @member {boolean} ascending + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0 + * @instance + */ + GetEpochsInfoRequestV0.prototype.ascending = false; + + /** + * GetEpochsInfoRequestV0 prove. + * @member {boolean} prove + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0 + * @instance + */ + GetEpochsInfoRequestV0.prototype.prove = false; + + /** + * Creates a new GetEpochsInfoRequestV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetEpochsInfoRequest.IGetEpochsInfoRequestV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0} GetEpochsInfoRequestV0 instance + */ + GetEpochsInfoRequestV0.create = function create(properties) { + return new GetEpochsInfoRequestV0(properties); + }; + + /** + * Encodes the specified GetEpochsInfoRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetEpochsInfoRequest.IGetEpochsInfoRequestV0} message GetEpochsInfoRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetEpochsInfoRequestV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.startEpoch != null && Object.hasOwnProperty.call(message, "startEpoch")) + $root.google.protobuf.UInt32Value.encode(message.startEpoch, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.count != null && Object.hasOwnProperty.call(message, "count")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.count); + if (message.ascending != null && Object.hasOwnProperty.call(message, "ascending")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.ascending); + if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.prove); + return writer; + }; + + /** + * Encodes the specified GetEpochsInfoRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetEpochsInfoRequest.IGetEpochsInfoRequestV0} message GetEpochsInfoRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetEpochsInfoRequestV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetEpochsInfoRequestV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0} GetEpochsInfoRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetEpochsInfoRequestV0.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.org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.startEpoch = $root.google.protobuf.UInt32Value.decode(reader, reader.uint32()); + break; + case 2: + message.count = reader.uint32(); + break; + case 3: + message.ascending = reader.bool(); + break; + case 4: + message.prove = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetEpochsInfoRequestV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0} GetEpochsInfoRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetEpochsInfoRequestV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetEpochsInfoRequestV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetEpochsInfoRequestV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.startEpoch != null && message.hasOwnProperty("startEpoch")) { + var error = $root.google.protobuf.UInt32Value.verify(message.startEpoch); + if (error) + return "startEpoch." + error; + } + if (message.count != null && message.hasOwnProperty("count")) + if (!$util.isInteger(message.count)) + return "count: integer expected"; + if (message.ascending != null && message.hasOwnProperty("ascending")) + if (typeof message.ascending !== "boolean") + return "ascending: boolean expected"; + if (message.prove != null && message.hasOwnProperty("prove")) + if (typeof message.prove !== "boolean") + return "prove: boolean expected"; + return null; + }; + + /** + * Creates a GetEpochsInfoRequestV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0} GetEpochsInfoRequestV0 + */ + GetEpochsInfoRequestV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0(); + if (object.startEpoch != null) { + if (typeof object.startEpoch !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0.startEpoch: object expected"); + message.startEpoch = $root.google.protobuf.UInt32Value.fromObject(object.startEpoch); + } + if (object.count != null) + message.count = object.count >>> 0; + if (object.ascending != null) + message.ascending = Boolean(object.ascending); + if (object.prove != null) + message.prove = Boolean(object.prove); + return message; + }; + + /** + * Creates a plain object from a GetEpochsInfoRequestV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0} message GetEpochsInfoRequestV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetEpochsInfoRequestV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.startEpoch = null; + object.count = 0; + object.ascending = false; + object.prove = false; + } + if (message.startEpoch != null && message.hasOwnProperty("startEpoch")) + object.startEpoch = $root.google.protobuf.UInt32Value.toObject(message.startEpoch, options); + if (message.count != null && message.hasOwnProperty("count")) + object.count = message.count; + if (message.ascending != null && message.hasOwnProperty("ascending")) + object.ascending = message.ascending; + if (message.prove != null && message.hasOwnProperty("prove")) + object.prove = message.prove; + return object; + }; + + /** + * Converts this GetEpochsInfoRequestV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0 + * @instance + * @returns {Object.} JSON object + */ + GetEpochsInfoRequestV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetEpochsInfoRequestV0; + })(); + + return GetEpochsInfoRequest; + })(); + + v0.GetEpochsInfoResponse = (function() { + + /** + * Properties of a GetEpochsInfoResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetEpochsInfoResponse + * @property {org.dash.platform.dapi.v0.GetEpochsInfoResponse.IGetEpochsInfoResponseV0|null} [v0] GetEpochsInfoResponse v0 + */ + + /** + * Constructs a new GetEpochsInfoResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetEpochsInfoResponse. + * @implements IGetEpochsInfoResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IGetEpochsInfoResponse=} [properties] Properties to set + */ + function GetEpochsInfoResponse(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]]; + } + + /** + * GetEpochsInfoResponse v0. + * @member {org.dash.platform.dapi.v0.GetEpochsInfoResponse.IGetEpochsInfoResponseV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse + * @instance + */ + GetEpochsInfoResponse.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetEpochsInfoResponse version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse + * @instance + */ + Object.defineProperty(GetEpochsInfoResponse.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetEpochsInfoResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetEpochsInfoResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetEpochsInfoResponse} GetEpochsInfoResponse instance + */ + GetEpochsInfoResponse.create = function create(properties) { + return new GetEpochsInfoResponse(properties); + }; + + /** + * Encodes the specified GetEpochsInfoResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetEpochsInfoResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetEpochsInfoResponse} message GetEpochsInfoResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetEpochsInfoResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetEpochsInfoResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetEpochsInfoResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetEpochsInfoResponse} message GetEpochsInfoResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetEpochsInfoResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetEpochsInfoResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetEpochsInfoResponse} GetEpochsInfoResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetEpochsInfoResponse.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.org.dash.platform.dapi.v0.GetEpochsInfoResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetEpochsInfoResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetEpochsInfoResponse} GetEpochsInfoResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetEpochsInfoResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetEpochsInfoResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetEpochsInfoResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetEpochsInfoResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetEpochsInfoResponse} GetEpochsInfoResponse + */ + GetEpochsInfoResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetEpochsInfoResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetEpochsInfoResponse(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetEpochsInfoResponse.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetEpochsInfoResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse + * @static + * @param {org.dash.platform.dapi.v0.GetEpochsInfoResponse} message GetEpochsInfoResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetEpochsInfoResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetEpochsInfoResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse + * @instance + * @returns {Object.} JSON object + */ + GetEpochsInfoResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetEpochsInfoResponse.GetEpochsInfoResponseV0 = (function() { + + /** + * Properties of a GetEpochsInfoResponseV0. + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse + * @interface IGetEpochsInfoResponseV0 + * @property {org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.IEpochInfos|null} [epochs] GetEpochsInfoResponseV0 epochs + * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetEpochsInfoResponseV0 proof + * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetEpochsInfoResponseV0 metadata + */ + + /** + * Constructs a new GetEpochsInfoResponseV0. + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse + * @classdesc Represents a GetEpochsInfoResponseV0. + * @implements IGetEpochsInfoResponseV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetEpochsInfoResponse.IGetEpochsInfoResponseV0=} [properties] Properties to set + */ + function GetEpochsInfoResponseV0(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]]; + } + + /** + * GetEpochsInfoResponseV0 epochs. + * @member {org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.IEpochInfos|null|undefined} epochs + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0 + * @instance + */ + GetEpochsInfoResponseV0.prototype.epochs = null; + + /** + * GetEpochsInfoResponseV0 proof. + * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0 + * @instance + */ + GetEpochsInfoResponseV0.prototype.proof = null; + + /** + * GetEpochsInfoResponseV0 metadata. + * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0 + * @instance + */ + GetEpochsInfoResponseV0.prototype.metadata = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetEpochsInfoResponseV0 result. + * @member {"epochs"|"proof"|undefined} result + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0 + * @instance + */ + Object.defineProperty(GetEpochsInfoResponseV0.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["epochs", "proof"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetEpochsInfoResponseV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetEpochsInfoResponse.IGetEpochsInfoResponseV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0} GetEpochsInfoResponseV0 instance + */ + GetEpochsInfoResponseV0.create = function create(properties) { + return new GetEpochsInfoResponseV0(properties); + }; + + /** + * Encodes the specified GetEpochsInfoResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetEpochsInfoResponse.IGetEpochsInfoResponseV0} message GetEpochsInfoResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetEpochsInfoResponseV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.epochs != null && Object.hasOwnProperty.call(message, "epochs")) + $root.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos.encode(message.epochs, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetEpochsInfoResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetEpochsInfoResponse.IGetEpochsInfoResponseV0} message GetEpochsInfoResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetEpochsInfoResponseV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetEpochsInfoResponseV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0} GetEpochsInfoResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetEpochsInfoResponseV0.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.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.epochs = $root.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos.decode(reader, reader.uint32()); + break; + case 2: + message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); + break; + case 3: + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetEpochsInfoResponseV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0} GetEpochsInfoResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetEpochsInfoResponseV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetEpochsInfoResponseV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetEpochsInfoResponseV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.epochs != null && message.hasOwnProperty("epochs")) { + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos.verify(message.epochs); + if (error) + return "epochs." + error; + } + } + if (message.proof != null && message.hasOwnProperty("proof")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); + if (error) + return "proof." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a GetEpochsInfoResponseV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0} GetEpochsInfoResponseV0 + */ + GetEpochsInfoResponseV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0(); + if (object.epochs != null) { + if (typeof object.epochs !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.epochs: object expected"); + message.epochs = $root.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos.fromObject(object.epochs); + } + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.proof: object expected"); + message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.metadata: object expected"); + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a GetEpochsInfoResponseV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0} message GetEpochsInfoResponseV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetEpochsInfoResponseV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.metadata = null; + if (message.epochs != null && message.hasOwnProperty("epochs")) { + object.epochs = $root.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos.toObject(message.epochs, options); + if (options.oneofs) + object.result = "epochs"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); + if (options.oneofs) + object.result = "proof"; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this GetEpochsInfoResponseV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0 + * @instance + * @returns {Object.} JSON object + */ + GetEpochsInfoResponseV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetEpochsInfoResponseV0.EpochInfos = (function() { + + /** + * Properties of an EpochInfos. + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0 + * @interface IEpochInfos + * @property {Array.|null} [epochInfos] EpochInfos epochInfos + */ + + /** + * Constructs a new EpochInfos. + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0 + * @classdesc Represents an EpochInfos. + * @implements IEpochInfos + * @constructor + * @param {org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.IEpochInfos=} [properties] Properties to set + */ + function EpochInfos(properties) { + this.epochInfos = []; + 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]]; + } + + /** + * EpochInfos epochInfos. + * @member {Array.} epochInfos + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos + * @instance + */ + EpochInfos.prototype.epochInfos = $util.emptyArray; + + /** + * Creates a new EpochInfos instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos + * @static + * @param {org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.IEpochInfos=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos} EpochInfos instance + */ + EpochInfos.create = function create(properties) { + return new EpochInfos(properties); + }; + + /** + * Encodes the specified EpochInfos message. Does not implicitly {@link org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos + * @static + * @param {org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.IEpochInfos} message EpochInfos message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EpochInfos.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.epochInfos != null && message.epochInfos.length) + for (var i = 0; i < message.epochInfos.length; ++i) + $root.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo.encode(message.epochInfos[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EpochInfos message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos + * @static + * @param {org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.IEpochInfos} message EpochInfos message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EpochInfos.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EpochInfos message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos} EpochInfos + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EpochInfos.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.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.epochInfos && message.epochInfos.length)) + message.epochInfos = []; + message.epochInfos.push($root.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EpochInfos message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos} EpochInfos + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EpochInfos.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EpochInfos message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EpochInfos.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.epochInfos != null && message.hasOwnProperty("epochInfos")) { + if (!Array.isArray(message.epochInfos)) + return "epochInfos: array expected"; + for (var i = 0; i < message.epochInfos.length; ++i) { + var error = $root.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo.verify(message.epochInfos[i]); + if (error) + return "epochInfos." + error; + } + } + return null; + }; + + /** + * Creates an EpochInfos message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos} EpochInfos + */ + EpochInfos.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos(); + if (object.epochInfos) { + if (!Array.isArray(object.epochInfos)) + throw TypeError(".org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos.epochInfos: array expected"); + message.epochInfos = []; + for (var i = 0; i < object.epochInfos.length; ++i) { + if (typeof object.epochInfos[i] !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos.epochInfos: object expected"); + message.epochInfos[i] = $root.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo.fromObject(object.epochInfos[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an EpochInfos message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos + * @static + * @param {org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos} message EpochInfos + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EpochInfos.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.epochInfos = []; + if (message.epochInfos && message.epochInfos.length) { + object.epochInfos = []; + for (var j = 0; j < message.epochInfos.length; ++j) + object.epochInfos[j] = $root.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo.toObject(message.epochInfos[j], options); + } + return object; + }; + + /** + * Converts this EpochInfos to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos + * @instance + * @returns {Object.} JSON object + */ + EpochInfos.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return EpochInfos; + })(); + + GetEpochsInfoResponseV0.EpochInfo = (function() { + + /** + * Properties of an EpochInfo. + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0 + * @interface IEpochInfo + * @property {number|null} [number] EpochInfo number + * @property {number|Long|null} [firstBlockHeight] EpochInfo firstBlockHeight + * @property {number|null} [firstCoreBlockHeight] EpochInfo firstCoreBlockHeight + * @property {number|Long|null} [startTime] EpochInfo startTime + * @property {number|null} [feeMultiplier] EpochInfo feeMultiplier + * @property {number|null} [protocolVersion] EpochInfo protocolVersion + */ + + /** + * Constructs a new EpochInfo. + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0 + * @classdesc Represents an EpochInfo. + * @implements IEpochInfo + * @constructor + * @param {org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.IEpochInfo=} [properties] Properties to set + */ + function EpochInfo(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]]; + } + + /** + * EpochInfo number. + * @member {number} number + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo + * @instance + */ + EpochInfo.prototype.number = 0; + + /** + * EpochInfo firstBlockHeight. + * @member {number|Long} firstBlockHeight + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo + * @instance + */ + EpochInfo.prototype.firstBlockHeight = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * EpochInfo firstCoreBlockHeight. + * @member {number} firstCoreBlockHeight + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo + * @instance + */ + EpochInfo.prototype.firstCoreBlockHeight = 0; + + /** + * EpochInfo startTime. + * @member {number|Long} startTime + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo + * @instance + */ + EpochInfo.prototype.startTime = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * EpochInfo feeMultiplier. + * @member {number} feeMultiplier + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo + * @instance + */ + EpochInfo.prototype.feeMultiplier = 0; + + /** + * EpochInfo protocolVersion. + * @member {number} protocolVersion + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo + * @instance + */ + EpochInfo.prototype.protocolVersion = 0; + + /** + * Creates a new EpochInfo instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo + * @static + * @param {org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.IEpochInfo=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo} EpochInfo instance + */ + EpochInfo.create = function create(properties) { + return new EpochInfo(properties); + }; + + /** + * Encodes the specified EpochInfo message. Does not implicitly {@link org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo + * @static + * @param {org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.IEpochInfo} message EpochInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EpochInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.number); + if (message.firstBlockHeight != null && Object.hasOwnProperty.call(message, "firstBlockHeight")) + writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.firstBlockHeight); + if (message.firstCoreBlockHeight != null && Object.hasOwnProperty.call(message, "firstCoreBlockHeight")) + writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.firstCoreBlockHeight); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.startTime); + if (message.feeMultiplier != null && Object.hasOwnProperty.call(message, "feeMultiplier")) + writer.uint32(/* id 5, wireType 1 =*/41).double(message.feeMultiplier); + if (message.protocolVersion != null && Object.hasOwnProperty.call(message, "protocolVersion")) + writer.uint32(/* id 6, wireType 0 =*/48).uint32(message.protocolVersion); + return writer; + }; + + /** + * Encodes the specified EpochInfo message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo + * @static + * @param {org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.IEpochInfo} message EpochInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EpochInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EpochInfo message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo} EpochInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EpochInfo.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.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.number = reader.uint32(); + break; + case 2: + message.firstBlockHeight = reader.uint64(); + break; + case 3: + message.firstCoreBlockHeight = reader.uint32(); + break; + case 4: + message.startTime = reader.uint64(); + break; + case 5: + message.feeMultiplier = reader.double(); + break; + case 6: + message.protocolVersion = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EpochInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo} EpochInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EpochInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EpochInfo message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EpochInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.firstBlockHeight != null && message.hasOwnProperty("firstBlockHeight")) + if (!$util.isInteger(message.firstBlockHeight) && !(message.firstBlockHeight && $util.isInteger(message.firstBlockHeight.low) && $util.isInteger(message.firstBlockHeight.high))) + return "firstBlockHeight: integer|Long expected"; + if (message.firstCoreBlockHeight != null && message.hasOwnProperty("firstCoreBlockHeight")) + if (!$util.isInteger(message.firstCoreBlockHeight)) + return "firstCoreBlockHeight: integer expected"; + if (message.startTime != null && message.hasOwnProperty("startTime")) + if (!$util.isInteger(message.startTime) && !(message.startTime && $util.isInteger(message.startTime.low) && $util.isInteger(message.startTime.high))) + return "startTime: integer|Long expected"; + if (message.feeMultiplier != null && message.hasOwnProperty("feeMultiplier")) + if (typeof message.feeMultiplier !== "number") + return "feeMultiplier: number expected"; + if (message.protocolVersion != null && message.hasOwnProperty("protocolVersion")) + if (!$util.isInteger(message.protocolVersion)) + return "protocolVersion: integer expected"; + return null; + }; + + /** + * Creates an EpochInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo} EpochInfo + */ + EpochInfo.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo(); + if (object.number != null) + message.number = object.number >>> 0; + if (object.firstBlockHeight != null) + if ($util.Long) + (message.firstBlockHeight = $util.Long.fromValue(object.firstBlockHeight)).unsigned = true; + else if (typeof object.firstBlockHeight === "string") + message.firstBlockHeight = parseInt(object.firstBlockHeight, 10); + else if (typeof object.firstBlockHeight === "number") + message.firstBlockHeight = object.firstBlockHeight; + else if (typeof object.firstBlockHeight === "object") + message.firstBlockHeight = new $util.LongBits(object.firstBlockHeight.low >>> 0, object.firstBlockHeight.high >>> 0).toNumber(true); + if (object.firstCoreBlockHeight != null) + message.firstCoreBlockHeight = object.firstCoreBlockHeight >>> 0; + if (object.startTime != null) + if ($util.Long) + (message.startTime = $util.Long.fromValue(object.startTime)).unsigned = true; + else if (typeof object.startTime === "string") + message.startTime = parseInt(object.startTime, 10); + else if (typeof object.startTime === "number") + message.startTime = object.startTime; + else if (typeof object.startTime === "object") + message.startTime = new $util.LongBits(object.startTime.low >>> 0, object.startTime.high >>> 0).toNumber(true); + if (object.feeMultiplier != null) + message.feeMultiplier = Number(object.feeMultiplier); + if (object.protocolVersion != null) + message.protocolVersion = object.protocolVersion >>> 0; + return message; + }; + + /** + * Creates a plain object from an EpochInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo + * @static + * @param {org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo} message EpochInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EpochInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.number = 0; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.firstBlockHeight = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.firstBlockHeight = options.longs === String ? "0" : 0; + object.firstCoreBlockHeight = 0; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.startTime = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.startTime = options.longs === String ? "0" : 0; + object.feeMultiplier = 0; + object.protocolVersion = 0; + } + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.firstBlockHeight != null && message.hasOwnProperty("firstBlockHeight")) + if (typeof message.firstBlockHeight === "number") + object.firstBlockHeight = options.longs === String ? String(message.firstBlockHeight) : message.firstBlockHeight; + else + object.firstBlockHeight = options.longs === String ? $util.Long.prototype.toString.call(message.firstBlockHeight) : options.longs === Number ? new $util.LongBits(message.firstBlockHeight.low >>> 0, message.firstBlockHeight.high >>> 0).toNumber(true) : message.firstBlockHeight; + if (message.firstCoreBlockHeight != null && message.hasOwnProperty("firstCoreBlockHeight")) + object.firstCoreBlockHeight = message.firstCoreBlockHeight; + if (message.startTime != null && message.hasOwnProperty("startTime")) + if (typeof message.startTime === "number") + object.startTime = options.longs === String ? String(message.startTime) : message.startTime; + else + object.startTime = options.longs === String ? $util.Long.prototype.toString.call(message.startTime) : options.longs === Number ? new $util.LongBits(message.startTime.low >>> 0, message.startTime.high >>> 0).toNumber(true) : message.startTime; + if (message.feeMultiplier != null && message.hasOwnProperty("feeMultiplier")) + object.feeMultiplier = options.json && !isFinite(message.feeMultiplier) ? String(message.feeMultiplier) : message.feeMultiplier; + if (message.protocolVersion != null && message.hasOwnProperty("protocolVersion")) + object.protocolVersion = message.protocolVersion; + return object; + }; + + /** + * Converts this EpochInfo to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo + * @instance + * @returns {Object.} JSON object + */ + EpochInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return EpochInfo; + })(); + + return GetEpochsInfoResponseV0; + })(); + + return GetEpochsInfoResponse; + })(); + + v0.GetContestedResourcesRequest = (function() { + + /** + * Properties of a GetContestedResourcesRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetContestedResourcesRequest + * @property {org.dash.platform.dapi.v0.GetContestedResourcesRequest.IGetContestedResourcesRequestV0|null} [v0] GetContestedResourcesRequest v0 + */ + + /** + * Constructs a new GetContestedResourcesRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetContestedResourcesRequest. + * @implements IGetContestedResourcesRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IGetContestedResourcesRequest=} [properties] Properties to set + */ + function GetContestedResourcesRequest(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]]; + } + + /** + * GetContestedResourcesRequest v0. + * @member {org.dash.platform.dapi.v0.GetContestedResourcesRequest.IGetContestedResourcesRequestV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest + * @instance + */ + GetContestedResourcesRequest.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetContestedResourcesRequest version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest + * @instance + */ + Object.defineProperty(GetContestedResourcesRequest.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetContestedResourcesRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetContestedResourcesRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetContestedResourcesRequest} GetContestedResourcesRequest instance + */ + GetContestedResourcesRequest.create = function create(properties) { + return new GetContestedResourcesRequest(properties); + }; + + /** + * Encodes the specified GetContestedResourcesRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourcesRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetContestedResourcesRequest} message GetContestedResourcesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetContestedResourcesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetContestedResourcesRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourcesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetContestedResourcesRequest} message GetContestedResourcesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetContestedResourcesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetContestedResourcesRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetContestedResourcesRequest} GetContestedResourcesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetContestedResourcesRequest.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.org.dash.platform.dapi.v0.GetContestedResourcesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetContestedResourcesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetContestedResourcesRequest} GetContestedResourcesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetContestedResourcesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetContestedResourcesRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetContestedResourcesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetContestedResourcesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetContestedResourcesRequest} GetContestedResourcesRequest + */ + GetContestedResourcesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourcesRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetContestedResourcesRequest(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourcesRequest.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetContestedResourcesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourcesRequest} message GetContestedResourcesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetContestedResourcesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetContestedResourcesRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest + * @instance + * @returns {Object.} JSON object + */ + GetContestedResourcesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetContestedResourcesRequest.GetContestedResourcesRequestV0 = (function() { + + /** + * Properties of a GetContestedResourcesRequestV0. + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest + * @interface IGetContestedResourcesRequestV0 + * @property {Uint8Array|null} [contractId] GetContestedResourcesRequestV0 contractId + * @property {string|null} [documentTypeName] GetContestedResourcesRequestV0 documentTypeName + * @property {string|null} [indexName] GetContestedResourcesRequestV0 indexName + * @property {Array.|null} [startIndexValues] GetContestedResourcesRequestV0 startIndexValues + * @property {Array.|null} [endIndexValues] GetContestedResourcesRequestV0 endIndexValues + * @property {org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.IStartAtValueInfo|null} [startAtValueInfo] GetContestedResourcesRequestV0 startAtValueInfo + * @property {number|null} [count] GetContestedResourcesRequestV0 count + * @property {boolean|null} [orderAscending] GetContestedResourcesRequestV0 orderAscending + * @property {boolean|null} [prove] GetContestedResourcesRequestV0 prove + */ + + /** + * Constructs a new GetContestedResourcesRequestV0. + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest + * @classdesc Represents a GetContestedResourcesRequestV0. + * @implements IGetContestedResourcesRequestV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetContestedResourcesRequest.IGetContestedResourcesRequestV0=} [properties] Properties to set + */ + function GetContestedResourcesRequestV0(properties) { + this.startIndexValues = []; + this.endIndexValues = []; + 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]]; + } + + /** + * GetContestedResourcesRequestV0 contractId. + * @member {Uint8Array} contractId + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0 + * @instance + */ + GetContestedResourcesRequestV0.prototype.contractId = $util.newBuffer([]); + + /** + * GetContestedResourcesRequestV0 documentTypeName. + * @member {string} documentTypeName + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0 + * @instance + */ + GetContestedResourcesRequestV0.prototype.documentTypeName = ""; + + /** + * GetContestedResourcesRequestV0 indexName. + * @member {string} indexName + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0 + * @instance + */ + GetContestedResourcesRequestV0.prototype.indexName = ""; + + /** + * GetContestedResourcesRequestV0 startIndexValues. + * @member {Array.} startIndexValues + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0 + * @instance + */ + GetContestedResourcesRequestV0.prototype.startIndexValues = $util.emptyArray; + + /** + * GetContestedResourcesRequestV0 endIndexValues. + * @member {Array.} endIndexValues + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0 + * @instance + */ + GetContestedResourcesRequestV0.prototype.endIndexValues = $util.emptyArray; + + /** + * GetContestedResourcesRequestV0 startAtValueInfo. + * @member {org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.IStartAtValueInfo|null|undefined} startAtValueInfo + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0 + * @instance + */ + GetContestedResourcesRequestV0.prototype.startAtValueInfo = null; + + /** + * GetContestedResourcesRequestV0 count. + * @member {number} count + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0 + * @instance + */ + GetContestedResourcesRequestV0.prototype.count = 0; + + /** + * GetContestedResourcesRequestV0 orderAscending. + * @member {boolean} orderAscending + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0 + * @instance + */ + GetContestedResourcesRequestV0.prototype.orderAscending = false; + + /** + * GetContestedResourcesRequestV0 prove. + * @member {boolean} prove + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0 + * @instance + */ + GetContestedResourcesRequestV0.prototype.prove = false; + + /** + * Creates a new GetContestedResourcesRequestV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourcesRequest.IGetContestedResourcesRequestV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0} GetContestedResourcesRequestV0 instance + */ + GetContestedResourcesRequestV0.create = function create(properties) { + return new GetContestedResourcesRequestV0(properties); + }; + + /** + * Encodes the specified GetContestedResourcesRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourcesRequest.IGetContestedResourcesRequestV0} message GetContestedResourcesRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetContestedResourcesRequestV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.contractId != null && Object.hasOwnProperty.call(message, "contractId")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.contractId); + if (message.documentTypeName != null && Object.hasOwnProperty.call(message, "documentTypeName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.documentTypeName); + if (message.indexName != null && Object.hasOwnProperty.call(message, "indexName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.indexName); + if (message.startIndexValues != null && message.startIndexValues.length) + for (var i = 0; i < message.startIndexValues.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.startIndexValues[i]); + if (message.endIndexValues != null && message.endIndexValues.length) + for (var i = 0; i < message.endIndexValues.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.endIndexValues[i]); + if (message.startAtValueInfo != null && Object.hasOwnProperty.call(message, "startAtValueInfo")) + $root.org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfo.encode(message.startAtValueInfo, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.count != null && Object.hasOwnProperty.call(message, "count")) + writer.uint32(/* id 7, wireType 0 =*/56).uint32(message.count); + if (message.orderAscending != null && Object.hasOwnProperty.call(message, "orderAscending")) + writer.uint32(/* id 8, wireType 0 =*/64).bool(message.orderAscending); + if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) + writer.uint32(/* id 9, wireType 0 =*/72).bool(message.prove); + return writer; + }; + + /** + * Encodes the specified GetContestedResourcesRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourcesRequest.IGetContestedResourcesRequestV0} message GetContestedResourcesRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetContestedResourcesRequestV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetContestedResourcesRequestV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0} GetContestedResourcesRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetContestedResourcesRequestV0.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.org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.contractId = reader.bytes(); + break; + case 2: + message.documentTypeName = reader.string(); + break; + case 3: + message.indexName = reader.string(); + break; + case 4: + if (!(message.startIndexValues && message.startIndexValues.length)) + message.startIndexValues = []; + message.startIndexValues.push(reader.bytes()); + break; + case 5: + if (!(message.endIndexValues && message.endIndexValues.length)) + message.endIndexValues = []; + message.endIndexValues.push(reader.bytes()); + break; + case 6: + message.startAtValueInfo = $root.org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfo.decode(reader, reader.uint32()); + break; + case 7: + message.count = reader.uint32(); + break; + case 8: + message.orderAscending = reader.bool(); + break; + case 9: + message.prove = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetContestedResourcesRequestV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0} GetContestedResourcesRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetContestedResourcesRequestV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetContestedResourcesRequestV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetContestedResourcesRequestV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.contractId != null && message.hasOwnProperty("contractId")) + if (!(message.contractId && typeof message.contractId.length === "number" || $util.isString(message.contractId))) + return "contractId: buffer expected"; + if (message.documentTypeName != null && message.hasOwnProperty("documentTypeName")) + if (!$util.isString(message.documentTypeName)) + return "documentTypeName: string expected"; + if (message.indexName != null && message.hasOwnProperty("indexName")) + if (!$util.isString(message.indexName)) + return "indexName: string expected"; + if (message.startIndexValues != null && message.hasOwnProperty("startIndexValues")) { + if (!Array.isArray(message.startIndexValues)) + return "startIndexValues: array expected"; + for (var i = 0; i < message.startIndexValues.length; ++i) + if (!(message.startIndexValues[i] && typeof message.startIndexValues[i].length === "number" || $util.isString(message.startIndexValues[i]))) + return "startIndexValues: buffer[] expected"; + } + if (message.endIndexValues != null && message.hasOwnProperty("endIndexValues")) { + if (!Array.isArray(message.endIndexValues)) + return "endIndexValues: array expected"; + for (var i = 0; i < message.endIndexValues.length; ++i) + if (!(message.endIndexValues[i] && typeof message.endIndexValues[i].length === "number" || $util.isString(message.endIndexValues[i]))) + return "endIndexValues: buffer[] expected"; + } + if (message.startAtValueInfo != null && message.hasOwnProperty("startAtValueInfo")) { + var error = $root.org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfo.verify(message.startAtValueInfo); + if (error) + return "startAtValueInfo." + error; + } + if (message.count != null && message.hasOwnProperty("count")) + if (!$util.isInteger(message.count)) + return "count: integer expected"; + if (message.orderAscending != null && message.hasOwnProperty("orderAscending")) + if (typeof message.orderAscending !== "boolean") + return "orderAscending: boolean expected"; + if (message.prove != null && message.hasOwnProperty("prove")) + if (typeof message.prove !== "boolean") + return "prove: boolean expected"; + return null; + }; + + /** + * Creates a GetContestedResourcesRequestV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0} GetContestedResourcesRequestV0 + */ + GetContestedResourcesRequestV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0(); + if (object.contractId != null) + if (typeof object.contractId === "string") + $util.base64.decode(object.contractId, message.contractId = $util.newBuffer($util.base64.length(object.contractId)), 0); + else if (object.contractId.length >= 0) + message.contractId = object.contractId; + if (object.documentTypeName != null) + message.documentTypeName = String(object.documentTypeName); + if (object.indexName != null) + message.indexName = String(object.indexName); + if (object.startIndexValues) { + if (!Array.isArray(object.startIndexValues)) + throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.startIndexValues: array expected"); + message.startIndexValues = []; + for (var i = 0; i < object.startIndexValues.length; ++i) + if (typeof object.startIndexValues[i] === "string") + $util.base64.decode(object.startIndexValues[i], message.startIndexValues[i] = $util.newBuffer($util.base64.length(object.startIndexValues[i])), 0); + else if (object.startIndexValues[i].length >= 0) + message.startIndexValues[i] = object.startIndexValues[i]; + } + if (object.endIndexValues) { + if (!Array.isArray(object.endIndexValues)) + throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.endIndexValues: array expected"); + message.endIndexValues = []; + for (var i = 0; i < object.endIndexValues.length; ++i) + if (typeof object.endIndexValues[i] === "string") + $util.base64.decode(object.endIndexValues[i], message.endIndexValues[i] = $util.newBuffer($util.base64.length(object.endIndexValues[i])), 0); + else if (object.endIndexValues[i].length >= 0) + message.endIndexValues[i] = object.endIndexValues[i]; + } + if (object.startAtValueInfo != null) { + if (typeof object.startAtValueInfo !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.startAtValueInfo: object expected"); + message.startAtValueInfo = $root.org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfo.fromObject(object.startAtValueInfo); + } + if (object.count != null) + message.count = object.count >>> 0; + if (object.orderAscending != null) + message.orderAscending = Boolean(object.orderAscending); + if (object.prove != null) + message.prove = Boolean(object.prove); + return message; + }; + + /** + * Creates a plain object from a GetContestedResourcesRequestV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0} message GetContestedResourcesRequestV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetContestedResourcesRequestV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.startIndexValues = []; + object.endIndexValues = []; + } + if (options.defaults) { + if (options.bytes === String) + object.contractId = ""; + else { + object.contractId = []; + if (options.bytes !== Array) + object.contractId = $util.newBuffer(object.contractId); + } + object.documentTypeName = ""; + object.indexName = ""; + object.startAtValueInfo = null; + object.count = 0; + object.orderAscending = false; + object.prove = false; + } + if (message.contractId != null && message.hasOwnProperty("contractId")) + object.contractId = options.bytes === String ? $util.base64.encode(message.contractId, 0, message.contractId.length) : options.bytes === Array ? Array.prototype.slice.call(message.contractId) : message.contractId; + if (message.documentTypeName != null && message.hasOwnProperty("documentTypeName")) + object.documentTypeName = message.documentTypeName; + if (message.indexName != null && message.hasOwnProperty("indexName")) + object.indexName = message.indexName; + if (message.startIndexValues && message.startIndexValues.length) { + object.startIndexValues = []; + for (var j = 0; j < message.startIndexValues.length; ++j) + object.startIndexValues[j] = options.bytes === String ? $util.base64.encode(message.startIndexValues[j], 0, message.startIndexValues[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.startIndexValues[j]) : message.startIndexValues[j]; + } + if (message.endIndexValues && message.endIndexValues.length) { + object.endIndexValues = []; + for (var j = 0; j < message.endIndexValues.length; ++j) + object.endIndexValues[j] = options.bytes === String ? $util.base64.encode(message.endIndexValues[j], 0, message.endIndexValues[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.endIndexValues[j]) : message.endIndexValues[j]; + } + if (message.startAtValueInfo != null && message.hasOwnProperty("startAtValueInfo")) + object.startAtValueInfo = $root.org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfo.toObject(message.startAtValueInfo, options); + if (message.count != null && message.hasOwnProperty("count")) + object.count = message.count; + if (message.orderAscending != null && message.hasOwnProperty("orderAscending")) + object.orderAscending = message.orderAscending; + if (message.prove != null && message.hasOwnProperty("prove")) + object.prove = message.prove; + return object; + }; + + /** + * Converts this GetContestedResourcesRequestV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0 + * @instance + * @returns {Object.} JSON object + */ + GetContestedResourcesRequestV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetContestedResourcesRequestV0.StartAtValueInfo = (function() { + + /** + * Properties of a StartAtValueInfo. + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0 + * @interface IStartAtValueInfo + * @property {Uint8Array|null} [startValue] StartAtValueInfo startValue + * @property {boolean|null} [startValueIncluded] StartAtValueInfo startValueIncluded + */ + + /** + * Constructs a new StartAtValueInfo. + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0 + * @classdesc Represents a StartAtValueInfo. + * @implements IStartAtValueInfo + * @constructor + * @param {org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.IStartAtValueInfo=} [properties] Properties to set + */ + function StartAtValueInfo(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]]; + } + + /** + * StartAtValueInfo startValue. + * @member {Uint8Array} startValue + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfo + * @instance + */ + StartAtValueInfo.prototype.startValue = $util.newBuffer([]); + + /** + * StartAtValueInfo startValueIncluded. + * @member {boolean} startValueIncluded + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfo + * @instance + */ + StartAtValueInfo.prototype.startValueIncluded = false; + + /** + * Creates a new StartAtValueInfo instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfo + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.IStartAtValueInfo=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfo} StartAtValueInfo instance + */ + StartAtValueInfo.create = function create(properties) { + return new StartAtValueInfo(properties); + }; + + /** + * Encodes the specified StartAtValueInfo message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfo.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfo + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.IStartAtValueInfo} message StartAtValueInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StartAtValueInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.startValue != null && Object.hasOwnProperty.call(message, "startValue")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.startValue); + if (message.startValueIncluded != null && Object.hasOwnProperty.call(message, "startValueIncluded")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.startValueIncluded); + return writer; + }; + + /** + * Encodes the specified StartAtValueInfo message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfo + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.IStartAtValueInfo} message StartAtValueInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StartAtValueInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StartAtValueInfo message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfo} StartAtValueInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StartAtValueInfo.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.org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.startValue = reader.bytes(); + break; + case 2: + message.startValueIncluded = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StartAtValueInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfo} StartAtValueInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StartAtValueInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StartAtValueInfo message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StartAtValueInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.startValue != null && message.hasOwnProperty("startValue")) + if (!(message.startValue && typeof message.startValue.length === "number" || $util.isString(message.startValue))) + return "startValue: buffer expected"; + if (message.startValueIncluded != null && message.hasOwnProperty("startValueIncluded")) + if (typeof message.startValueIncluded !== "boolean") + return "startValueIncluded: boolean expected"; + return null; + }; + + /** + * Creates a StartAtValueInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfo + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfo} StartAtValueInfo + */ + StartAtValueInfo.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfo) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfo(); + if (object.startValue != null) + if (typeof object.startValue === "string") + $util.base64.decode(object.startValue, message.startValue = $util.newBuffer($util.base64.length(object.startValue)), 0); + else if (object.startValue.length >= 0) + message.startValue = object.startValue; + if (object.startValueIncluded != null) + message.startValueIncluded = Boolean(object.startValueIncluded); + return message; + }; + + /** + * Creates a plain object from a StartAtValueInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfo + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfo} message StartAtValueInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StartAtValueInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.startValue = ""; + else { + object.startValue = []; + if (options.bytes !== Array) + object.startValue = $util.newBuffer(object.startValue); + } + object.startValueIncluded = false; + } + if (message.startValue != null && message.hasOwnProperty("startValue")) + object.startValue = options.bytes === String ? $util.base64.encode(message.startValue, 0, message.startValue.length) : options.bytes === Array ? Array.prototype.slice.call(message.startValue) : message.startValue; + if (message.startValueIncluded != null && message.hasOwnProperty("startValueIncluded")) + object.startValueIncluded = message.startValueIncluded; + return object; + }; + + /** + * Converts this StartAtValueInfo to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfo + * @instance + * @returns {Object.} JSON object + */ + StartAtValueInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return StartAtValueInfo; + })(); + + return GetContestedResourcesRequestV0; + })(); + + return GetContestedResourcesRequest; + })(); + + v0.GetContestedResourcesResponse = (function() { + + /** + * Properties of a GetContestedResourcesResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetContestedResourcesResponse + * @property {org.dash.platform.dapi.v0.GetContestedResourcesResponse.IGetContestedResourcesResponseV0|null} [v0] GetContestedResourcesResponse v0 + */ + + /** + * Constructs a new GetContestedResourcesResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetContestedResourcesResponse. + * @implements IGetContestedResourcesResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IGetContestedResourcesResponse=} [properties] Properties to set + */ + function GetContestedResourcesResponse(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]]; + } + + /** + * GetContestedResourcesResponse v0. + * @member {org.dash.platform.dapi.v0.GetContestedResourcesResponse.IGetContestedResourcesResponseV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse + * @instance + */ + GetContestedResourcesResponse.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetContestedResourcesResponse version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse + * @instance + */ + Object.defineProperty(GetContestedResourcesResponse.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetContestedResourcesResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetContestedResourcesResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetContestedResourcesResponse} GetContestedResourcesResponse instance + */ + GetContestedResourcesResponse.create = function create(properties) { + return new GetContestedResourcesResponse(properties); + }; + + /** + * Encodes the specified GetContestedResourcesResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourcesResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetContestedResourcesResponse} message GetContestedResourcesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetContestedResourcesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetContestedResourcesResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourcesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetContestedResourcesResponse} message GetContestedResourcesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetContestedResourcesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetContestedResourcesResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetContestedResourcesResponse} GetContestedResourcesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetContestedResourcesResponse.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.org.dash.platform.dapi.v0.GetContestedResourcesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetContestedResourcesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetContestedResourcesResponse} GetContestedResourcesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetContestedResourcesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetContestedResourcesResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetContestedResourcesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetContestedResourcesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetContestedResourcesResponse} GetContestedResourcesResponse + */ + GetContestedResourcesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourcesResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetContestedResourcesResponse(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourcesResponse.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetContestedResourcesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourcesResponse} message GetContestedResourcesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetContestedResourcesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetContestedResourcesResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse + * @instance + * @returns {Object.} JSON object + */ + GetContestedResourcesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetContestedResourcesResponse.GetContestedResourcesResponseV0 = (function() { + + /** + * Properties of a GetContestedResourcesResponseV0. + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse + * @interface IGetContestedResourcesResponseV0 + * @property {org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.IContestedResourceValues|null} [contestedResourceValues] GetContestedResourcesResponseV0 contestedResourceValues + * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetContestedResourcesResponseV0 proof + * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetContestedResourcesResponseV0 metadata + */ + + /** + * Constructs a new GetContestedResourcesResponseV0. + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse + * @classdesc Represents a GetContestedResourcesResponseV0. + * @implements IGetContestedResourcesResponseV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetContestedResourcesResponse.IGetContestedResourcesResponseV0=} [properties] Properties to set + */ + function GetContestedResourcesResponseV0(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]]; + } + + /** + * GetContestedResourcesResponseV0 contestedResourceValues. + * @member {org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.IContestedResourceValues|null|undefined} contestedResourceValues + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0 + * @instance + */ + GetContestedResourcesResponseV0.prototype.contestedResourceValues = null; + + /** + * GetContestedResourcesResponseV0 proof. + * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0 + * @instance + */ + GetContestedResourcesResponseV0.prototype.proof = null; + + /** + * GetContestedResourcesResponseV0 metadata. + * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0 + * @instance + */ + GetContestedResourcesResponseV0.prototype.metadata = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetContestedResourcesResponseV0 result. + * @member {"contestedResourceValues"|"proof"|undefined} result + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0 + * @instance + */ + Object.defineProperty(GetContestedResourcesResponseV0.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["contestedResourceValues", "proof"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetContestedResourcesResponseV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourcesResponse.IGetContestedResourcesResponseV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0} GetContestedResourcesResponseV0 instance + */ + GetContestedResourcesResponseV0.create = function create(properties) { + return new GetContestedResourcesResponseV0(properties); + }; + + /** + * Encodes the specified GetContestedResourcesResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourcesResponse.IGetContestedResourcesResponseV0} message GetContestedResourcesResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetContestedResourcesResponseV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.contestedResourceValues != null && Object.hasOwnProperty.call(message, "contestedResourceValues")) + $root.org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValues.encode(message.contestedResourceValues, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetContestedResourcesResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourcesResponse.IGetContestedResourcesResponseV0} message GetContestedResourcesResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetContestedResourcesResponseV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetContestedResourcesResponseV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0} GetContestedResourcesResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetContestedResourcesResponseV0.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.org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.contestedResourceValues = $root.org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValues.decode(reader, reader.uint32()); + break; + case 2: + message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); + break; + case 3: + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetContestedResourcesResponseV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0} GetContestedResourcesResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetContestedResourcesResponseV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetContestedResourcesResponseV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetContestedResourcesResponseV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.contestedResourceValues != null && message.hasOwnProperty("contestedResourceValues")) { + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValues.verify(message.contestedResourceValues); + if (error) + return "contestedResourceValues." + error; + } + } + if (message.proof != null && message.hasOwnProperty("proof")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); + if (error) + return "proof." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a GetContestedResourcesResponseV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0} GetContestedResourcesResponseV0 + */ + GetContestedResourcesResponseV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0(); + if (object.contestedResourceValues != null) { + if (typeof object.contestedResourceValues !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.contestedResourceValues: object expected"); + message.contestedResourceValues = $root.org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValues.fromObject(object.contestedResourceValues); + } + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.proof: object expected"); + message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.metadata: object expected"); + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a GetContestedResourcesResponseV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0} message GetContestedResourcesResponseV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetContestedResourcesResponseV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.metadata = null; + if (message.contestedResourceValues != null && message.hasOwnProperty("contestedResourceValues")) { + object.contestedResourceValues = $root.org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValues.toObject(message.contestedResourceValues, options); + if (options.oneofs) + object.result = "contestedResourceValues"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); + if (options.oneofs) + object.result = "proof"; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this GetContestedResourcesResponseV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0 + * @instance + * @returns {Object.} JSON object + */ + GetContestedResourcesResponseV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetContestedResourcesResponseV0.ContestedResourceValues = (function() { + + /** + * Properties of a ContestedResourceValues. + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0 + * @interface IContestedResourceValues + * @property {Array.|null} [contestedResourceValues] ContestedResourceValues contestedResourceValues + */ + + /** + * Constructs a new ContestedResourceValues. + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0 + * @classdesc Represents a ContestedResourceValues. + * @implements IContestedResourceValues + * @constructor + * @param {org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.IContestedResourceValues=} [properties] Properties to set + */ + function ContestedResourceValues(properties) { + this.contestedResourceValues = []; + 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]]; + } + + /** + * ContestedResourceValues contestedResourceValues. + * @member {Array.} contestedResourceValues + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValues + * @instance + */ + ContestedResourceValues.prototype.contestedResourceValues = $util.emptyArray; + + /** + * Creates a new ContestedResourceValues instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValues + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.IContestedResourceValues=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValues} ContestedResourceValues instance + */ + ContestedResourceValues.create = function create(properties) { + return new ContestedResourceValues(properties); + }; + + /** + * Encodes the specified ContestedResourceValues message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValues.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValues + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.IContestedResourceValues} message ContestedResourceValues message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContestedResourceValues.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.contestedResourceValues != null && message.contestedResourceValues.length) + for (var i = 0; i < message.contestedResourceValues.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.contestedResourceValues[i]); + return writer; + }; + + /** + * Encodes the specified ContestedResourceValues message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValues.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValues + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.IContestedResourceValues} message ContestedResourceValues message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContestedResourceValues.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ContestedResourceValues message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValues + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValues} ContestedResourceValues + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContestedResourceValues.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.org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValues(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.contestedResourceValues && message.contestedResourceValues.length)) + message.contestedResourceValues = []; + message.contestedResourceValues.push(reader.bytes()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ContestedResourceValues message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValues + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValues} ContestedResourceValues + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContestedResourceValues.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ContestedResourceValues message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValues + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ContestedResourceValues.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.contestedResourceValues != null && message.hasOwnProperty("contestedResourceValues")) { + if (!Array.isArray(message.contestedResourceValues)) + return "contestedResourceValues: array expected"; + for (var i = 0; i < message.contestedResourceValues.length; ++i) + if (!(message.contestedResourceValues[i] && typeof message.contestedResourceValues[i].length === "number" || $util.isString(message.contestedResourceValues[i]))) + return "contestedResourceValues: buffer[] expected"; + } + return null; + }; + + /** + * Creates a ContestedResourceValues message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValues + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValues} ContestedResourceValues + */ + ContestedResourceValues.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValues) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValues(); + if (object.contestedResourceValues) { + if (!Array.isArray(object.contestedResourceValues)) + throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValues.contestedResourceValues: array expected"); + message.contestedResourceValues = []; + for (var i = 0; i < object.contestedResourceValues.length; ++i) + if (typeof object.contestedResourceValues[i] === "string") + $util.base64.decode(object.contestedResourceValues[i], message.contestedResourceValues[i] = $util.newBuffer($util.base64.length(object.contestedResourceValues[i])), 0); + else if (object.contestedResourceValues[i].length >= 0) + message.contestedResourceValues[i] = object.contestedResourceValues[i]; + } + return message; + }; + + /** + * Creates a plain object from a ContestedResourceValues message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValues + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValues} message ContestedResourceValues + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ContestedResourceValues.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.contestedResourceValues = []; + if (message.contestedResourceValues && message.contestedResourceValues.length) { + object.contestedResourceValues = []; + for (var j = 0; j < message.contestedResourceValues.length; ++j) + object.contestedResourceValues[j] = options.bytes === String ? $util.base64.encode(message.contestedResourceValues[j], 0, message.contestedResourceValues[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.contestedResourceValues[j]) : message.contestedResourceValues[j]; + } + return object; + }; + + /** + * Converts this ContestedResourceValues to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValues + * @instance + * @returns {Object.} JSON object + */ + ContestedResourceValues.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ContestedResourceValues; + })(); + + return GetContestedResourcesResponseV0; + })(); + + return GetContestedResourcesResponse; + })(); + + v0.GetVotePollsByEndDateRequest = (function() { + + /** + * Properties of a GetVotePollsByEndDateRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetVotePollsByEndDateRequest + * @property {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.IGetVotePollsByEndDateRequestV0|null} [v0] GetVotePollsByEndDateRequest v0 + */ + + /** + * Constructs a new GetVotePollsByEndDateRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetVotePollsByEndDateRequest. + * @implements IGetVotePollsByEndDateRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IGetVotePollsByEndDateRequest=} [properties] Properties to set + */ + function GetVotePollsByEndDateRequest(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]]; + } + + /** + * GetVotePollsByEndDateRequest v0. + * @member {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.IGetVotePollsByEndDateRequestV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest + * @instance + */ + GetVotePollsByEndDateRequest.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetVotePollsByEndDateRequest version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest + * @instance + */ + Object.defineProperty(GetVotePollsByEndDateRequest.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetVotePollsByEndDateRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetVotePollsByEndDateRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest} GetVotePollsByEndDateRequest instance + */ + GetVotePollsByEndDateRequest.create = function create(properties) { + return new GetVotePollsByEndDateRequest(properties); + }; + + /** + * Encodes the specified GetVotePollsByEndDateRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetVotePollsByEndDateRequest} message GetVotePollsByEndDateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetVotePollsByEndDateRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetVotePollsByEndDateRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetVotePollsByEndDateRequest} message GetVotePollsByEndDateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetVotePollsByEndDateRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetVotePollsByEndDateRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest} GetVotePollsByEndDateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetVotePollsByEndDateRequest.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.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetVotePollsByEndDateRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest} GetVotePollsByEndDateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetVotePollsByEndDateRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetVotePollsByEndDateRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetVotePollsByEndDateRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetVotePollsByEndDateRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest} GetVotePollsByEndDateRequest + */ + GetVotePollsByEndDateRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetVotePollsByEndDateRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest + * @static + * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest} message GetVotePollsByEndDateRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetVotePollsByEndDateRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetVotePollsByEndDateRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest + * @instance + * @returns {Object.} JSON object + */ + GetVotePollsByEndDateRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0 = (function() { + + /** + * Properties of a GetVotePollsByEndDateRequestV0. + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest + * @interface IGetVotePollsByEndDateRequestV0 + * @property {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.IStartAtTimeInfo|null} [startTimeInfo] GetVotePollsByEndDateRequestV0 startTimeInfo + * @property {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.IEndAtTimeInfo|null} [endTimeInfo] GetVotePollsByEndDateRequestV0 endTimeInfo + * @property {number|null} [limit] GetVotePollsByEndDateRequestV0 limit + * @property {number|null} [offset] GetVotePollsByEndDateRequestV0 offset + * @property {boolean|null} [ascending] GetVotePollsByEndDateRequestV0 ascending + * @property {boolean|null} [prove] GetVotePollsByEndDateRequestV0 prove + */ + + /** + * Constructs a new GetVotePollsByEndDateRequestV0. + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest + * @classdesc Represents a GetVotePollsByEndDateRequestV0. + * @implements IGetVotePollsByEndDateRequestV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.IGetVotePollsByEndDateRequestV0=} [properties] Properties to set + */ + function GetVotePollsByEndDateRequestV0(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]]; + } + + /** + * GetVotePollsByEndDateRequestV0 startTimeInfo. + * @member {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.IStartAtTimeInfo|null|undefined} startTimeInfo + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0 + * @instance + */ + GetVotePollsByEndDateRequestV0.prototype.startTimeInfo = null; + + /** + * GetVotePollsByEndDateRequestV0 endTimeInfo. + * @member {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.IEndAtTimeInfo|null|undefined} endTimeInfo + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0 + * @instance + */ + GetVotePollsByEndDateRequestV0.prototype.endTimeInfo = null; + + /** + * GetVotePollsByEndDateRequestV0 limit. + * @member {number} limit + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0 + * @instance + */ + GetVotePollsByEndDateRequestV0.prototype.limit = 0; + + /** + * GetVotePollsByEndDateRequestV0 offset. + * @member {number} offset + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0 + * @instance + */ + GetVotePollsByEndDateRequestV0.prototype.offset = 0; + + /** + * GetVotePollsByEndDateRequestV0 ascending. + * @member {boolean} ascending + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0 + * @instance + */ + GetVotePollsByEndDateRequestV0.prototype.ascending = false; + + /** + * GetVotePollsByEndDateRequestV0 prove. + * @member {boolean} prove + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0 + * @instance + */ + GetVotePollsByEndDateRequestV0.prototype.prove = false; + + /** + * Creates a new GetVotePollsByEndDateRequestV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.IGetVotePollsByEndDateRequestV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0} GetVotePollsByEndDateRequestV0 instance + */ + GetVotePollsByEndDateRequestV0.create = function create(properties) { + return new GetVotePollsByEndDateRequestV0(properties); + }; + + /** + * Encodes the specified GetVotePollsByEndDateRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.IGetVotePollsByEndDateRequestV0} message GetVotePollsByEndDateRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetVotePollsByEndDateRequestV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.startTimeInfo != null && Object.hasOwnProperty.call(message, "startTimeInfo")) + $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfo.encode(message.startTimeInfo, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.endTimeInfo != null && Object.hasOwnProperty.call(message, "endTimeInfo")) + $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfo.encode(message.endTimeInfo, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.limit != null && Object.hasOwnProperty.call(message, "limit")) + writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.limit); + if (message.offset != null && Object.hasOwnProperty.call(message, "offset")) + writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.offset); + if (message.ascending != null && Object.hasOwnProperty.call(message, "ascending")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.ascending); + if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.prove); + return writer; + }; + + /** + * Encodes the specified GetVotePollsByEndDateRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.IGetVotePollsByEndDateRequestV0} message GetVotePollsByEndDateRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetVotePollsByEndDateRequestV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetVotePollsByEndDateRequestV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0} GetVotePollsByEndDateRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetVotePollsByEndDateRequestV0.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.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.startTimeInfo = $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfo.decode(reader, reader.uint32()); + break; + case 2: + message.endTimeInfo = $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfo.decode(reader, reader.uint32()); + break; + case 3: + message.limit = reader.uint32(); + break; + case 4: + message.offset = reader.uint32(); + break; + case 5: + message.ascending = reader.bool(); + break; + case 6: + message.prove = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetVotePollsByEndDateRequestV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0} GetVotePollsByEndDateRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetVotePollsByEndDateRequestV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetVotePollsByEndDateRequestV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetVotePollsByEndDateRequestV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.startTimeInfo != null && message.hasOwnProperty("startTimeInfo")) { + var error = $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfo.verify(message.startTimeInfo); + if (error) + return "startTimeInfo." + error; + } + if (message.endTimeInfo != null && message.hasOwnProperty("endTimeInfo")) { + var error = $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfo.verify(message.endTimeInfo); + if (error) + return "endTimeInfo." + error; + } + if (message.limit != null && message.hasOwnProperty("limit")) + if (!$util.isInteger(message.limit)) + return "limit: integer expected"; + if (message.offset != null && message.hasOwnProperty("offset")) + if (!$util.isInteger(message.offset)) + return "offset: integer expected"; + if (message.ascending != null && message.hasOwnProperty("ascending")) + if (typeof message.ascending !== "boolean") + return "ascending: boolean expected"; + if (message.prove != null && message.hasOwnProperty("prove")) + if (typeof message.prove !== "boolean") + return "prove: boolean expected"; + return null; + }; + + /** + * Creates a GetVotePollsByEndDateRequestV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0} GetVotePollsByEndDateRequestV0 + */ + GetVotePollsByEndDateRequestV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0(); + if (object.startTimeInfo != null) { + if (typeof object.startTimeInfo !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.startTimeInfo: object expected"); + message.startTimeInfo = $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfo.fromObject(object.startTimeInfo); + } + if (object.endTimeInfo != null) { + if (typeof object.endTimeInfo !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.endTimeInfo: object expected"); + message.endTimeInfo = $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfo.fromObject(object.endTimeInfo); + } + if (object.limit != null) + message.limit = object.limit >>> 0; + if (object.offset != null) + message.offset = object.offset >>> 0; + if (object.ascending != null) + message.ascending = Boolean(object.ascending); + if (object.prove != null) + message.prove = Boolean(object.prove); + return message; + }; + + /** + * Creates a plain object from a GetVotePollsByEndDateRequestV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0} message GetVotePollsByEndDateRequestV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetVotePollsByEndDateRequestV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.startTimeInfo = null; + object.endTimeInfo = null; + object.limit = 0; + object.offset = 0; + object.ascending = false; + object.prove = false; + } + if (message.startTimeInfo != null && message.hasOwnProperty("startTimeInfo")) + object.startTimeInfo = $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfo.toObject(message.startTimeInfo, options); + if (message.endTimeInfo != null && message.hasOwnProperty("endTimeInfo")) + object.endTimeInfo = $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfo.toObject(message.endTimeInfo, options); + if (message.limit != null && message.hasOwnProperty("limit")) + object.limit = message.limit; + if (message.offset != null && message.hasOwnProperty("offset")) + object.offset = message.offset; + if (message.ascending != null && message.hasOwnProperty("ascending")) + object.ascending = message.ascending; + if (message.prove != null && message.hasOwnProperty("prove")) + object.prove = message.prove; + return object; + }; + + /** + * Converts this GetVotePollsByEndDateRequestV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0 + * @instance + * @returns {Object.} JSON object + */ + GetVotePollsByEndDateRequestV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetVotePollsByEndDateRequestV0.StartAtTimeInfo = (function() { + + /** + * Properties of a StartAtTimeInfo. + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0 + * @interface IStartAtTimeInfo + * @property {number|Long|null} [startTimeMs] StartAtTimeInfo startTimeMs + * @property {boolean|null} [startTimeIncluded] StartAtTimeInfo startTimeIncluded + */ + + /** + * Constructs a new StartAtTimeInfo. + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0 + * @classdesc Represents a StartAtTimeInfo. + * @implements IStartAtTimeInfo + * @constructor + * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.IStartAtTimeInfo=} [properties] Properties to set + */ + function StartAtTimeInfo(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]]; + } + + /** + * StartAtTimeInfo startTimeMs. + * @member {number|Long} startTimeMs + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfo + * @instance + */ + StartAtTimeInfo.prototype.startTimeMs = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * StartAtTimeInfo startTimeIncluded. + * @member {boolean} startTimeIncluded + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfo + * @instance + */ + StartAtTimeInfo.prototype.startTimeIncluded = false; + + /** + * Creates a new StartAtTimeInfo instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfo + * @static + * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.IStartAtTimeInfo=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfo} StartAtTimeInfo instance + */ + StartAtTimeInfo.create = function create(properties) { + return new StartAtTimeInfo(properties); + }; + + /** + * Encodes the specified StartAtTimeInfo message. Does not implicitly {@link org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfo.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfo + * @static + * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.IStartAtTimeInfo} message StartAtTimeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StartAtTimeInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.startTimeMs != null && Object.hasOwnProperty.call(message, "startTimeMs")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.startTimeMs); + if (message.startTimeIncluded != null && Object.hasOwnProperty.call(message, "startTimeIncluded")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.startTimeIncluded); + return writer; + }; + + /** + * Encodes the specified StartAtTimeInfo message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfo + * @static + * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.IStartAtTimeInfo} message StartAtTimeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StartAtTimeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StartAtTimeInfo message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfo} StartAtTimeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StartAtTimeInfo.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.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.startTimeMs = reader.uint64(); + break; + case 2: + message.startTimeIncluded = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StartAtTimeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfo} StartAtTimeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StartAtTimeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StartAtTimeInfo message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StartAtTimeInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.startTimeMs != null && message.hasOwnProperty("startTimeMs")) + if (!$util.isInteger(message.startTimeMs) && !(message.startTimeMs && $util.isInteger(message.startTimeMs.low) && $util.isInteger(message.startTimeMs.high))) + return "startTimeMs: integer|Long expected"; + if (message.startTimeIncluded != null && message.hasOwnProperty("startTimeIncluded")) + if (typeof message.startTimeIncluded !== "boolean") + return "startTimeIncluded: boolean expected"; + return null; + }; + + /** + * Creates a StartAtTimeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfo + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfo} StartAtTimeInfo + */ + StartAtTimeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfo) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfo(); + if (object.startTimeMs != null) + if ($util.Long) + (message.startTimeMs = $util.Long.fromValue(object.startTimeMs)).unsigned = true; + else if (typeof object.startTimeMs === "string") + message.startTimeMs = parseInt(object.startTimeMs, 10); + else if (typeof object.startTimeMs === "number") + message.startTimeMs = object.startTimeMs; + else if (typeof object.startTimeMs === "object") + message.startTimeMs = new $util.LongBits(object.startTimeMs.low >>> 0, object.startTimeMs.high >>> 0).toNumber(true); + if (object.startTimeIncluded != null) + message.startTimeIncluded = Boolean(object.startTimeIncluded); + return message; + }; + + /** + * Creates a plain object from a StartAtTimeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfo + * @static + * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfo} message StartAtTimeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StartAtTimeInfo.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.startTimeMs = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.startTimeMs = options.longs === String ? "0" : 0; + object.startTimeIncluded = false; + } + if (message.startTimeMs != null && message.hasOwnProperty("startTimeMs")) + if (typeof message.startTimeMs === "number") + object.startTimeMs = options.longs === String ? String(message.startTimeMs) : message.startTimeMs; + else + object.startTimeMs = options.longs === String ? $util.Long.prototype.toString.call(message.startTimeMs) : options.longs === Number ? new $util.LongBits(message.startTimeMs.low >>> 0, message.startTimeMs.high >>> 0).toNumber(true) : message.startTimeMs; + if (message.startTimeIncluded != null && message.hasOwnProperty("startTimeIncluded")) + object.startTimeIncluded = message.startTimeIncluded; + return object; + }; + + /** + * Converts this StartAtTimeInfo to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfo + * @instance + * @returns {Object.} JSON object + */ + StartAtTimeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return StartAtTimeInfo; + })(); + + GetVotePollsByEndDateRequestV0.EndAtTimeInfo = (function() { + + /** + * Properties of an EndAtTimeInfo. + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0 + * @interface IEndAtTimeInfo + * @property {number|Long|null} [endTimeMs] EndAtTimeInfo endTimeMs + * @property {boolean|null} [endTimeIncluded] EndAtTimeInfo endTimeIncluded + */ + + /** + * Constructs a new EndAtTimeInfo. + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0 + * @classdesc Represents an EndAtTimeInfo. + * @implements IEndAtTimeInfo + * @constructor + * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.IEndAtTimeInfo=} [properties] Properties to set + */ + function EndAtTimeInfo(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]]; + } + + /** + * EndAtTimeInfo endTimeMs. + * @member {number|Long} endTimeMs + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfo + * @instance + */ + EndAtTimeInfo.prototype.endTimeMs = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * EndAtTimeInfo endTimeIncluded. + * @member {boolean} endTimeIncluded + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfo + * @instance + */ + EndAtTimeInfo.prototype.endTimeIncluded = false; + + /** + * Creates a new EndAtTimeInfo instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfo + * @static + * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.IEndAtTimeInfo=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfo} EndAtTimeInfo instance + */ + EndAtTimeInfo.create = function create(properties) { + return new EndAtTimeInfo(properties); + }; + + /** + * Encodes the specified EndAtTimeInfo message. Does not implicitly {@link org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfo.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfo + * @static + * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.IEndAtTimeInfo} message EndAtTimeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EndAtTimeInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.endTimeMs != null && Object.hasOwnProperty.call(message, "endTimeMs")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.endTimeMs); + if (message.endTimeIncluded != null && Object.hasOwnProperty.call(message, "endTimeIncluded")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.endTimeIncluded); + return writer; + }; + + /** + * Encodes the specified EndAtTimeInfo message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfo + * @static + * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.IEndAtTimeInfo} message EndAtTimeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EndAtTimeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EndAtTimeInfo message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfo} EndAtTimeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EndAtTimeInfo.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.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.endTimeMs = reader.uint64(); + break; + case 2: + message.endTimeIncluded = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EndAtTimeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfo} EndAtTimeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EndAtTimeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EndAtTimeInfo message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EndAtTimeInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.endTimeMs != null && message.hasOwnProperty("endTimeMs")) + if (!$util.isInteger(message.endTimeMs) && !(message.endTimeMs && $util.isInteger(message.endTimeMs.low) && $util.isInteger(message.endTimeMs.high))) + return "endTimeMs: integer|Long expected"; + if (message.endTimeIncluded != null && message.hasOwnProperty("endTimeIncluded")) + if (typeof message.endTimeIncluded !== "boolean") + return "endTimeIncluded: boolean expected"; + return null; + }; + + /** + * Creates an EndAtTimeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfo + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfo} EndAtTimeInfo + */ + EndAtTimeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfo) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfo(); + if (object.endTimeMs != null) + if ($util.Long) + (message.endTimeMs = $util.Long.fromValue(object.endTimeMs)).unsigned = true; + else if (typeof object.endTimeMs === "string") + message.endTimeMs = parseInt(object.endTimeMs, 10); + else if (typeof object.endTimeMs === "number") + message.endTimeMs = object.endTimeMs; + else if (typeof object.endTimeMs === "object") + message.endTimeMs = new $util.LongBits(object.endTimeMs.low >>> 0, object.endTimeMs.high >>> 0).toNumber(true); + if (object.endTimeIncluded != null) + message.endTimeIncluded = Boolean(object.endTimeIncluded); + return message; + }; + + /** + * Creates a plain object from an EndAtTimeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfo + * @static + * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfo} message EndAtTimeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EndAtTimeInfo.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.endTimeMs = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.endTimeMs = options.longs === String ? "0" : 0; + object.endTimeIncluded = false; + } + if (message.endTimeMs != null && message.hasOwnProperty("endTimeMs")) + if (typeof message.endTimeMs === "number") + object.endTimeMs = options.longs === String ? String(message.endTimeMs) : message.endTimeMs; + else + object.endTimeMs = options.longs === String ? $util.Long.prototype.toString.call(message.endTimeMs) : options.longs === Number ? new $util.LongBits(message.endTimeMs.low >>> 0, message.endTimeMs.high >>> 0).toNumber(true) : message.endTimeMs; + if (message.endTimeIncluded != null && message.hasOwnProperty("endTimeIncluded")) + object.endTimeIncluded = message.endTimeIncluded; + return object; + }; + + /** + * Converts this EndAtTimeInfo to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfo + * @instance + * @returns {Object.} JSON object + */ + EndAtTimeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return EndAtTimeInfo; + })(); + + return GetVotePollsByEndDateRequestV0; + })(); + + return GetVotePollsByEndDateRequest; + })(); + + v0.GetVotePollsByEndDateResponse = (function() { + + /** + * Properties of a GetVotePollsByEndDateResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetVotePollsByEndDateResponse + * @property {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.IGetVotePollsByEndDateResponseV0|null} [v0] GetVotePollsByEndDateResponse v0 + */ + + /** + * Constructs a new GetVotePollsByEndDateResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetVotePollsByEndDateResponse. + * @implements IGetVotePollsByEndDateResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IGetVotePollsByEndDateResponse=} [properties] Properties to set + */ + function GetVotePollsByEndDateResponse(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]]; + } + + /** + * GetVotePollsByEndDateResponse v0. + * @member {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.IGetVotePollsByEndDateResponseV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse + * @instance + */ + GetVotePollsByEndDateResponse.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetVotePollsByEndDateResponse version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse + * @instance + */ + Object.defineProperty(GetVotePollsByEndDateResponse.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetVotePollsByEndDateResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetVotePollsByEndDateResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse} GetVotePollsByEndDateResponse instance + */ + GetVotePollsByEndDateResponse.create = function create(properties) { + return new GetVotePollsByEndDateResponse(properties); + }; + + /** + * Encodes the specified GetVotePollsByEndDateResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetVotePollsByEndDateResponse} message GetVotePollsByEndDateResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetVotePollsByEndDateResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetVotePollsByEndDateResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetVotePollsByEndDateResponse} message GetVotePollsByEndDateResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetVotePollsByEndDateResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetVotePollsByEndDateResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse} GetVotePollsByEndDateResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetVotePollsByEndDateResponse.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.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetVotePollsByEndDateResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse} GetVotePollsByEndDateResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetVotePollsByEndDateResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetVotePollsByEndDateResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetVotePollsByEndDateResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetVotePollsByEndDateResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse} GetVotePollsByEndDateResponse + */ + GetVotePollsByEndDateResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetVotePollsByEndDateResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse + * @static + * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse} message GetVotePollsByEndDateResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetVotePollsByEndDateResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetVotePollsByEndDateResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse + * @instance + * @returns {Object.} JSON object + */ + GetVotePollsByEndDateResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0 = (function() { + + /** + * Properties of a GetVotePollsByEndDateResponseV0. + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse + * @interface IGetVotePollsByEndDateResponseV0 + * @property {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.ISerializedVotePollsByTimestamps|null} [votePollsByTimestamps] GetVotePollsByEndDateResponseV0 votePollsByTimestamps + * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetVotePollsByEndDateResponseV0 proof + * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetVotePollsByEndDateResponseV0 metadata + */ + + /** + * Constructs a new GetVotePollsByEndDateResponseV0. + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse + * @classdesc Represents a GetVotePollsByEndDateResponseV0. + * @implements IGetVotePollsByEndDateResponseV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.IGetVotePollsByEndDateResponseV0=} [properties] Properties to set + */ + function GetVotePollsByEndDateResponseV0(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]]; + } + + /** + * GetVotePollsByEndDateResponseV0 votePollsByTimestamps. + * @member {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.ISerializedVotePollsByTimestamps|null|undefined} votePollsByTimestamps + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0 + * @instance + */ + GetVotePollsByEndDateResponseV0.prototype.votePollsByTimestamps = null; + + /** + * GetVotePollsByEndDateResponseV0 proof. + * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0 + * @instance + */ + GetVotePollsByEndDateResponseV0.prototype.proof = null; + + /** + * GetVotePollsByEndDateResponseV0 metadata. + * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0 + * @instance + */ + GetVotePollsByEndDateResponseV0.prototype.metadata = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetVotePollsByEndDateResponseV0 result. + * @member {"votePollsByTimestamps"|"proof"|undefined} result + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0 + * @instance + */ + Object.defineProperty(GetVotePollsByEndDateResponseV0.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["votePollsByTimestamps", "proof"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetVotePollsByEndDateResponseV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.IGetVotePollsByEndDateResponseV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0} GetVotePollsByEndDateResponseV0 instance + */ + GetVotePollsByEndDateResponseV0.create = function create(properties) { + return new GetVotePollsByEndDateResponseV0(properties); + }; + + /** + * Encodes the specified GetVotePollsByEndDateResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.IGetVotePollsByEndDateResponseV0} message GetVotePollsByEndDateResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetVotePollsByEndDateResponseV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.votePollsByTimestamps != null && Object.hasOwnProperty.call(message, "votePollsByTimestamps")) + $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps.encode(message.votePollsByTimestamps, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetVotePollsByEndDateResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.IGetVotePollsByEndDateResponseV0} message GetVotePollsByEndDateResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetVotePollsByEndDateResponseV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetVotePollsByEndDateResponseV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0} GetVotePollsByEndDateResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetVotePollsByEndDateResponseV0.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.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.votePollsByTimestamps = $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps.decode(reader, reader.uint32()); + break; + case 2: + message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); + break; + case 3: + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetVotePollsByEndDateResponseV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0} GetVotePollsByEndDateResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetVotePollsByEndDateResponseV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetVotePollsByEndDateResponseV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetVotePollsByEndDateResponseV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.votePollsByTimestamps != null && message.hasOwnProperty("votePollsByTimestamps")) { + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps.verify(message.votePollsByTimestamps); + if (error) + return "votePollsByTimestamps." + error; + } + } + if (message.proof != null && message.hasOwnProperty("proof")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); + if (error) + return "proof." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a GetVotePollsByEndDateResponseV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0} GetVotePollsByEndDateResponseV0 + */ + GetVotePollsByEndDateResponseV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0(); + if (object.votePollsByTimestamps != null) { + if (typeof object.votePollsByTimestamps !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.votePollsByTimestamps: object expected"); + message.votePollsByTimestamps = $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps.fromObject(object.votePollsByTimestamps); + } + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.proof: object expected"); + message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.metadata: object expected"); + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a GetVotePollsByEndDateResponseV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0} message GetVotePollsByEndDateResponseV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetVotePollsByEndDateResponseV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.metadata = null; + if (message.votePollsByTimestamps != null && message.hasOwnProperty("votePollsByTimestamps")) { + object.votePollsByTimestamps = $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps.toObject(message.votePollsByTimestamps, options); + if (options.oneofs) + object.result = "votePollsByTimestamps"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); + if (options.oneofs) + object.result = "proof"; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this GetVotePollsByEndDateResponseV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0 + * @instance + * @returns {Object.} JSON object + */ + GetVotePollsByEndDateResponseV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp = (function() { + + /** + * Properties of a SerializedVotePollsByTimestamp. + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0 + * @interface ISerializedVotePollsByTimestamp + * @property {number|Long|null} [timestamp] SerializedVotePollsByTimestamp timestamp + * @property {Array.|null} [serializedVotePolls] SerializedVotePollsByTimestamp serializedVotePolls + */ + + /** + * Constructs a new SerializedVotePollsByTimestamp. + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0 + * @classdesc Represents a SerializedVotePollsByTimestamp. + * @implements ISerializedVotePollsByTimestamp + * @constructor + * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.ISerializedVotePollsByTimestamp=} [properties] Properties to set + */ + function SerializedVotePollsByTimestamp(properties) { + this.serializedVotePolls = []; + 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]]; + } + + /** + * SerializedVotePollsByTimestamp timestamp. + * @member {number|Long} timestamp + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp + * @instance + */ + SerializedVotePollsByTimestamp.prototype.timestamp = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * SerializedVotePollsByTimestamp serializedVotePolls. + * @member {Array.} serializedVotePolls + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp + * @instance + */ + SerializedVotePollsByTimestamp.prototype.serializedVotePolls = $util.emptyArray; + + /** + * Creates a new SerializedVotePollsByTimestamp instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp + * @static + * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.ISerializedVotePollsByTimestamp=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp} SerializedVotePollsByTimestamp instance + */ + SerializedVotePollsByTimestamp.create = function create(properties) { + return new SerializedVotePollsByTimestamp(properties); + }; + + /** + * Encodes the specified SerializedVotePollsByTimestamp message. Does not implicitly {@link org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp + * @static + * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.ISerializedVotePollsByTimestamp} message SerializedVotePollsByTimestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SerializedVotePollsByTimestamp.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.timestamp != null && Object.hasOwnProperty.call(message, "timestamp")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.timestamp); + if (message.serializedVotePolls != null && message.serializedVotePolls.length) + for (var i = 0; i < message.serializedVotePolls.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.serializedVotePolls[i]); + return writer; + }; + + /** + * Encodes the specified SerializedVotePollsByTimestamp message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp + * @static + * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.ISerializedVotePollsByTimestamp} message SerializedVotePollsByTimestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SerializedVotePollsByTimestamp.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SerializedVotePollsByTimestamp message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp} SerializedVotePollsByTimestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SerializedVotePollsByTimestamp.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.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.timestamp = reader.uint64(); + break; + case 2: + if (!(message.serializedVotePolls && message.serializedVotePolls.length)) + message.serializedVotePolls = []; + message.serializedVotePolls.push(reader.bytes()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SerializedVotePollsByTimestamp message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp} SerializedVotePollsByTimestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SerializedVotePollsByTimestamp.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SerializedVotePollsByTimestamp message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SerializedVotePollsByTimestamp.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.timestamp != null && message.hasOwnProperty("timestamp")) + if (!$util.isInteger(message.timestamp) && !(message.timestamp && $util.isInteger(message.timestamp.low) && $util.isInteger(message.timestamp.high))) + return "timestamp: integer|Long expected"; + if (message.serializedVotePolls != null && message.hasOwnProperty("serializedVotePolls")) { + if (!Array.isArray(message.serializedVotePolls)) + return "serializedVotePolls: array expected"; + for (var i = 0; i < message.serializedVotePolls.length; ++i) + if (!(message.serializedVotePolls[i] && typeof message.serializedVotePolls[i].length === "number" || $util.isString(message.serializedVotePolls[i]))) + return "serializedVotePolls: buffer[] expected"; + } + return null; + }; + + /** + * Creates a SerializedVotePollsByTimestamp message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp} SerializedVotePollsByTimestamp + */ + SerializedVotePollsByTimestamp.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp(); + if (object.timestamp != null) + if ($util.Long) + (message.timestamp = $util.Long.fromValue(object.timestamp)).unsigned = true; + else if (typeof object.timestamp === "string") + message.timestamp = parseInt(object.timestamp, 10); + else if (typeof object.timestamp === "number") + message.timestamp = object.timestamp; + else if (typeof object.timestamp === "object") + message.timestamp = new $util.LongBits(object.timestamp.low >>> 0, object.timestamp.high >>> 0).toNumber(true); + if (object.serializedVotePolls) { + if (!Array.isArray(object.serializedVotePolls)) + throw TypeError(".org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp.serializedVotePolls: array expected"); + message.serializedVotePolls = []; + for (var i = 0; i < object.serializedVotePolls.length; ++i) + if (typeof object.serializedVotePolls[i] === "string") + $util.base64.decode(object.serializedVotePolls[i], message.serializedVotePolls[i] = $util.newBuffer($util.base64.length(object.serializedVotePolls[i])), 0); + else if (object.serializedVotePolls[i].length >= 0) + message.serializedVotePolls[i] = object.serializedVotePolls[i]; + } + return message; + }; + + /** + * Creates a plain object from a SerializedVotePollsByTimestamp message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp + * @static + * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp} message SerializedVotePollsByTimestamp + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SerializedVotePollsByTimestamp.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.serializedVotePolls = []; + if (options.defaults) + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.timestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.timestamp = options.longs === String ? "0" : 0; + if (message.timestamp != null && message.hasOwnProperty("timestamp")) + if (typeof message.timestamp === "number") + object.timestamp = options.longs === String ? String(message.timestamp) : message.timestamp; + else + object.timestamp = options.longs === String ? $util.Long.prototype.toString.call(message.timestamp) : options.longs === Number ? new $util.LongBits(message.timestamp.low >>> 0, message.timestamp.high >>> 0).toNumber(true) : message.timestamp; + if (message.serializedVotePolls && message.serializedVotePolls.length) { + object.serializedVotePolls = []; + for (var j = 0; j < message.serializedVotePolls.length; ++j) + object.serializedVotePolls[j] = options.bytes === String ? $util.base64.encode(message.serializedVotePolls[j], 0, message.serializedVotePolls[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.serializedVotePolls[j]) : message.serializedVotePolls[j]; + } + return object; + }; + + /** + * Converts this SerializedVotePollsByTimestamp to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp + * @instance + * @returns {Object.} JSON object + */ + SerializedVotePollsByTimestamp.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SerializedVotePollsByTimestamp; + })(); + + GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps = (function() { + + /** + * Properties of a SerializedVotePollsByTimestamps. + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0 + * @interface ISerializedVotePollsByTimestamps + * @property {Array.|null} [votePollsByTimestamps] SerializedVotePollsByTimestamps votePollsByTimestamps + * @property {boolean|null} [finishedResults] SerializedVotePollsByTimestamps finishedResults + */ + + /** + * Constructs a new SerializedVotePollsByTimestamps. + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0 + * @classdesc Represents a SerializedVotePollsByTimestamps. + * @implements ISerializedVotePollsByTimestamps + * @constructor + * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.ISerializedVotePollsByTimestamps=} [properties] Properties to set + */ + function SerializedVotePollsByTimestamps(properties) { + this.votePollsByTimestamps = []; + 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]]; + } + + /** + * SerializedVotePollsByTimestamps votePollsByTimestamps. + * @member {Array.} votePollsByTimestamps + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps + * @instance + */ + SerializedVotePollsByTimestamps.prototype.votePollsByTimestamps = $util.emptyArray; + + /** + * SerializedVotePollsByTimestamps finishedResults. + * @member {boolean} finishedResults + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps + * @instance + */ + SerializedVotePollsByTimestamps.prototype.finishedResults = false; + + /** + * Creates a new SerializedVotePollsByTimestamps instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps + * @static + * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.ISerializedVotePollsByTimestamps=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps} SerializedVotePollsByTimestamps instance + */ + SerializedVotePollsByTimestamps.create = function create(properties) { + return new SerializedVotePollsByTimestamps(properties); + }; + + /** + * Encodes the specified SerializedVotePollsByTimestamps message. Does not implicitly {@link org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps + * @static + * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.ISerializedVotePollsByTimestamps} message SerializedVotePollsByTimestamps message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SerializedVotePollsByTimestamps.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.votePollsByTimestamps != null && message.votePollsByTimestamps.length) + for (var i = 0; i < message.votePollsByTimestamps.length; ++i) + $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp.encode(message.votePollsByTimestamps[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.finishedResults != null && Object.hasOwnProperty.call(message, "finishedResults")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.finishedResults); + return writer; + }; + + /** + * Encodes the specified SerializedVotePollsByTimestamps message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps + * @static + * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.ISerializedVotePollsByTimestamps} message SerializedVotePollsByTimestamps message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SerializedVotePollsByTimestamps.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SerializedVotePollsByTimestamps message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps} SerializedVotePollsByTimestamps + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SerializedVotePollsByTimestamps.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.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.votePollsByTimestamps && message.votePollsByTimestamps.length)) + message.votePollsByTimestamps = []; + message.votePollsByTimestamps.push($root.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp.decode(reader, reader.uint32())); + break; + case 2: + message.finishedResults = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SerializedVotePollsByTimestamps message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps} SerializedVotePollsByTimestamps + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SerializedVotePollsByTimestamps.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SerializedVotePollsByTimestamps message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SerializedVotePollsByTimestamps.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.votePollsByTimestamps != null && message.hasOwnProperty("votePollsByTimestamps")) { + if (!Array.isArray(message.votePollsByTimestamps)) + return "votePollsByTimestamps: array expected"; + for (var i = 0; i < message.votePollsByTimestamps.length; ++i) { + var error = $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp.verify(message.votePollsByTimestamps[i]); + if (error) + return "votePollsByTimestamps." + error; + } + } + if (message.finishedResults != null && message.hasOwnProperty("finishedResults")) + if (typeof message.finishedResults !== "boolean") + return "finishedResults: boolean expected"; + return null; + }; + + /** + * Creates a SerializedVotePollsByTimestamps message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps} SerializedVotePollsByTimestamps + */ + SerializedVotePollsByTimestamps.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps(); + if (object.votePollsByTimestamps) { + if (!Array.isArray(object.votePollsByTimestamps)) + throw TypeError(".org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps.votePollsByTimestamps: array expected"); + message.votePollsByTimestamps = []; + for (var i = 0; i < object.votePollsByTimestamps.length; ++i) { + if (typeof object.votePollsByTimestamps[i] !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps.votePollsByTimestamps: object expected"); + message.votePollsByTimestamps[i] = $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp.fromObject(object.votePollsByTimestamps[i]); + } + } + if (object.finishedResults != null) + message.finishedResults = Boolean(object.finishedResults); + return message; + }; + + /** + * Creates a plain object from a SerializedVotePollsByTimestamps message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps + * @static + * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps} message SerializedVotePollsByTimestamps + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SerializedVotePollsByTimestamps.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.votePollsByTimestamps = []; + if (options.defaults) + object.finishedResults = false; + if (message.votePollsByTimestamps && message.votePollsByTimestamps.length) { + object.votePollsByTimestamps = []; + for (var j = 0; j < message.votePollsByTimestamps.length; ++j) + object.votePollsByTimestamps[j] = $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp.toObject(message.votePollsByTimestamps[j], options); + } + if (message.finishedResults != null && message.hasOwnProperty("finishedResults")) + object.finishedResults = message.finishedResults; + return object; + }; + + /** + * Converts this SerializedVotePollsByTimestamps to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps + * @instance + * @returns {Object.} JSON object + */ + SerializedVotePollsByTimestamps.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SerializedVotePollsByTimestamps; + })(); + + return GetVotePollsByEndDateResponseV0; + })(); + + return GetVotePollsByEndDateResponse; + })(); + + v0.GetContestedResourceVoteStateRequest = (function() { + + /** + * Properties of a GetContestedResourceVoteStateRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetContestedResourceVoteStateRequest + * @property {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.IGetContestedResourceVoteStateRequestV0|null} [v0] GetContestedResourceVoteStateRequest v0 + */ + + /** + * Constructs a new GetContestedResourceVoteStateRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetContestedResourceVoteStateRequest. + * @implements IGetContestedResourceVoteStateRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IGetContestedResourceVoteStateRequest=} [properties] Properties to set + */ + function GetContestedResourceVoteStateRequest(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]]; + } + + /** + * GetContestedResourceVoteStateRequest v0. + * @member {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.IGetContestedResourceVoteStateRequestV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest + * @instance + */ + GetContestedResourceVoteStateRequest.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetContestedResourceVoteStateRequest version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest + * @instance + */ + Object.defineProperty(GetContestedResourceVoteStateRequest.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetContestedResourceVoteStateRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetContestedResourceVoteStateRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest} GetContestedResourceVoteStateRequest instance + */ + GetContestedResourceVoteStateRequest.create = function create(properties) { + return new GetContestedResourceVoteStateRequest(properties); + }; + + /** + * Encodes the specified GetContestedResourceVoteStateRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetContestedResourceVoteStateRequest} message GetContestedResourceVoteStateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetContestedResourceVoteStateRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetContestedResourceVoteStateRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetContestedResourceVoteStateRequest} message GetContestedResourceVoteStateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetContestedResourceVoteStateRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetContestedResourceVoteStateRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest} GetContestedResourceVoteStateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetContestedResourceVoteStateRequest.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.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetContestedResourceVoteStateRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest} GetContestedResourceVoteStateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetContestedResourceVoteStateRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetContestedResourceVoteStateRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetContestedResourceVoteStateRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetContestedResourceVoteStateRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest} GetContestedResourceVoteStateRequest + */ + GetContestedResourceVoteStateRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetContestedResourceVoteStateRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest} message GetContestedResourceVoteStateRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetContestedResourceVoteStateRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetContestedResourceVoteStateRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest + * @instance + * @returns {Object.} JSON object + */ + GetContestedResourceVoteStateRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0 = (function() { + + /** + * Properties of a GetContestedResourceVoteStateRequestV0. + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest + * @interface IGetContestedResourceVoteStateRequestV0 + * @property {Uint8Array|null} [contractId] GetContestedResourceVoteStateRequestV0 contractId + * @property {string|null} [documentTypeName] GetContestedResourceVoteStateRequestV0 documentTypeName + * @property {string|null} [indexName] GetContestedResourceVoteStateRequestV0 indexName + * @property {Array.|null} [indexValues] GetContestedResourceVoteStateRequestV0 indexValues + * @property {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.ResultType|null} [resultType] GetContestedResourceVoteStateRequestV0 resultType + * @property {boolean|null} [allowIncludeLockedAndAbstainingVoteTally] GetContestedResourceVoteStateRequestV0 allowIncludeLockedAndAbstainingVoteTally + * @property {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.IStartAtIdentifierInfo|null} [startAtIdentifierInfo] GetContestedResourceVoteStateRequestV0 startAtIdentifierInfo + * @property {number|null} [count] GetContestedResourceVoteStateRequestV0 count + * @property {boolean|null} [prove] GetContestedResourceVoteStateRequestV0 prove + */ + + /** + * Constructs a new GetContestedResourceVoteStateRequestV0. + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest + * @classdesc Represents a GetContestedResourceVoteStateRequestV0. + * @implements IGetContestedResourceVoteStateRequestV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.IGetContestedResourceVoteStateRequestV0=} [properties] Properties to set + */ + function GetContestedResourceVoteStateRequestV0(properties) { + this.indexValues = []; + 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]]; + } + + /** + * GetContestedResourceVoteStateRequestV0 contractId. + * @member {Uint8Array} contractId + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0 + * @instance + */ + GetContestedResourceVoteStateRequestV0.prototype.contractId = $util.newBuffer([]); + + /** + * GetContestedResourceVoteStateRequestV0 documentTypeName. + * @member {string} documentTypeName + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0 + * @instance + */ + GetContestedResourceVoteStateRequestV0.prototype.documentTypeName = ""; + + /** + * GetContestedResourceVoteStateRequestV0 indexName. + * @member {string} indexName + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0 + * @instance + */ + GetContestedResourceVoteStateRequestV0.prototype.indexName = ""; + + /** + * GetContestedResourceVoteStateRequestV0 indexValues. + * @member {Array.} indexValues + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0 + * @instance + */ + GetContestedResourceVoteStateRequestV0.prototype.indexValues = $util.emptyArray; + + /** + * GetContestedResourceVoteStateRequestV0 resultType. + * @member {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.ResultType} resultType + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0 + * @instance + */ + GetContestedResourceVoteStateRequestV0.prototype.resultType = 0; + + /** + * GetContestedResourceVoteStateRequestV0 allowIncludeLockedAndAbstainingVoteTally. + * @member {boolean} allowIncludeLockedAndAbstainingVoteTally + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0 + * @instance + */ + GetContestedResourceVoteStateRequestV0.prototype.allowIncludeLockedAndAbstainingVoteTally = false; + + /** + * GetContestedResourceVoteStateRequestV0 startAtIdentifierInfo. + * @member {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.IStartAtIdentifierInfo|null|undefined} startAtIdentifierInfo + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0 + * @instance + */ + GetContestedResourceVoteStateRequestV0.prototype.startAtIdentifierInfo = null; + + /** + * GetContestedResourceVoteStateRequestV0 count. + * @member {number} count + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0 + * @instance + */ + GetContestedResourceVoteStateRequestV0.prototype.count = 0; + + /** + * GetContestedResourceVoteStateRequestV0 prove. + * @member {boolean} prove + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0 + * @instance + */ + GetContestedResourceVoteStateRequestV0.prototype.prove = false; + + /** + * Creates a new GetContestedResourceVoteStateRequestV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.IGetContestedResourceVoteStateRequestV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0} GetContestedResourceVoteStateRequestV0 instance + */ + GetContestedResourceVoteStateRequestV0.create = function create(properties) { + return new GetContestedResourceVoteStateRequestV0(properties); + }; + + /** + * Encodes the specified GetContestedResourceVoteStateRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.IGetContestedResourceVoteStateRequestV0} message GetContestedResourceVoteStateRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetContestedResourceVoteStateRequestV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.contractId != null && Object.hasOwnProperty.call(message, "contractId")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.contractId); + if (message.documentTypeName != null && Object.hasOwnProperty.call(message, "documentTypeName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.documentTypeName); + if (message.indexName != null && Object.hasOwnProperty.call(message, "indexName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.indexName); + if (message.indexValues != null && message.indexValues.length) + for (var i = 0; i < message.indexValues.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.indexValues[i]); + if (message.resultType != null && Object.hasOwnProperty.call(message, "resultType")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.resultType); + if (message.allowIncludeLockedAndAbstainingVoteTally != null && Object.hasOwnProperty.call(message, "allowIncludeLockedAndAbstainingVoteTally")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.allowIncludeLockedAndAbstainingVoteTally); + if (message.startAtIdentifierInfo != null && Object.hasOwnProperty.call(message, "startAtIdentifierInfo")) + $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo.encode(message.startAtIdentifierInfo, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.count != null && Object.hasOwnProperty.call(message, "count")) + writer.uint32(/* id 8, wireType 0 =*/64).uint32(message.count); + if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) + writer.uint32(/* id 9, wireType 0 =*/72).bool(message.prove); + return writer; + }; + + /** + * Encodes the specified GetContestedResourceVoteStateRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.IGetContestedResourceVoteStateRequestV0} message GetContestedResourceVoteStateRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetContestedResourceVoteStateRequestV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetContestedResourceVoteStateRequestV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0} GetContestedResourceVoteStateRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetContestedResourceVoteStateRequestV0.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.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.contractId = reader.bytes(); + break; + case 2: + message.documentTypeName = reader.string(); + break; + case 3: + message.indexName = reader.string(); + break; + case 4: + if (!(message.indexValues && message.indexValues.length)) + message.indexValues = []; + message.indexValues.push(reader.bytes()); + break; + case 5: + message.resultType = reader.int32(); + break; + case 6: + message.allowIncludeLockedAndAbstainingVoteTally = reader.bool(); + break; + case 7: + message.startAtIdentifierInfo = $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo.decode(reader, reader.uint32()); + break; + case 8: + message.count = reader.uint32(); + break; + case 9: + message.prove = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetContestedResourceVoteStateRequestV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0} GetContestedResourceVoteStateRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetContestedResourceVoteStateRequestV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetContestedResourceVoteStateRequestV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetContestedResourceVoteStateRequestV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.contractId != null && message.hasOwnProperty("contractId")) + if (!(message.contractId && typeof message.contractId.length === "number" || $util.isString(message.contractId))) + return "contractId: buffer expected"; + if (message.documentTypeName != null && message.hasOwnProperty("documentTypeName")) + if (!$util.isString(message.documentTypeName)) + return "documentTypeName: string expected"; + if (message.indexName != null && message.hasOwnProperty("indexName")) + if (!$util.isString(message.indexName)) + return "indexName: string expected"; + if (message.indexValues != null && message.hasOwnProperty("indexValues")) { + if (!Array.isArray(message.indexValues)) + return "indexValues: array expected"; + for (var i = 0; i < message.indexValues.length; ++i) + if (!(message.indexValues[i] && typeof message.indexValues[i].length === "number" || $util.isString(message.indexValues[i]))) + return "indexValues: buffer[] expected"; + } + if (message.resultType != null && message.hasOwnProperty("resultType")) + switch (message.resultType) { + default: + return "resultType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.allowIncludeLockedAndAbstainingVoteTally != null && message.hasOwnProperty("allowIncludeLockedAndAbstainingVoteTally")) + if (typeof message.allowIncludeLockedAndAbstainingVoteTally !== "boolean") + return "allowIncludeLockedAndAbstainingVoteTally: boolean expected"; + if (message.startAtIdentifierInfo != null && message.hasOwnProperty("startAtIdentifierInfo")) { + var error = $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo.verify(message.startAtIdentifierInfo); + if (error) + return "startAtIdentifierInfo." + error; + } + if (message.count != null && message.hasOwnProperty("count")) + if (!$util.isInteger(message.count)) + return "count: integer expected"; + if (message.prove != null && message.hasOwnProperty("prove")) + if (typeof message.prove !== "boolean") + return "prove: boolean expected"; + return null; + }; + + /** + * Creates a GetContestedResourceVoteStateRequestV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0} GetContestedResourceVoteStateRequestV0 + */ + GetContestedResourceVoteStateRequestV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0(); + if (object.contractId != null) + if (typeof object.contractId === "string") + $util.base64.decode(object.contractId, message.contractId = $util.newBuffer($util.base64.length(object.contractId)), 0); + else if (object.contractId.length >= 0) + message.contractId = object.contractId; + if (object.documentTypeName != null) + message.documentTypeName = String(object.documentTypeName); + if (object.indexName != null) + message.indexName = String(object.indexName); + if (object.indexValues) { + if (!Array.isArray(object.indexValues)) + throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.indexValues: array expected"); + message.indexValues = []; + for (var i = 0; i < object.indexValues.length; ++i) + if (typeof object.indexValues[i] === "string") + $util.base64.decode(object.indexValues[i], message.indexValues[i] = $util.newBuffer($util.base64.length(object.indexValues[i])), 0); + else if (object.indexValues[i].length >= 0) + message.indexValues[i] = object.indexValues[i]; + } + switch (object.resultType) { + case "DOCUMENTS": + case 0: + message.resultType = 0; + break; + case "VOTE_TALLY": + case 1: + message.resultType = 1; + break; + case "DOCUMENTS_AND_VOTE_TALLY": + case 2: + message.resultType = 2; + break; + } + if (object.allowIncludeLockedAndAbstainingVoteTally != null) + message.allowIncludeLockedAndAbstainingVoteTally = Boolean(object.allowIncludeLockedAndAbstainingVoteTally); + if (object.startAtIdentifierInfo != null) { + if (typeof object.startAtIdentifierInfo !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.startAtIdentifierInfo: object expected"); + message.startAtIdentifierInfo = $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo.fromObject(object.startAtIdentifierInfo); + } + if (object.count != null) + message.count = object.count >>> 0; + if (object.prove != null) + message.prove = Boolean(object.prove); + return message; + }; + + /** + * Creates a plain object from a GetContestedResourceVoteStateRequestV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0} message GetContestedResourceVoteStateRequestV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetContestedResourceVoteStateRequestV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.indexValues = []; + if (options.defaults) { + if (options.bytes === String) + object.contractId = ""; + else { + object.contractId = []; + if (options.bytes !== Array) + object.contractId = $util.newBuffer(object.contractId); + } + object.documentTypeName = ""; + object.indexName = ""; + object.resultType = options.enums === String ? "DOCUMENTS" : 0; + object.allowIncludeLockedAndAbstainingVoteTally = false; + object.startAtIdentifierInfo = null; + object.count = 0; + object.prove = false; + } + if (message.contractId != null && message.hasOwnProperty("contractId")) + object.contractId = options.bytes === String ? $util.base64.encode(message.contractId, 0, message.contractId.length) : options.bytes === Array ? Array.prototype.slice.call(message.contractId) : message.contractId; + if (message.documentTypeName != null && message.hasOwnProperty("documentTypeName")) + object.documentTypeName = message.documentTypeName; + if (message.indexName != null && message.hasOwnProperty("indexName")) + object.indexName = message.indexName; + if (message.indexValues && message.indexValues.length) { + object.indexValues = []; + for (var j = 0; j < message.indexValues.length; ++j) + object.indexValues[j] = options.bytes === String ? $util.base64.encode(message.indexValues[j], 0, message.indexValues[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.indexValues[j]) : message.indexValues[j]; + } + if (message.resultType != null && message.hasOwnProperty("resultType")) + object.resultType = options.enums === String ? $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.ResultType[message.resultType] : message.resultType; + if (message.allowIncludeLockedAndAbstainingVoteTally != null && message.hasOwnProperty("allowIncludeLockedAndAbstainingVoteTally")) + object.allowIncludeLockedAndAbstainingVoteTally = message.allowIncludeLockedAndAbstainingVoteTally; + if (message.startAtIdentifierInfo != null && message.hasOwnProperty("startAtIdentifierInfo")) + object.startAtIdentifierInfo = $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo.toObject(message.startAtIdentifierInfo, options); + if (message.count != null && message.hasOwnProperty("count")) + object.count = message.count; + if (message.prove != null && message.hasOwnProperty("prove")) + object.prove = message.prove; + return object; + }; + + /** + * Converts this GetContestedResourceVoteStateRequestV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0 + * @instance + * @returns {Object.} JSON object + */ + GetContestedResourceVoteStateRequestV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo = (function() { + + /** + * Properties of a StartAtIdentifierInfo. + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0 + * @interface IStartAtIdentifierInfo + * @property {Uint8Array|null} [startIdentifier] StartAtIdentifierInfo startIdentifier + * @property {boolean|null} [startIdentifierIncluded] StartAtIdentifierInfo startIdentifierIncluded + */ + + /** + * Constructs a new StartAtIdentifierInfo. + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0 + * @classdesc Represents a StartAtIdentifierInfo. + * @implements IStartAtIdentifierInfo + * @constructor + * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.IStartAtIdentifierInfo=} [properties] Properties to set + */ + function StartAtIdentifierInfo(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]]; + } + + /** + * StartAtIdentifierInfo startIdentifier. + * @member {Uint8Array} startIdentifier + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo + * @instance + */ + StartAtIdentifierInfo.prototype.startIdentifier = $util.newBuffer([]); + + /** + * StartAtIdentifierInfo startIdentifierIncluded. + * @member {boolean} startIdentifierIncluded + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo + * @instance + */ + StartAtIdentifierInfo.prototype.startIdentifierIncluded = false; + + /** + * Creates a new StartAtIdentifierInfo instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.IStartAtIdentifierInfo=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo} StartAtIdentifierInfo instance + */ + StartAtIdentifierInfo.create = function create(properties) { + return new StartAtIdentifierInfo(properties); + }; + + /** + * Encodes the specified StartAtIdentifierInfo message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.IStartAtIdentifierInfo} message StartAtIdentifierInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StartAtIdentifierInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.startIdentifier != null && Object.hasOwnProperty.call(message, "startIdentifier")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.startIdentifier); + if (message.startIdentifierIncluded != null && Object.hasOwnProperty.call(message, "startIdentifierIncluded")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.startIdentifierIncluded); + return writer; + }; + + /** + * Encodes the specified StartAtIdentifierInfo message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.IStartAtIdentifierInfo} message StartAtIdentifierInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StartAtIdentifierInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StartAtIdentifierInfo message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo} StartAtIdentifierInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StartAtIdentifierInfo.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.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.startIdentifier = reader.bytes(); + break; + case 2: + message.startIdentifierIncluded = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StartAtIdentifierInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo} StartAtIdentifierInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StartAtIdentifierInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StartAtIdentifierInfo message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StartAtIdentifierInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.startIdentifier != null && message.hasOwnProperty("startIdentifier")) + if (!(message.startIdentifier && typeof message.startIdentifier.length === "number" || $util.isString(message.startIdentifier))) + return "startIdentifier: buffer expected"; + if (message.startIdentifierIncluded != null && message.hasOwnProperty("startIdentifierIncluded")) + if (typeof message.startIdentifierIncluded !== "boolean") + return "startIdentifierIncluded: boolean expected"; + return null; + }; + + /** + * Creates a StartAtIdentifierInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo} StartAtIdentifierInfo + */ + StartAtIdentifierInfo.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo(); + if (object.startIdentifier != null) + if (typeof object.startIdentifier === "string") + $util.base64.decode(object.startIdentifier, message.startIdentifier = $util.newBuffer($util.base64.length(object.startIdentifier)), 0); + else if (object.startIdentifier.length >= 0) + message.startIdentifier = object.startIdentifier; + if (object.startIdentifierIncluded != null) + message.startIdentifierIncluded = Boolean(object.startIdentifierIncluded); + return message; + }; + + /** + * Creates a plain object from a StartAtIdentifierInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo} message StartAtIdentifierInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StartAtIdentifierInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.startIdentifier = ""; + else { + object.startIdentifier = []; + if (options.bytes !== Array) + object.startIdentifier = $util.newBuffer(object.startIdentifier); + } + object.startIdentifierIncluded = false; + } + if (message.startIdentifier != null && message.hasOwnProperty("startIdentifier")) + object.startIdentifier = options.bytes === String ? $util.base64.encode(message.startIdentifier, 0, message.startIdentifier.length) : options.bytes === Array ? Array.prototype.slice.call(message.startIdentifier) : message.startIdentifier; + if (message.startIdentifierIncluded != null && message.hasOwnProperty("startIdentifierIncluded")) + object.startIdentifierIncluded = message.startIdentifierIncluded; + return object; + }; + + /** + * Converts this StartAtIdentifierInfo to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo + * @instance + * @returns {Object.} JSON object + */ + StartAtIdentifierInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return StartAtIdentifierInfo; + })(); + + /** + * ResultType enum. + * @name org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.ResultType + * @enum {number} + * @property {number} DOCUMENTS=0 DOCUMENTS value + * @property {number} VOTE_TALLY=1 VOTE_TALLY value + * @property {number} DOCUMENTS_AND_VOTE_TALLY=2 DOCUMENTS_AND_VOTE_TALLY value + */ + GetContestedResourceVoteStateRequestV0.ResultType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DOCUMENTS"] = 0; + values[valuesById[1] = "VOTE_TALLY"] = 1; + values[valuesById[2] = "DOCUMENTS_AND_VOTE_TALLY"] = 2; + return values; + })(); + + return GetContestedResourceVoteStateRequestV0; + })(); + + return GetContestedResourceVoteStateRequest; + })(); + + v0.GetContestedResourceVoteStateResponse = (function() { + + /** + * Properties of a GetContestedResourceVoteStateResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetContestedResourceVoteStateResponse + * @property {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.IGetContestedResourceVoteStateResponseV0|null} [v0] GetContestedResourceVoteStateResponse v0 + */ + + /** + * Constructs a new GetContestedResourceVoteStateResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetContestedResourceVoteStateResponse. + * @implements IGetContestedResourceVoteStateResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IGetContestedResourceVoteStateResponse=} [properties] Properties to set + */ + function GetContestedResourceVoteStateResponse(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]]; + } + + /** + * GetContestedResourceVoteStateResponse v0. + * @member {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.IGetContestedResourceVoteStateResponseV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse + * @instance + */ + GetContestedResourceVoteStateResponse.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetContestedResourceVoteStateResponse version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse + * @instance + */ + Object.defineProperty(GetContestedResourceVoteStateResponse.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetContestedResourceVoteStateResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetContestedResourceVoteStateResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse} GetContestedResourceVoteStateResponse instance + */ + GetContestedResourceVoteStateResponse.create = function create(properties) { + return new GetContestedResourceVoteStateResponse(properties); + }; + + /** + * Encodes the specified GetContestedResourceVoteStateResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetContestedResourceVoteStateResponse} message GetContestedResourceVoteStateResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetContestedResourceVoteStateResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetContestedResourceVoteStateResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetContestedResourceVoteStateResponse} message GetContestedResourceVoteStateResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetContestedResourceVoteStateResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetContestedResourceVoteStateResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse} GetContestedResourceVoteStateResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetContestedResourceVoteStateResponse.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.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetContestedResourceVoteStateResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse} GetContestedResourceVoteStateResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetContestedResourceVoteStateResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetContestedResourceVoteStateResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetContestedResourceVoteStateResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetContestedResourceVoteStateResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse} GetContestedResourceVoteStateResponse + */ + GetContestedResourceVoteStateResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetContestedResourceVoteStateResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse} message GetContestedResourceVoteStateResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetContestedResourceVoteStateResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetContestedResourceVoteStateResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse + * @instance + * @returns {Object.} JSON object + */ + GetContestedResourceVoteStateResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0 = (function() { + + /** + * Properties of a GetContestedResourceVoteStateResponseV0. + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse + * @interface IGetContestedResourceVoteStateResponseV0 + * @property {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.IContestedResourceContenders|null} [contestedResourceContenders] GetContestedResourceVoteStateResponseV0 contestedResourceContenders + * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetContestedResourceVoteStateResponseV0 proof + * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetContestedResourceVoteStateResponseV0 metadata + */ + + /** + * Constructs a new GetContestedResourceVoteStateResponseV0. + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse + * @classdesc Represents a GetContestedResourceVoteStateResponseV0. + * @implements IGetContestedResourceVoteStateResponseV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.IGetContestedResourceVoteStateResponseV0=} [properties] Properties to set + */ + function GetContestedResourceVoteStateResponseV0(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]]; + } + + /** + * GetContestedResourceVoteStateResponseV0 contestedResourceContenders. + * @member {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.IContestedResourceContenders|null|undefined} contestedResourceContenders + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0 + * @instance + */ + GetContestedResourceVoteStateResponseV0.prototype.contestedResourceContenders = null; + + /** + * GetContestedResourceVoteStateResponseV0 proof. + * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0 + * @instance + */ + GetContestedResourceVoteStateResponseV0.prototype.proof = null; + + /** + * GetContestedResourceVoteStateResponseV0 metadata. + * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0 + * @instance + */ + GetContestedResourceVoteStateResponseV0.prototype.metadata = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetContestedResourceVoteStateResponseV0 result. + * @member {"contestedResourceContenders"|"proof"|undefined} result + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0 + * @instance + */ + Object.defineProperty(GetContestedResourceVoteStateResponseV0.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["contestedResourceContenders", "proof"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetContestedResourceVoteStateResponseV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.IGetContestedResourceVoteStateResponseV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0} GetContestedResourceVoteStateResponseV0 instance + */ + GetContestedResourceVoteStateResponseV0.create = function create(properties) { + return new GetContestedResourceVoteStateResponseV0(properties); + }; + + /** + * Encodes the specified GetContestedResourceVoteStateResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.IGetContestedResourceVoteStateResponseV0} message GetContestedResourceVoteStateResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetContestedResourceVoteStateResponseV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.contestedResourceContenders != null && Object.hasOwnProperty.call(message, "contestedResourceContenders")) + $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders.encode(message.contestedResourceContenders, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetContestedResourceVoteStateResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.IGetContestedResourceVoteStateResponseV0} message GetContestedResourceVoteStateResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetContestedResourceVoteStateResponseV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetContestedResourceVoteStateResponseV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0} GetContestedResourceVoteStateResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetContestedResourceVoteStateResponseV0.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.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.contestedResourceContenders = $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders.decode(reader, reader.uint32()); + break; + case 2: + message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); + break; + case 3: + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetContestedResourceVoteStateResponseV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0} GetContestedResourceVoteStateResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetContestedResourceVoteStateResponseV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetContestedResourceVoteStateResponseV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetContestedResourceVoteStateResponseV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.contestedResourceContenders != null && message.hasOwnProperty("contestedResourceContenders")) { + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders.verify(message.contestedResourceContenders); + if (error) + return "contestedResourceContenders." + error; + } + } + if (message.proof != null && message.hasOwnProperty("proof")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); + if (error) + return "proof." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a GetContestedResourceVoteStateResponseV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0} GetContestedResourceVoteStateResponseV0 + */ + GetContestedResourceVoteStateResponseV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0(); + if (object.contestedResourceContenders != null) { + if (typeof object.contestedResourceContenders !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.contestedResourceContenders: object expected"); + message.contestedResourceContenders = $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders.fromObject(object.contestedResourceContenders); + } + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.proof: object expected"); + message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.metadata: object expected"); + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a GetContestedResourceVoteStateResponseV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0} message GetContestedResourceVoteStateResponseV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetContestedResourceVoteStateResponseV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.metadata = null; + if (message.contestedResourceContenders != null && message.hasOwnProperty("contestedResourceContenders")) { + object.contestedResourceContenders = $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders.toObject(message.contestedResourceContenders, options); + if (options.oneofs) + object.result = "contestedResourceContenders"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); + if (options.oneofs) + object.result = "proof"; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this GetContestedResourceVoteStateResponseV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0 + * @instance + * @returns {Object.} JSON object + */ + GetContestedResourceVoteStateResponseV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetContestedResourceVoteStateResponseV0.FinishedVoteInfo = (function() { + + /** + * Properties of a FinishedVoteInfo. + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0 + * @interface IFinishedVoteInfo + * @property {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo.FinishedVoteOutcome|null} [finishedVoteOutcome] FinishedVoteInfo finishedVoteOutcome + * @property {Uint8Array|null} [wonByIdentityId] FinishedVoteInfo wonByIdentityId + * @property {number|Long|null} [finishedAtBlockHeight] FinishedVoteInfo finishedAtBlockHeight + * @property {number|null} [finishedAtCoreBlockHeight] FinishedVoteInfo finishedAtCoreBlockHeight + * @property {number|Long|null} [finishedAtBlockTimeMs] FinishedVoteInfo finishedAtBlockTimeMs + * @property {number|null} [finishedAtEpoch] FinishedVoteInfo finishedAtEpoch + */ + + /** + * Constructs a new FinishedVoteInfo. + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0 + * @classdesc Represents a FinishedVoteInfo. + * @implements IFinishedVoteInfo + * @constructor + * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.IFinishedVoteInfo=} [properties] Properties to set + */ + function FinishedVoteInfo(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]]; + } + + /** + * FinishedVoteInfo finishedVoteOutcome. + * @member {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo.FinishedVoteOutcome} finishedVoteOutcome + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo + * @instance + */ + FinishedVoteInfo.prototype.finishedVoteOutcome = 0; + + /** + * FinishedVoteInfo wonByIdentityId. + * @member {Uint8Array} wonByIdentityId + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo + * @instance + */ + FinishedVoteInfo.prototype.wonByIdentityId = $util.newBuffer([]); + + /** + * FinishedVoteInfo finishedAtBlockHeight. + * @member {number|Long} finishedAtBlockHeight + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo + * @instance + */ + FinishedVoteInfo.prototype.finishedAtBlockHeight = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * FinishedVoteInfo finishedAtCoreBlockHeight. + * @member {number} finishedAtCoreBlockHeight + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo + * @instance + */ + FinishedVoteInfo.prototype.finishedAtCoreBlockHeight = 0; + + /** + * FinishedVoteInfo finishedAtBlockTimeMs. + * @member {number|Long} finishedAtBlockTimeMs + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo + * @instance + */ + FinishedVoteInfo.prototype.finishedAtBlockTimeMs = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * FinishedVoteInfo finishedAtEpoch. + * @member {number} finishedAtEpoch + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo + * @instance + */ + FinishedVoteInfo.prototype.finishedAtEpoch = 0; + + /** + * Creates a new FinishedVoteInfo instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.IFinishedVoteInfo=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo} FinishedVoteInfo instance + */ + FinishedVoteInfo.create = function create(properties) { + return new FinishedVoteInfo(properties); + }; + + /** + * Encodes the specified FinishedVoteInfo message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.IFinishedVoteInfo} message FinishedVoteInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FinishedVoteInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.finishedVoteOutcome != null && Object.hasOwnProperty.call(message, "finishedVoteOutcome")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.finishedVoteOutcome); + if (message.wonByIdentityId != null && Object.hasOwnProperty.call(message, "wonByIdentityId")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.wonByIdentityId); + if (message.finishedAtBlockHeight != null && Object.hasOwnProperty.call(message, "finishedAtBlockHeight")) + writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.finishedAtBlockHeight); + if (message.finishedAtCoreBlockHeight != null && Object.hasOwnProperty.call(message, "finishedAtCoreBlockHeight")) + writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.finishedAtCoreBlockHeight); + if (message.finishedAtBlockTimeMs != null && Object.hasOwnProperty.call(message, "finishedAtBlockTimeMs")) + writer.uint32(/* id 5, wireType 0 =*/40).uint64(message.finishedAtBlockTimeMs); + if (message.finishedAtEpoch != null && Object.hasOwnProperty.call(message, "finishedAtEpoch")) + writer.uint32(/* id 6, wireType 0 =*/48).uint32(message.finishedAtEpoch); + return writer; + }; + + /** + * Encodes the specified FinishedVoteInfo message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.IFinishedVoteInfo} message FinishedVoteInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FinishedVoteInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FinishedVoteInfo message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo} FinishedVoteInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FinishedVoteInfo.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.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.finishedVoteOutcome = reader.int32(); + break; + case 2: + message.wonByIdentityId = reader.bytes(); + break; + case 3: + message.finishedAtBlockHeight = reader.uint64(); + break; + case 4: + message.finishedAtCoreBlockHeight = reader.uint32(); + break; + case 5: + message.finishedAtBlockTimeMs = reader.uint64(); + break; + case 6: + message.finishedAtEpoch = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FinishedVoteInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo} FinishedVoteInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FinishedVoteInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FinishedVoteInfo message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FinishedVoteInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.finishedVoteOutcome != null && message.hasOwnProperty("finishedVoteOutcome")) + switch (message.finishedVoteOutcome) { + default: + return "finishedVoteOutcome: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.wonByIdentityId != null && message.hasOwnProperty("wonByIdentityId")) + if (!(message.wonByIdentityId && typeof message.wonByIdentityId.length === "number" || $util.isString(message.wonByIdentityId))) + return "wonByIdentityId: buffer expected"; + if (message.finishedAtBlockHeight != null && message.hasOwnProperty("finishedAtBlockHeight")) + if (!$util.isInteger(message.finishedAtBlockHeight) && !(message.finishedAtBlockHeight && $util.isInteger(message.finishedAtBlockHeight.low) && $util.isInteger(message.finishedAtBlockHeight.high))) + return "finishedAtBlockHeight: integer|Long expected"; + if (message.finishedAtCoreBlockHeight != null && message.hasOwnProperty("finishedAtCoreBlockHeight")) + if (!$util.isInteger(message.finishedAtCoreBlockHeight)) + return "finishedAtCoreBlockHeight: integer expected"; + if (message.finishedAtBlockTimeMs != null && message.hasOwnProperty("finishedAtBlockTimeMs")) + if (!$util.isInteger(message.finishedAtBlockTimeMs) && !(message.finishedAtBlockTimeMs && $util.isInteger(message.finishedAtBlockTimeMs.low) && $util.isInteger(message.finishedAtBlockTimeMs.high))) + return "finishedAtBlockTimeMs: integer|Long expected"; + if (message.finishedAtEpoch != null && message.hasOwnProperty("finishedAtEpoch")) + if (!$util.isInteger(message.finishedAtEpoch)) + return "finishedAtEpoch: integer expected"; + return null; + }; + + /** + * Creates a FinishedVoteInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo} FinishedVoteInfo + */ + FinishedVoteInfo.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo(); + switch (object.finishedVoteOutcome) { + case "TOWARDS_IDENTITY": + case 0: + message.finishedVoteOutcome = 0; + break; + case "LOCKED": + case 1: + message.finishedVoteOutcome = 1; + break; + case "NO_PREVIOUS_WINNER": + case 2: + message.finishedVoteOutcome = 2; + break; + } + if (object.wonByIdentityId != null) + if (typeof object.wonByIdentityId === "string") + $util.base64.decode(object.wonByIdentityId, message.wonByIdentityId = $util.newBuffer($util.base64.length(object.wonByIdentityId)), 0); + else if (object.wonByIdentityId.length >= 0) + message.wonByIdentityId = object.wonByIdentityId; + if (object.finishedAtBlockHeight != null) + if ($util.Long) + (message.finishedAtBlockHeight = $util.Long.fromValue(object.finishedAtBlockHeight)).unsigned = true; + else if (typeof object.finishedAtBlockHeight === "string") + message.finishedAtBlockHeight = parseInt(object.finishedAtBlockHeight, 10); + else if (typeof object.finishedAtBlockHeight === "number") + message.finishedAtBlockHeight = object.finishedAtBlockHeight; + else if (typeof object.finishedAtBlockHeight === "object") + message.finishedAtBlockHeight = new $util.LongBits(object.finishedAtBlockHeight.low >>> 0, object.finishedAtBlockHeight.high >>> 0).toNumber(true); + if (object.finishedAtCoreBlockHeight != null) + message.finishedAtCoreBlockHeight = object.finishedAtCoreBlockHeight >>> 0; + if (object.finishedAtBlockTimeMs != null) + if ($util.Long) + (message.finishedAtBlockTimeMs = $util.Long.fromValue(object.finishedAtBlockTimeMs)).unsigned = true; + else if (typeof object.finishedAtBlockTimeMs === "string") + message.finishedAtBlockTimeMs = parseInt(object.finishedAtBlockTimeMs, 10); + else if (typeof object.finishedAtBlockTimeMs === "number") + message.finishedAtBlockTimeMs = object.finishedAtBlockTimeMs; + else if (typeof object.finishedAtBlockTimeMs === "object") + message.finishedAtBlockTimeMs = new $util.LongBits(object.finishedAtBlockTimeMs.low >>> 0, object.finishedAtBlockTimeMs.high >>> 0).toNumber(true); + if (object.finishedAtEpoch != null) + message.finishedAtEpoch = object.finishedAtEpoch >>> 0; + return message; + }; + + /** + * Creates a plain object from a FinishedVoteInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo} message FinishedVoteInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FinishedVoteInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.finishedVoteOutcome = options.enums === String ? "TOWARDS_IDENTITY" : 0; + if (options.bytes === String) + object.wonByIdentityId = ""; + else { + object.wonByIdentityId = []; + if (options.bytes !== Array) + object.wonByIdentityId = $util.newBuffer(object.wonByIdentityId); + } + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.finishedAtBlockHeight = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.finishedAtBlockHeight = options.longs === String ? "0" : 0; + object.finishedAtCoreBlockHeight = 0; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.finishedAtBlockTimeMs = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.finishedAtBlockTimeMs = options.longs === String ? "0" : 0; + object.finishedAtEpoch = 0; + } + if (message.finishedVoteOutcome != null && message.hasOwnProperty("finishedVoteOutcome")) + object.finishedVoteOutcome = options.enums === String ? $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo.FinishedVoteOutcome[message.finishedVoteOutcome] : message.finishedVoteOutcome; + if (message.wonByIdentityId != null && message.hasOwnProperty("wonByIdentityId")) + object.wonByIdentityId = options.bytes === String ? $util.base64.encode(message.wonByIdentityId, 0, message.wonByIdentityId.length) : options.bytes === Array ? Array.prototype.slice.call(message.wonByIdentityId) : message.wonByIdentityId; + if (message.finishedAtBlockHeight != null && message.hasOwnProperty("finishedAtBlockHeight")) + if (typeof message.finishedAtBlockHeight === "number") + object.finishedAtBlockHeight = options.longs === String ? String(message.finishedAtBlockHeight) : message.finishedAtBlockHeight; + else + object.finishedAtBlockHeight = options.longs === String ? $util.Long.prototype.toString.call(message.finishedAtBlockHeight) : options.longs === Number ? new $util.LongBits(message.finishedAtBlockHeight.low >>> 0, message.finishedAtBlockHeight.high >>> 0).toNumber(true) : message.finishedAtBlockHeight; + if (message.finishedAtCoreBlockHeight != null && message.hasOwnProperty("finishedAtCoreBlockHeight")) + object.finishedAtCoreBlockHeight = message.finishedAtCoreBlockHeight; + if (message.finishedAtBlockTimeMs != null && message.hasOwnProperty("finishedAtBlockTimeMs")) + if (typeof message.finishedAtBlockTimeMs === "number") + object.finishedAtBlockTimeMs = options.longs === String ? String(message.finishedAtBlockTimeMs) : message.finishedAtBlockTimeMs; + else + object.finishedAtBlockTimeMs = options.longs === String ? $util.Long.prototype.toString.call(message.finishedAtBlockTimeMs) : options.longs === Number ? new $util.LongBits(message.finishedAtBlockTimeMs.low >>> 0, message.finishedAtBlockTimeMs.high >>> 0).toNumber(true) : message.finishedAtBlockTimeMs; + if (message.finishedAtEpoch != null && message.hasOwnProperty("finishedAtEpoch")) + object.finishedAtEpoch = message.finishedAtEpoch; + return object; + }; + + /** + * Converts this FinishedVoteInfo to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo + * @instance + * @returns {Object.} JSON object + */ + FinishedVoteInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * FinishedVoteOutcome enum. + * @name org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo.FinishedVoteOutcome + * @enum {number} + * @property {number} TOWARDS_IDENTITY=0 TOWARDS_IDENTITY value + * @property {number} LOCKED=1 LOCKED value + * @property {number} NO_PREVIOUS_WINNER=2 NO_PREVIOUS_WINNER value + */ + FinishedVoteInfo.FinishedVoteOutcome = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TOWARDS_IDENTITY"] = 0; + values[valuesById[1] = "LOCKED"] = 1; + values[valuesById[2] = "NO_PREVIOUS_WINNER"] = 2; + return values; + })(); + + return FinishedVoteInfo; + })(); + + GetContestedResourceVoteStateResponseV0.ContestedResourceContenders = (function() { + + /** + * Properties of a ContestedResourceContenders. + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0 + * @interface IContestedResourceContenders + * @property {Array.|null} [contenders] ContestedResourceContenders contenders + * @property {number|null} [abstainVoteTally] ContestedResourceContenders abstainVoteTally + * @property {number|null} [lockVoteTally] ContestedResourceContenders lockVoteTally + * @property {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.IFinishedVoteInfo|null} [finishedVoteInfo] ContestedResourceContenders finishedVoteInfo + */ + + /** + * Constructs a new ContestedResourceContenders. + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0 + * @classdesc Represents a ContestedResourceContenders. + * @implements IContestedResourceContenders + * @constructor + * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.IContestedResourceContenders=} [properties] Properties to set + */ + function ContestedResourceContenders(properties) { + this.contenders = []; + 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]]; + } + + /** + * ContestedResourceContenders contenders. + * @member {Array.} contenders + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders + * @instance + */ + ContestedResourceContenders.prototype.contenders = $util.emptyArray; + + /** + * ContestedResourceContenders abstainVoteTally. + * @member {number} abstainVoteTally + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders + * @instance + */ + ContestedResourceContenders.prototype.abstainVoteTally = 0; + + /** + * ContestedResourceContenders lockVoteTally. + * @member {number} lockVoteTally + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders + * @instance + */ + ContestedResourceContenders.prototype.lockVoteTally = 0; + + /** + * ContestedResourceContenders finishedVoteInfo. + * @member {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.IFinishedVoteInfo|null|undefined} finishedVoteInfo + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders + * @instance + */ + ContestedResourceContenders.prototype.finishedVoteInfo = null; + + /** + * Creates a new ContestedResourceContenders instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.IContestedResourceContenders=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders} ContestedResourceContenders instance + */ + ContestedResourceContenders.create = function create(properties) { + return new ContestedResourceContenders(properties); + }; + + /** + * Encodes the specified ContestedResourceContenders message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.IContestedResourceContenders} message ContestedResourceContenders message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContestedResourceContenders.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.contenders != null && message.contenders.length) + for (var i = 0; i < message.contenders.length; ++i) + $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender.encode(message.contenders[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.abstainVoteTally != null && Object.hasOwnProperty.call(message, "abstainVoteTally")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.abstainVoteTally); + if (message.lockVoteTally != null && Object.hasOwnProperty.call(message, "lockVoteTally")) + writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.lockVoteTally); + if (message.finishedVoteInfo != null && Object.hasOwnProperty.call(message, "finishedVoteInfo")) + $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo.encode(message.finishedVoteInfo, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ContestedResourceContenders message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.IContestedResourceContenders} message ContestedResourceContenders message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContestedResourceContenders.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ContestedResourceContenders message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders} ContestedResourceContenders + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContestedResourceContenders.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.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.contenders && message.contenders.length)) + message.contenders = []; + message.contenders.push($root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender.decode(reader, reader.uint32())); + break; + case 2: + message.abstainVoteTally = reader.uint32(); + break; + case 3: + message.lockVoteTally = reader.uint32(); + break; + case 4: + message.finishedVoteInfo = $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ContestedResourceContenders message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders} ContestedResourceContenders + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContestedResourceContenders.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ContestedResourceContenders message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ContestedResourceContenders.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.contenders != null && message.hasOwnProperty("contenders")) { + if (!Array.isArray(message.contenders)) + return "contenders: array expected"; + for (var i = 0; i < message.contenders.length; ++i) { + var error = $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender.verify(message.contenders[i]); + if (error) + return "contenders." + error; + } + } + if (message.abstainVoteTally != null && message.hasOwnProperty("abstainVoteTally")) + if (!$util.isInteger(message.abstainVoteTally)) + return "abstainVoteTally: integer expected"; + if (message.lockVoteTally != null && message.hasOwnProperty("lockVoteTally")) + if (!$util.isInteger(message.lockVoteTally)) + return "lockVoteTally: integer expected"; + if (message.finishedVoteInfo != null && message.hasOwnProperty("finishedVoteInfo")) { + var error = $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo.verify(message.finishedVoteInfo); + if (error) + return "finishedVoteInfo." + error; + } + return null; + }; + + /** + * Creates a ContestedResourceContenders message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders} ContestedResourceContenders + */ + ContestedResourceContenders.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders(); + if (object.contenders) { + if (!Array.isArray(object.contenders)) + throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders.contenders: array expected"); + message.contenders = []; + for (var i = 0; i < object.contenders.length; ++i) { + if (typeof object.contenders[i] !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders.contenders: object expected"); + message.contenders[i] = $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender.fromObject(object.contenders[i]); + } + } + if (object.abstainVoteTally != null) + message.abstainVoteTally = object.abstainVoteTally >>> 0; + if (object.lockVoteTally != null) + message.lockVoteTally = object.lockVoteTally >>> 0; + if (object.finishedVoteInfo != null) { + if (typeof object.finishedVoteInfo !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders.finishedVoteInfo: object expected"); + message.finishedVoteInfo = $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo.fromObject(object.finishedVoteInfo); + } + return message; + }; + + /** + * Creates a plain object from a ContestedResourceContenders message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders} message ContestedResourceContenders + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ContestedResourceContenders.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.contenders = []; + if (options.defaults) { + object.abstainVoteTally = 0; + object.lockVoteTally = 0; + object.finishedVoteInfo = null; + } + if (message.contenders && message.contenders.length) { + object.contenders = []; + for (var j = 0; j < message.contenders.length; ++j) + object.contenders[j] = $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender.toObject(message.contenders[j], options); + } + if (message.abstainVoteTally != null && message.hasOwnProperty("abstainVoteTally")) + object.abstainVoteTally = message.abstainVoteTally; + if (message.lockVoteTally != null && message.hasOwnProperty("lockVoteTally")) + object.lockVoteTally = message.lockVoteTally; + if (message.finishedVoteInfo != null && message.hasOwnProperty("finishedVoteInfo")) + object.finishedVoteInfo = $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo.toObject(message.finishedVoteInfo, options); + return object; + }; + + /** + * Converts this ContestedResourceContenders to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders + * @instance + * @returns {Object.} JSON object + */ + ContestedResourceContenders.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ContestedResourceContenders; + })(); + + GetContestedResourceVoteStateResponseV0.Contender = (function() { + + /** + * Properties of a Contender. + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0 + * @interface IContender + * @property {Uint8Array|null} [identifier] Contender identifier + * @property {number|null} [voteCount] Contender voteCount + * @property {Uint8Array|null} [document] Contender document + */ + + /** + * Constructs a new Contender. + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0 + * @classdesc Represents a Contender. + * @implements IContender + * @constructor + * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.IContender=} [properties] Properties to set + */ + function Contender(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]]; + } + + /** + * Contender identifier. + * @member {Uint8Array} identifier + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender + * @instance + */ + Contender.prototype.identifier = $util.newBuffer([]); + + /** + * Contender voteCount. + * @member {number} voteCount + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender + * @instance + */ + Contender.prototype.voteCount = 0; + + /** + * Contender document. + * @member {Uint8Array} document + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender + * @instance + */ + Contender.prototype.document = $util.newBuffer([]); + + /** + * Creates a new Contender instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.IContender=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender} Contender instance + */ + Contender.create = function create(properties) { + return new Contender(properties); + }; + + /** + * Encodes the specified Contender message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.IContender} message Contender message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Contender.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.identifier != null && Object.hasOwnProperty.call(message, "identifier")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.identifier); + if (message.voteCount != null && Object.hasOwnProperty.call(message, "voteCount")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.voteCount); + if (message.document != null && Object.hasOwnProperty.call(message, "document")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.document); + return writer; + }; + + /** + * Encodes the specified Contender message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.IContender} message Contender message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Contender.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Contender message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender} Contender + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Contender.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.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.identifier = reader.bytes(); + break; + case 2: + message.voteCount = reader.uint32(); + break; + case 3: + message.document = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Contender message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender} Contender + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Contender.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Contender message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Contender.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.identifier != null && message.hasOwnProperty("identifier")) + if (!(message.identifier && typeof message.identifier.length === "number" || $util.isString(message.identifier))) + return "identifier: buffer expected"; + if (message.voteCount != null && message.hasOwnProperty("voteCount")) + if (!$util.isInteger(message.voteCount)) + return "voteCount: integer expected"; + if (message.document != null && message.hasOwnProperty("document")) + if (!(message.document && typeof message.document.length === "number" || $util.isString(message.document))) + return "document: buffer expected"; + return null; + }; + + /** + * Creates a Contender message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender} Contender + */ + Contender.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender(); + if (object.identifier != null) + if (typeof object.identifier === "string") + $util.base64.decode(object.identifier, message.identifier = $util.newBuffer($util.base64.length(object.identifier)), 0); + else if (object.identifier.length >= 0) + message.identifier = object.identifier; + if (object.voteCount != null) + message.voteCount = object.voteCount >>> 0; + if (object.document != null) + if (typeof object.document === "string") + $util.base64.decode(object.document, message.document = $util.newBuffer($util.base64.length(object.document)), 0); + else if (object.document.length >= 0) + message.document = object.document; + return message; + }; + + /** + * Creates a plain object from a Contender message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender} message Contender + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Contender.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.identifier = ""; + else { + object.identifier = []; + if (options.bytes !== Array) + object.identifier = $util.newBuffer(object.identifier); + } + object.voteCount = 0; + if (options.bytes === String) + object.document = ""; + else { + object.document = []; + if (options.bytes !== Array) + object.document = $util.newBuffer(object.document); + } + } + if (message.identifier != null && message.hasOwnProperty("identifier")) + object.identifier = options.bytes === String ? $util.base64.encode(message.identifier, 0, message.identifier.length) : options.bytes === Array ? Array.prototype.slice.call(message.identifier) : message.identifier; + if (message.voteCount != null && message.hasOwnProperty("voteCount")) + object.voteCount = message.voteCount; + if (message.document != null && message.hasOwnProperty("document")) + object.document = options.bytes === String ? $util.base64.encode(message.document, 0, message.document.length) : options.bytes === Array ? Array.prototype.slice.call(message.document) : message.document; + return object; + }; + + /** + * Converts this Contender to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender + * @instance + * @returns {Object.} JSON object + */ + Contender.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Contender; + })(); + + return GetContestedResourceVoteStateResponseV0; + })(); + + return GetContestedResourceVoteStateResponse; + })(); + + v0.GetContestedResourceVotersForIdentityRequest = (function() { + + /** + * Properties of a GetContestedResourceVotersForIdentityRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetContestedResourceVotersForIdentityRequest + * @property {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.IGetContestedResourceVotersForIdentityRequestV0|null} [v0] GetContestedResourceVotersForIdentityRequest v0 + */ + + /** + * Constructs a new GetContestedResourceVotersForIdentityRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetContestedResourceVotersForIdentityRequest. + * @implements IGetContestedResourceVotersForIdentityRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IGetContestedResourceVotersForIdentityRequest=} [properties] Properties to set + */ + function GetContestedResourceVotersForIdentityRequest(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]]; + } + + /** + * GetContestedResourceVotersForIdentityRequest v0. + * @member {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.IGetContestedResourceVotersForIdentityRequestV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest + * @instance + */ + GetContestedResourceVotersForIdentityRequest.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetContestedResourceVotersForIdentityRequest version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest + * @instance + */ + Object.defineProperty(GetContestedResourceVotersForIdentityRequest.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetContestedResourceVotersForIdentityRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetContestedResourceVotersForIdentityRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest} GetContestedResourceVotersForIdentityRequest instance + */ + GetContestedResourceVotersForIdentityRequest.create = function create(properties) { + return new GetContestedResourceVotersForIdentityRequest(properties); + }; + + /** + * Encodes the specified GetContestedResourceVotersForIdentityRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetContestedResourceVotersForIdentityRequest} message GetContestedResourceVotersForIdentityRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetContestedResourceVotersForIdentityRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetContestedResourceVotersForIdentityRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetContestedResourceVotersForIdentityRequest} message GetContestedResourceVotersForIdentityRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetContestedResourceVotersForIdentityRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetContestedResourceVotersForIdentityRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest} GetContestedResourceVotersForIdentityRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetContestedResourceVotersForIdentityRequest.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.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetContestedResourceVotersForIdentityRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest} GetContestedResourceVotersForIdentityRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetContestedResourceVotersForIdentityRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetContestedResourceVotersForIdentityRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetContestedResourceVotersForIdentityRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetContestedResourceVotersForIdentityRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest} GetContestedResourceVotersForIdentityRequest + */ + GetContestedResourceVotersForIdentityRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetContestedResourceVotersForIdentityRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest} message GetContestedResourceVotersForIdentityRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetContestedResourceVotersForIdentityRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetContestedResourceVotersForIdentityRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest + * @instance + * @returns {Object.} JSON object + */ + GetContestedResourceVotersForIdentityRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0 = (function() { + + /** + * Properties of a GetContestedResourceVotersForIdentityRequestV0. + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest + * @interface IGetContestedResourceVotersForIdentityRequestV0 + * @property {Uint8Array|null} [contractId] GetContestedResourceVotersForIdentityRequestV0 contractId + * @property {string|null} [documentTypeName] GetContestedResourceVotersForIdentityRequestV0 documentTypeName + * @property {string|null} [indexName] GetContestedResourceVotersForIdentityRequestV0 indexName + * @property {Array.|null} [indexValues] GetContestedResourceVotersForIdentityRequestV0 indexValues + * @property {Uint8Array|null} [contestantId] GetContestedResourceVotersForIdentityRequestV0 contestantId + * @property {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.IStartAtIdentifierInfo|null} [startAtIdentifierInfo] GetContestedResourceVotersForIdentityRequestV0 startAtIdentifierInfo + * @property {number|null} [count] GetContestedResourceVotersForIdentityRequestV0 count + * @property {boolean|null} [orderAscending] GetContestedResourceVotersForIdentityRequestV0 orderAscending + * @property {boolean|null} [prove] GetContestedResourceVotersForIdentityRequestV0 prove + */ + + /** + * Constructs a new GetContestedResourceVotersForIdentityRequestV0. + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest + * @classdesc Represents a GetContestedResourceVotersForIdentityRequestV0. + * @implements IGetContestedResourceVotersForIdentityRequestV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.IGetContestedResourceVotersForIdentityRequestV0=} [properties] Properties to set + */ + function GetContestedResourceVotersForIdentityRequestV0(properties) { + this.indexValues = []; + 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]]; + } + + /** + * GetContestedResourceVotersForIdentityRequestV0 contractId. + * @member {Uint8Array} contractId + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0 + * @instance + */ + GetContestedResourceVotersForIdentityRequestV0.prototype.contractId = $util.newBuffer([]); + + /** + * GetContestedResourceVotersForIdentityRequestV0 documentTypeName. + * @member {string} documentTypeName + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0 + * @instance + */ + GetContestedResourceVotersForIdentityRequestV0.prototype.documentTypeName = ""; + + /** + * GetContestedResourceVotersForIdentityRequestV0 indexName. + * @member {string} indexName + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0 + * @instance + */ + GetContestedResourceVotersForIdentityRequestV0.prototype.indexName = ""; + + /** + * GetContestedResourceVotersForIdentityRequestV0 indexValues. + * @member {Array.} indexValues + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0 + * @instance + */ + GetContestedResourceVotersForIdentityRequestV0.prototype.indexValues = $util.emptyArray; + + /** + * GetContestedResourceVotersForIdentityRequestV0 contestantId. + * @member {Uint8Array} contestantId + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0 + * @instance + */ + GetContestedResourceVotersForIdentityRequestV0.prototype.contestantId = $util.newBuffer([]); + + /** + * GetContestedResourceVotersForIdentityRequestV0 startAtIdentifierInfo. + * @member {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.IStartAtIdentifierInfo|null|undefined} startAtIdentifierInfo + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0 + * @instance + */ + GetContestedResourceVotersForIdentityRequestV0.prototype.startAtIdentifierInfo = null; + + /** + * GetContestedResourceVotersForIdentityRequestV0 count. + * @member {number} count + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0 + * @instance + */ + GetContestedResourceVotersForIdentityRequestV0.prototype.count = 0; + + /** + * GetContestedResourceVotersForIdentityRequestV0 orderAscending. + * @member {boolean} orderAscending + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0 + * @instance + */ + GetContestedResourceVotersForIdentityRequestV0.prototype.orderAscending = false; + + /** + * GetContestedResourceVotersForIdentityRequestV0 prove. + * @member {boolean} prove + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0 + * @instance + */ + GetContestedResourceVotersForIdentityRequestV0.prototype.prove = false; + + /** + * Creates a new GetContestedResourceVotersForIdentityRequestV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.IGetContestedResourceVotersForIdentityRequestV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0} GetContestedResourceVotersForIdentityRequestV0 instance + */ + GetContestedResourceVotersForIdentityRequestV0.create = function create(properties) { + return new GetContestedResourceVotersForIdentityRequestV0(properties); + }; + + /** + * Encodes the specified GetContestedResourceVotersForIdentityRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.IGetContestedResourceVotersForIdentityRequestV0} message GetContestedResourceVotersForIdentityRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetContestedResourceVotersForIdentityRequestV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.contractId != null && Object.hasOwnProperty.call(message, "contractId")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.contractId); + if (message.documentTypeName != null && Object.hasOwnProperty.call(message, "documentTypeName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.documentTypeName); + if (message.indexName != null && Object.hasOwnProperty.call(message, "indexName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.indexName); + if (message.indexValues != null && message.indexValues.length) + for (var i = 0; i < message.indexValues.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.indexValues[i]); + if (message.contestantId != null && Object.hasOwnProperty.call(message, "contestantId")) + writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.contestantId); + if (message.startAtIdentifierInfo != null && Object.hasOwnProperty.call(message, "startAtIdentifierInfo")) + $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfo.encode(message.startAtIdentifierInfo, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.count != null && Object.hasOwnProperty.call(message, "count")) + writer.uint32(/* id 7, wireType 0 =*/56).uint32(message.count); + if (message.orderAscending != null && Object.hasOwnProperty.call(message, "orderAscending")) + writer.uint32(/* id 8, wireType 0 =*/64).bool(message.orderAscending); + if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) + writer.uint32(/* id 9, wireType 0 =*/72).bool(message.prove); + return writer; + }; + + /** + * Encodes the specified GetContestedResourceVotersForIdentityRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.IGetContestedResourceVotersForIdentityRequestV0} message GetContestedResourceVotersForIdentityRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetContestedResourceVotersForIdentityRequestV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetContestedResourceVotersForIdentityRequestV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0} GetContestedResourceVotersForIdentityRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetContestedResourceVotersForIdentityRequestV0.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.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.contractId = reader.bytes(); + break; + case 2: + message.documentTypeName = reader.string(); + break; + case 3: + message.indexName = reader.string(); + break; + case 4: + if (!(message.indexValues && message.indexValues.length)) + message.indexValues = []; + message.indexValues.push(reader.bytes()); + break; + case 5: + message.contestantId = reader.bytes(); + break; + case 6: + message.startAtIdentifierInfo = $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfo.decode(reader, reader.uint32()); + break; + case 7: + message.count = reader.uint32(); + break; + case 8: + message.orderAscending = reader.bool(); + break; + case 9: + message.prove = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetContestedResourceVotersForIdentityRequestV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0} GetContestedResourceVotersForIdentityRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetContestedResourceVotersForIdentityRequestV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetContestedResourceVotersForIdentityRequestV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetContestedResourceVotersForIdentityRequestV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.contractId != null && message.hasOwnProperty("contractId")) + if (!(message.contractId && typeof message.contractId.length === "number" || $util.isString(message.contractId))) + return "contractId: buffer expected"; + if (message.documentTypeName != null && message.hasOwnProperty("documentTypeName")) + if (!$util.isString(message.documentTypeName)) + return "documentTypeName: string expected"; + if (message.indexName != null && message.hasOwnProperty("indexName")) + if (!$util.isString(message.indexName)) + return "indexName: string expected"; + if (message.indexValues != null && message.hasOwnProperty("indexValues")) { + if (!Array.isArray(message.indexValues)) + return "indexValues: array expected"; + for (var i = 0; i < message.indexValues.length; ++i) + if (!(message.indexValues[i] && typeof message.indexValues[i].length === "number" || $util.isString(message.indexValues[i]))) + return "indexValues: buffer[] expected"; + } + if (message.contestantId != null && message.hasOwnProperty("contestantId")) + if (!(message.contestantId && typeof message.contestantId.length === "number" || $util.isString(message.contestantId))) + return "contestantId: buffer expected"; + if (message.startAtIdentifierInfo != null && message.hasOwnProperty("startAtIdentifierInfo")) { + var error = $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfo.verify(message.startAtIdentifierInfo); + if (error) + return "startAtIdentifierInfo." + error; + } + if (message.count != null && message.hasOwnProperty("count")) + if (!$util.isInteger(message.count)) + return "count: integer expected"; + if (message.orderAscending != null && message.hasOwnProperty("orderAscending")) + if (typeof message.orderAscending !== "boolean") + return "orderAscending: boolean expected"; + if (message.prove != null && message.hasOwnProperty("prove")) + if (typeof message.prove !== "boolean") + return "prove: boolean expected"; + return null; + }; + + /** + * Creates a GetContestedResourceVotersForIdentityRequestV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0} GetContestedResourceVotersForIdentityRequestV0 + */ + GetContestedResourceVotersForIdentityRequestV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0(); + if (object.contractId != null) + if (typeof object.contractId === "string") + $util.base64.decode(object.contractId, message.contractId = $util.newBuffer($util.base64.length(object.contractId)), 0); + else if (object.contractId.length >= 0) + message.contractId = object.contractId; + if (object.documentTypeName != null) + message.documentTypeName = String(object.documentTypeName); + if (object.indexName != null) + message.indexName = String(object.indexName); + if (object.indexValues) { + if (!Array.isArray(object.indexValues)) + throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.indexValues: array expected"); + message.indexValues = []; + for (var i = 0; i < object.indexValues.length; ++i) + if (typeof object.indexValues[i] === "string") + $util.base64.decode(object.indexValues[i], message.indexValues[i] = $util.newBuffer($util.base64.length(object.indexValues[i])), 0); + else if (object.indexValues[i].length >= 0) + message.indexValues[i] = object.indexValues[i]; + } + if (object.contestantId != null) + if (typeof object.contestantId === "string") + $util.base64.decode(object.contestantId, message.contestantId = $util.newBuffer($util.base64.length(object.contestantId)), 0); + else if (object.contestantId.length >= 0) + message.contestantId = object.contestantId; + if (object.startAtIdentifierInfo != null) { + if (typeof object.startAtIdentifierInfo !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.startAtIdentifierInfo: object expected"); + message.startAtIdentifierInfo = $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfo.fromObject(object.startAtIdentifierInfo); + } + if (object.count != null) + message.count = object.count >>> 0; + if (object.orderAscending != null) + message.orderAscending = Boolean(object.orderAscending); + if (object.prove != null) + message.prove = Boolean(object.prove); + return message; + }; + + /** + * Creates a plain object from a GetContestedResourceVotersForIdentityRequestV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0} message GetContestedResourceVotersForIdentityRequestV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetContestedResourceVotersForIdentityRequestV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.indexValues = []; + if (options.defaults) { + if (options.bytes === String) + object.contractId = ""; + else { + object.contractId = []; + if (options.bytes !== Array) + object.contractId = $util.newBuffer(object.contractId); + } + object.documentTypeName = ""; + object.indexName = ""; + if (options.bytes === String) + object.contestantId = ""; + else { + object.contestantId = []; + if (options.bytes !== Array) + object.contestantId = $util.newBuffer(object.contestantId); + } + object.startAtIdentifierInfo = null; + object.count = 0; + object.orderAscending = false; + object.prove = false; + } + if (message.contractId != null && message.hasOwnProperty("contractId")) + object.contractId = options.bytes === String ? $util.base64.encode(message.contractId, 0, message.contractId.length) : options.bytes === Array ? Array.prototype.slice.call(message.contractId) : message.contractId; + if (message.documentTypeName != null && message.hasOwnProperty("documentTypeName")) + object.documentTypeName = message.documentTypeName; + if (message.indexName != null && message.hasOwnProperty("indexName")) + object.indexName = message.indexName; + if (message.indexValues && message.indexValues.length) { + object.indexValues = []; + for (var j = 0; j < message.indexValues.length; ++j) + object.indexValues[j] = options.bytes === String ? $util.base64.encode(message.indexValues[j], 0, message.indexValues[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.indexValues[j]) : message.indexValues[j]; + } + if (message.contestantId != null && message.hasOwnProperty("contestantId")) + object.contestantId = options.bytes === String ? $util.base64.encode(message.contestantId, 0, message.contestantId.length) : options.bytes === Array ? Array.prototype.slice.call(message.contestantId) : message.contestantId; + if (message.startAtIdentifierInfo != null && message.hasOwnProperty("startAtIdentifierInfo")) + object.startAtIdentifierInfo = $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfo.toObject(message.startAtIdentifierInfo, options); + if (message.count != null && message.hasOwnProperty("count")) + object.count = message.count; + if (message.orderAscending != null && message.hasOwnProperty("orderAscending")) + object.orderAscending = message.orderAscending; + if (message.prove != null && message.hasOwnProperty("prove")) + object.prove = message.prove; + return object; + }; + + /** + * Converts this GetContestedResourceVotersForIdentityRequestV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0 + * @instance + * @returns {Object.} JSON object + */ + GetContestedResourceVotersForIdentityRequestV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfo = (function() { + + /** + * Properties of a StartAtIdentifierInfo. + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0 + * @interface IStartAtIdentifierInfo + * @property {Uint8Array|null} [startIdentifier] StartAtIdentifierInfo startIdentifier + * @property {boolean|null} [startIdentifierIncluded] StartAtIdentifierInfo startIdentifierIncluded + */ + + /** + * Constructs a new StartAtIdentifierInfo. + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0 + * @classdesc Represents a StartAtIdentifierInfo. + * @implements IStartAtIdentifierInfo + * @constructor + * @param {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.IStartAtIdentifierInfo=} [properties] Properties to set + */ + function StartAtIdentifierInfo(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]]; + } + + /** + * StartAtIdentifierInfo startIdentifier. + * @member {Uint8Array} startIdentifier + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfo + * @instance + */ + StartAtIdentifierInfo.prototype.startIdentifier = $util.newBuffer([]); + + /** + * StartAtIdentifierInfo startIdentifierIncluded. + * @member {boolean} startIdentifierIncluded + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfo + * @instance + */ + StartAtIdentifierInfo.prototype.startIdentifierIncluded = false; + + /** + * Creates a new StartAtIdentifierInfo instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfo + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.IStartAtIdentifierInfo=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfo} StartAtIdentifierInfo instance + */ + StartAtIdentifierInfo.create = function create(properties) { + return new StartAtIdentifierInfo(properties); + }; + + /** + * Encodes the specified StartAtIdentifierInfo message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfo.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfo + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.IStartAtIdentifierInfo} message StartAtIdentifierInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StartAtIdentifierInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.startIdentifier != null && Object.hasOwnProperty.call(message, "startIdentifier")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.startIdentifier); + if (message.startIdentifierIncluded != null && Object.hasOwnProperty.call(message, "startIdentifierIncluded")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.startIdentifierIncluded); + return writer; + }; + + /** + * Encodes the specified StartAtIdentifierInfo message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfo + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.IStartAtIdentifierInfo} message StartAtIdentifierInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StartAtIdentifierInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StartAtIdentifierInfo message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfo} StartAtIdentifierInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StartAtIdentifierInfo.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.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.startIdentifier = reader.bytes(); + break; + case 2: + message.startIdentifierIncluded = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StartAtIdentifierInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfo} StartAtIdentifierInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StartAtIdentifierInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StartAtIdentifierInfo message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StartAtIdentifierInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.startIdentifier != null && message.hasOwnProperty("startIdentifier")) + if (!(message.startIdentifier && typeof message.startIdentifier.length === "number" || $util.isString(message.startIdentifier))) + return "startIdentifier: buffer expected"; + if (message.startIdentifierIncluded != null && message.hasOwnProperty("startIdentifierIncluded")) + if (typeof message.startIdentifierIncluded !== "boolean") + return "startIdentifierIncluded: boolean expected"; + return null; + }; + + /** + * Creates a StartAtIdentifierInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfo + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfo} StartAtIdentifierInfo + */ + StartAtIdentifierInfo.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfo) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfo(); + if (object.startIdentifier != null) + if (typeof object.startIdentifier === "string") + $util.base64.decode(object.startIdentifier, message.startIdentifier = $util.newBuffer($util.base64.length(object.startIdentifier)), 0); + else if (object.startIdentifier.length >= 0) + message.startIdentifier = object.startIdentifier; + if (object.startIdentifierIncluded != null) + message.startIdentifierIncluded = Boolean(object.startIdentifierIncluded); + return message; + }; + + /** + * Creates a plain object from a StartAtIdentifierInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfo + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfo} message StartAtIdentifierInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StartAtIdentifierInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.startIdentifier = ""; + else { + object.startIdentifier = []; + if (options.bytes !== Array) + object.startIdentifier = $util.newBuffer(object.startIdentifier); + } + object.startIdentifierIncluded = false; + } + if (message.startIdentifier != null && message.hasOwnProperty("startIdentifier")) + object.startIdentifier = options.bytes === String ? $util.base64.encode(message.startIdentifier, 0, message.startIdentifier.length) : options.bytes === Array ? Array.prototype.slice.call(message.startIdentifier) : message.startIdentifier; + if (message.startIdentifierIncluded != null && message.hasOwnProperty("startIdentifierIncluded")) + object.startIdentifierIncluded = message.startIdentifierIncluded; + return object; + }; + + /** + * Converts this StartAtIdentifierInfo to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfo + * @instance + * @returns {Object.} JSON object + */ + StartAtIdentifierInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return StartAtIdentifierInfo; + })(); + + return GetContestedResourceVotersForIdentityRequestV0; + })(); + + return GetContestedResourceVotersForIdentityRequest; + })(); + + v0.GetContestedResourceVotersForIdentityResponse = (function() { + + /** + * Properties of a GetContestedResourceVotersForIdentityResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetContestedResourceVotersForIdentityResponse + * @property {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.IGetContestedResourceVotersForIdentityResponseV0|null} [v0] GetContestedResourceVotersForIdentityResponse v0 + */ + + /** + * Constructs a new GetContestedResourceVotersForIdentityResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetContestedResourceVotersForIdentityResponse. + * @implements IGetContestedResourceVotersForIdentityResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IGetContestedResourceVotersForIdentityResponse=} [properties] Properties to set + */ + function GetContestedResourceVotersForIdentityResponse(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]]; + } + + /** + * GetContestedResourceVotersForIdentityResponse v0. + * @member {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.IGetContestedResourceVotersForIdentityResponseV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse + * @instance + */ + GetContestedResourceVotersForIdentityResponse.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetContestedResourceVotersForIdentityResponse version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse + * @instance + */ + Object.defineProperty(GetContestedResourceVotersForIdentityResponse.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetContestedResourceVotersForIdentityResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetContestedResourceVotersForIdentityResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse} GetContestedResourceVotersForIdentityResponse instance + */ + GetContestedResourceVotersForIdentityResponse.create = function create(properties) { + return new GetContestedResourceVotersForIdentityResponse(properties); + }; + + /** + * Encodes the specified GetContestedResourceVotersForIdentityResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetContestedResourceVotersForIdentityResponse} message GetContestedResourceVotersForIdentityResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetContestedResourceVotersForIdentityResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetContestedResourceVotersForIdentityResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetContestedResourceVotersForIdentityResponse} message GetContestedResourceVotersForIdentityResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetContestedResourceVotersForIdentityResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetContestedResourceVotersForIdentityResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse} GetContestedResourceVotersForIdentityResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetContestedResourceVotersForIdentityResponse.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.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetContestedResourceVotersForIdentityResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse} GetContestedResourceVotersForIdentityResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetContestedResourceVotersForIdentityResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetContestedResourceVotersForIdentityResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetContestedResourceVotersForIdentityResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetContestedResourceVotersForIdentityResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse} GetContestedResourceVotersForIdentityResponse + */ + GetContestedResourceVotersForIdentityResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetContestedResourceVotersForIdentityResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse} message GetContestedResourceVotersForIdentityResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetContestedResourceVotersForIdentityResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetContestedResourceVotersForIdentityResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse + * @instance + * @returns {Object.} JSON object + */ + GetContestedResourceVotersForIdentityResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0 = (function() { + + /** + * Properties of a GetContestedResourceVotersForIdentityResponseV0. + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse + * @interface IGetContestedResourceVotersForIdentityResponseV0 + * @property {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.IContestedResourceVoters|null} [contestedResourceVoters] GetContestedResourceVotersForIdentityResponseV0 contestedResourceVoters + * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetContestedResourceVotersForIdentityResponseV0 proof + * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetContestedResourceVotersForIdentityResponseV0 metadata + */ + + /** + * Constructs a new GetContestedResourceVotersForIdentityResponseV0. + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse + * @classdesc Represents a GetContestedResourceVotersForIdentityResponseV0. + * @implements IGetContestedResourceVotersForIdentityResponseV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.IGetContestedResourceVotersForIdentityResponseV0=} [properties] Properties to set + */ + function GetContestedResourceVotersForIdentityResponseV0(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]]; + } + + /** + * GetContestedResourceVotersForIdentityResponseV0 contestedResourceVoters. + * @member {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.IContestedResourceVoters|null|undefined} contestedResourceVoters + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0 + * @instance + */ + GetContestedResourceVotersForIdentityResponseV0.prototype.contestedResourceVoters = null; + + /** + * GetContestedResourceVotersForIdentityResponseV0 proof. + * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0 + * @instance + */ + GetContestedResourceVotersForIdentityResponseV0.prototype.proof = null; + + /** + * GetContestedResourceVotersForIdentityResponseV0 metadata. + * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0 + * @instance + */ + GetContestedResourceVotersForIdentityResponseV0.prototype.metadata = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetContestedResourceVotersForIdentityResponseV0 result. + * @member {"contestedResourceVoters"|"proof"|undefined} result + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0 + * @instance + */ + Object.defineProperty(GetContestedResourceVotersForIdentityResponseV0.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["contestedResourceVoters", "proof"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetContestedResourceVotersForIdentityResponseV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.IGetContestedResourceVotersForIdentityResponseV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0} GetContestedResourceVotersForIdentityResponseV0 instance + */ + GetContestedResourceVotersForIdentityResponseV0.create = function create(properties) { + return new GetContestedResourceVotersForIdentityResponseV0(properties); + }; + + /** + * Encodes the specified GetContestedResourceVotersForIdentityResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.IGetContestedResourceVotersForIdentityResponseV0} message GetContestedResourceVotersForIdentityResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetContestedResourceVotersForIdentityResponseV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.contestedResourceVoters != null && Object.hasOwnProperty.call(message, "contestedResourceVoters")) + $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters.encode(message.contestedResourceVoters, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetContestedResourceVotersForIdentityResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.IGetContestedResourceVotersForIdentityResponseV0} message GetContestedResourceVotersForIdentityResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetContestedResourceVotersForIdentityResponseV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetContestedResourceVotersForIdentityResponseV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0} GetContestedResourceVotersForIdentityResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetContestedResourceVotersForIdentityResponseV0.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.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.contestedResourceVoters = $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters.decode(reader, reader.uint32()); + break; + case 2: + message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); + break; + case 3: + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetContestedResourceVotersForIdentityResponseV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0} GetContestedResourceVotersForIdentityResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetContestedResourceVotersForIdentityResponseV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetContestedResourceVotersForIdentityResponseV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetContestedResourceVotersForIdentityResponseV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.contestedResourceVoters != null && message.hasOwnProperty("contestedResourceVoters")) { + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters.verify(message.contestedResourceVoters); + if (error) + return "contestedResourceVoters." + error; + } + } + if (message.proof != null && message.hasOwnProperty("proof")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); + if (error) + return "proof." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a GetContestedResourceVotersForIdentityResponseV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0} GetContestedResourceVotersForIdentityResponseV0 + */ + GetContestedResourceVotersForIdentityResponseV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0(); + if (object.contestedResourceVoters != null) { + if (typeof object.contestedResourceVoters !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.contestedResourceVoters: object expected"); + message.contestedResourceVoters = $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters.fromObject(object.contestedResourceVoters); + } + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.proof: object expected"); + message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.metadata: object expected"); + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a GetContestedResourceVotersForIdentityResponseV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0} message GetContestedResourceVotersForIdentityResponseV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetContestedResourceVotersForIdentityResponseV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.metadata = null; + if (message.contestedResourceVoters != null && message.hasOwnProperty("contestedResourceVoters")) { + object.contestedResourceVoters = $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters.toObject(message.contestedResourceVoters, options); + if (options.oneofs) + object.result = "contestedResourceVoters"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); + if (options.oneofs) + object.result = "proof"; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this GetContestedResourceVotersForIdentityResponseV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0 + * @instance + * @returns {Object.} JSON object + */ + GetContestedResourceVotersForIdentityResponseV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters = (function() { + + /** + * Properties of a ContestedResourceVoters. + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0 + * @interface IContestedResourceVoters + * @property {Array.|null} [voters] ContestedResourceVoters voters + * @property {boolean|null} [finishedResults] ContestedResourceVoters finishedResults + */ + + /** + * Constructs a new ContestedResourceVoters. + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0 + * @classdesc Represents a ContestedResourceVoters. + * @implements IContestedResourceVoters + * @constructor + * @param {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.IContestedResourceVoters=} [properties] Properties to set + */ + function ContestedResourceVoters(properties) { + this.voters = []; + 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]]; + } + + /** + * ContestedResourceVoters voters. + * @member {Array.} voters + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters + * @instance + */ + ContestedResourceVoters.prototype.voters = $util.emptyArray; + + /** + * ContestedResourceVoters finishedResults. + * @member {boolean} finishedResults + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters + * @instance + */ + ContestedResourceVoters.prototype.finishedResults = false; + + /** + * Creates a new ContestedResourceVoters instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.IContestedResourceVoters=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters} ContestedResourceVoters instance + */ + ContestedResourceVoters.create = function create(properties) { + return new ContestedResourceVoters(properties); + }; + + /** + * Encodes the specified ContestedResourceVoters message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.IContestedResourceVoters} message ContestedResourceVoters message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContestedResourceVoters.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.voters != null && message.voters.length) + for (var i = 0; i < message.voters.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.voters[i]); + if (message.finishedResults != null && Object.hasOwnProperty.call(message, "finishedResults")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.finishedResults); + return writer; + }; + + /** + * Encodes the specified ContestedResourceVoters message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.IContestedResourceVoters} message ContestedResourceVoters message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContestedResourceVoters.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ContestedResourceVoters message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters} ContestedResourceVoters + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContestedResourceVoters.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.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.voters && message.voters.length)) + message.voters = []; + message.voters.push(reader.bytes()); + break; + case 2: + message.finishedResults = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ContestedResourceVoters message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters} ContestedResourceVoters + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContestedResourceVoters.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ContestedResourceVoters message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ContestedResourceVoters.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.voters != null && message.hasOwnProperty("voters")) { + if (!Array.isArray(message.voters)) + return "voters: array expected"; + for (var i = 0; i < message.voters.length; ++i) + if (!(message.voters[i] && typeof message.voters[i].length === "number" || $util.isString(message.voters[i]))) + return "voters: buffer[] expected"; + } + if (message.finishedResults != null && message.hasOwnProperty("finishedResults")) + if (typeof message.finishedResults !== "boolean") + return "finishedResults: boolean expected"; + return null; + }; + + /** + * Creates a ContestedResourceVoters message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters} ContestedResourceVoters + */ + ContestedResourceVoters.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters(); + if (object.voters) { + if (!Array.isArray(object.voters)) + throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters.voters: array expected"); + message.voters = []; + for (var i = 0; i < object.voters.length; ++i) + if (typeof object.voters[i] === "string") + $util.base64.decode(object.voters[i], message.voters[i] = $util.newBuffer($util.base64.length(object.voters[i])), 0); + else if (object.voters[i].length >= 0) + message.voters[i] = object.voters[i]; + } + if (object.finishedResults != null) + message.finishedResults = Boolean(object.finishedResults); + return message; + }; + + /** + * Creates a plain object from a ContestedResourceVoters message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters} message ContestedResourceVoters + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ContestedResourceVoters.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.voters = []; + if (options.defaults) + object.finishedResults = false; + if (message.voters && message.voters.length) { + object.voters = []; + for (var j = 0; j < message.voters.length; ++j) + object.voters[j] = options.bytes === String ? $util.base64.encode(message.voters[j], 0, message.voters[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.voters[j]) : message.voters[j]; + } + if (message.finishedResults != null && message.hasOwnProperty("finishedResults")) + object.finishedResults = message.finishedResults; + return object; + }; + + /** + * Converts this ContestedResourceVoters to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters + * @instance + * @returns {Object.} JSON object + */ + ContestedResourceVoters.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ContestedResourceVoters; + })(); + + return GetContestedResourceVotersForIdentityResponseV0; + })(); + + return GetContestedResourceVotersForIdentityResponse; + })(); + + v0.GetContestedResourceIdentityVotesRequest = (function() { + + /** + * Properties of a GetContestedResourceIdentityVotesRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetContestedResourceIdentityVotesRequest + * @property {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.IGetContestedResourceIdentityVotesRequestV0|null} [v0] GetContestedResourceIdentityVotesRequest v0 + */ + + /** + * Constructs a new GetContestedResourceIdentityVotesRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetContestedResourceIdentityVotesRequest. + * @implements IGetContestedResourceIdentityVotesRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IGetContestedResourceIdentityVotesRequest=} [properties] Properties to set + */ + function GetContestedResourceIdentityVotesRequest(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]]; + } + + /** + * GetContestedResourceIdentityVotesRequest v0. + * @member {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.IGetContestedResourceIdentityVotesRequestV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest + * @instance + */ + GetContestedResourceIdentityVotesRequest.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetContestedResourceIdentityVotesRequest version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest + * @instance + */ + Object.defineProperty(GetContestedResourceIdentityVotesRequest.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetContestedResourceIdentityVotesRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetContestedResourceIdentityVotesRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest} GetContestedResourceIdentityVotesRequest instance + */ + GetContestedResourceIdentityVotesRequest.create = function create(properties) { + return new GetContestedResourceIdentityVotesRequest(properties); + }; + + /** + * Encodes the specified GetContestedResourceIdentityVotesRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetContestedResourceIdentityVotesRequest} message GetContestedResourceIdentityVotesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetContestedResourceIdentityVotesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetContestedResourceIdentityVotesRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetContestedResourceIdentityVotesRequest} message GetContestedResourceIdentityVotesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetContestedResourceIdentityVotesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetContestedResourceIdentityVotesRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest} GetContestedResourceIdentityVotesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetContestedResourceIdentityVotesRequest.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.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetContestedResourceIdentityVotesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest} GetContestedResourceIdentityVotesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetContestedResourceIdentityVotesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetContestedResourceIdentityVotesRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetContestedResourceIdentityVotesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetContestedResourceIdentityVotesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest} GetContestedResourceIdentityVotesRequest + */ + GetContestedResourceIdentityVotesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetContestedResourceIdentityVotesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest} message GetContestedResourceIdentityVotesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetContestedResourceIdentityVotesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetContestedResourceIdentityVotesRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest + * @instance + * @returns {Object.} JSON object + */ + GetContestedResourceIdentityVotesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0 = (function() { + + /** + * Properties of a GetContestedResourceIdentityVotesRequestV0. + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest + * @interface IGetContestedResourceIdentityVotesRequestV0 + * @property {Uint8Array|null} [identityId] GetContestedResourceIdentityVotesRequestV0 identityId + * @property {google.protobuf.IUInt32Value|null} [limit] GetContestedResourceIdentityVotesRequestV0 limit + * @property {google.protobuf.IUInt32Value|null} [offset] GetContestedResourceIdentityVotesRequestV0 offset + * @property {boolean|null} [orderAscending] GetContestedResourceIdentityVotesRequestV0 orderAscending + * @property {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.IStartAtVotePollIdInfo|null} [startAtVotePollIdInfo] GetContestedResourceIdentityVotesRequestV0 startAtVotePollIdInfo + * @property {boolean|null} [prove] GetContestedResourceIdentityVotesRequestV0 prove + */ + + /** + * Constructs a new GetContestedResourceIdentityVotesRequestV0. + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest + * @classdesc Represents a GetContestedResourceIdentityVotesRequestV0. + * @implements IGetContestedResourceIdentityVotesRequestV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.IGetContestedResourceIdentityVotesRequestV0=} [properties] Properties to set + */ + function GetContestedResourceIdentityVotesRequestV0(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]]; + } + + /** + * GetContestedResourceIdentityVotesRequestV0 identityId. + * @member {Uint8Array} identityId + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0 + * @instance + */ + GetContestedResourceIdentityVotesRequestV0.prototype.identityId = $util.newBuffer([]); + + /** + * GetContestedResourceIdentityVotesRequestV0 limit. + * @member {google.protobuf.IUInt32Value|null|undefined} limit + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0 + * @instance + */ + GetContestedResourceIdentityVotesRequestV0.prototype.limit = null; + + /** + * GetContestedResourceIdentityVotesRequestV0 offset. + * @member {google.protobuf.IUInt32Value|null|undefined} offset + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0 + * @instance + */ + GetContestedResourceIdentityVotesRequestV0.prototype.offset = null; + + /** + * GetContestedResourceIdentityVotesRequestV0 orderAscending. + * @member {boolean} orderAscending + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0 + * @instance + */ + GetContestedResourceIdentityVotesRequestV0.prototype.orderAscending = false; + + /** + * GetContestedResourceIdentityVotesRequestV0 startAtVotePollIdInfo. + * @member {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.IStartAtVotePollIdInfo|null|undefined} startAtVotePollIdInfo + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0 + * @instance + */ + GetContestedResourceIdentityVotesRequestV0.prototype.startAtVotePollIdInfo = null; + + /** + * GetContestedResourceIdentityVotesRequestV0 prove. + * @member {boolean} prove + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0 + * @instance + */ + GetContestedResourceIdentityVotesRequestV0.prototype.prove = false; + + /** + * Creates a new GetContestedResourceIdentityVotesRequestV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.IGetContestedResourceIdentityVotesRequestV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0} GetContestedResourceIdentityVotesRequestV0 instance + */ + GetContestedResourceIdentityVotesRequestV0.create = function create(properties) { + return new GetContestedResourceIdentityVotesRequestV0(properties); + }; + + /** + * Encodes the specified GetContestedResourceIdentityVotesRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.IGetContestedResourceIdentityVotesRequestV0} message GetContestedResourceIdentityVotesRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetContestedResourceIdentityVotesRequestV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.identityId != null && Object.hasOwnProperty.call(message, "identityId")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.identityId); + if (message.limit != null && Object.hasOwnProperty.call(message, "limit")) + $root.google.protobuf.UInt32Value.encode(message.limit, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.offset != null && Object.hasOwnProperty.call(message, "offset")) + $root.google.protobuf.UInt32Value.encode(message.offset, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.orderAscending != null && Object.hasOwnProperty.call(message, "orderAscending")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.orderAscending); + if (message.startAtVotePollIdInfo != null && Object.hasOwnProperty.call(message, "startAtVotePollIdInfo")) + $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfo.encode(message.startAtVotePollIdInfo, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.prove); + return writer; + }; + + /** + * Encodes the specified GetContestedResourceIdentityVotesRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.IGetContestedResourceIdentityVotesRequestV0} message GetContestedResourceIdentityVotesRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetContestedResourceIdentityVotesRequestV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetContestedResourceIdentityVotesRequestV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0} GetContestedResourceIdentityVotesRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetContestedResourceIdentityVotesRequestV0.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.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.identityId = reader.bytes(); + break; + case 2: + message.limit = $root.google.protobuf.UInt32Value.decode(reader, reader.uint32()); + break; + case 3: + message.offset = $root.google.protobuf.UInt32Value.decode(reader, reader.uint32()); + break; + case 4: + message.orderAscending = reader.bool(); + break; + case 5: + message.startAtVotePollIdInfo = $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfo.decode(reader, reader.uint32()); + break; + case 6: + message.prove = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetContestedResourceIdentityVotesRequestV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0} GetContestedResourceIdentityVotesRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetContestedResourceIdentityVotesRequestV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetContestedResourceIdentityVotesRequestV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetContestedResourceIdentityVotesRequestV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.identityId != null && message.hasOwnProperty("identityId")) + if (!(message.identityId && typeof message.identityId.length === "number" || $util.isString(message.identityId))) + return "identityId: buffer expected"; + if (message.limit != null && message.hasOwnProperty("limit")) { + var error = $root.google.protobuf.UInt32Value.verify(message.limit); + if (error) + return "limit." + error; + } + if (message.offset != null && message.hasOwnProperty("offset")) { + var error = $root.google.protobuf.UInt32Value.verify(message.offset); + if (error) + return "offset." + error; + } + if (message.orderAscending != null && message.hasOwnProperty("orderAscending")) + if (typeof message.orderAscending !== "boolean") + return "orderAscending: boolean expected"; + if (message.startAtVotePollIdInfo != null && message.hasOwnProperty("startAtVotePollIdInfo")) { + var error = $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfo.verify(message.startAtVotePollIdInfo); + if (error) + return "startAtVotePollIdInfo." + error; + } + if (message.prove != null && message.hasOwnProperty("prove")) + if (typeof message.prove !== "boolean") + return "prove: boolean expected"; + return null; + }; + + /** + * Creates a GetContestedResourceIdentityVotesRequestV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0} GetContestedResourceIdentityVotesRequestV0 + */ + GetContestedResourceIdentityVotesRequestV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0(); + if (object.identityId != null) + if (typeof object.identityId === "string") + $util.base64.decode(object.identityId, message.identityId = $util.newBuffer($util.base64.length(object.identityId)), 0); + else if (object.identityId.length >= 0) + message.identityId = object.identityId; + if (object.limit != null) { + if (typeof object.limit !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.limit: object expected"); + message.limit = $root.google.protobuf.UInt32Value.fromObject(object.limit); + } + if (object.offset != null) { + if (typeof object.offset !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.offset: object expected"); + message.offset = $root.google.protobuf.UInt32Value.fromObject(object.offset); + } + if (object.orderAscending != null) + message.orderAscending = Boolean(object.orderAscending); + if (object.startAtVotePollIdInfo != null) { + if (typeof object.startAtVotePollIdInfo !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.startAtVotePollIdInfo: object expected"); + message.startAtVotePollIdInfo = $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfo.fromObject(object.startAtVotePollIdInfo); + } + if (object.prove != null) + message.prove = Boolean(object.prove); + return message; + }; + + /** + * Creates a plain object from a GetContestedResourceIdentityVotesRequestV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0} message GetContestedResourceIdentityVotesRequestV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetContestedResourceIdentityVotesRequestV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.identityId = ""; + else { + object.identityId = []; + if (options.bytes !== Array) + object.identityId = $util.newBuffer(object.identityId); + } + object.limit = null; + object.offset = null; + object.orderAscending = false; + object.startAtVotePollIdInfo = null; + object.prove = false; + } + if (message.identityId != null && message.hasOwnProperty("identityId")) + object.identityId = options.bytes === String ? $util.base64.encode(message.identityId, 0, message.identityId.length) : options.bytes === Array ? Array.prototype.slice.call(message.identityId) : message.identityId; + if (message.limit != null && message.hasOwnProperty("limit")) + object.limit = $root.google.protobuf.UInt32Value.toObject(message.limit, options); + if (message.offset != null && message.hasOwnProperty("offset")) + object.offset = $root.google.protobuf.UInt32Value.toObject(message.offset, options); + if (message.orderAscending != null && message.hasOwnProperty("orderAscending")) + object.orderAscending = message.orderAscending; + if (message.startAtVotePollIdInfo != null && message.hasOwnProperty("startAtVotePollIdInfo")) + object.startAtVotePollIdInfo = $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfo.toObject(message.startAtVotePollIdInfo, options); + if (message.prove != null && message.hasOwnProperty("prove")) + object.prove = message.prove; + return object; + }; + + /** + * Converts this GetContestedResourceIdentityVotesRequestV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0 + * @instance + * @returns {Object.} JSON object + */ + GetContestedResourceIdentityVotesRequestV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfo = (function() { + + /** + * Properties of a StartAtVotePollIdInfo. + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0 + * @interface IStartAtVotePollIdInfo + * @property {Uint8Array|null} [startAtPollIdentifier] StartAtVotePollIdInfo startAtPollIdentifier + * @property {boolean|null} [startPollIdentifierIncluded] StartAtVotePollIdInfo startPollIdentifierIncluded + */ + + /** + * Constructs a new StartAtVotePollIdInfo. + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0 + * @classdesc Represents a StartAtVotePollIdInfo. + * @implements IStartAtVotePollIdInfo + * @constructor + * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.IStartAtVotePollIdInfo=} [properties] Properties to set + */ + function StartAtVotePollIdInfo(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]]; + } + + /** + * StartAtVotePollIdInfo startAtPollIdentifier. + * @member {Uint8Array} startAtPollIdentifier + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfo + * @instance + */ + StartAtVotePollIdInfo.prototype.startAtPollIdentifier = $util.newBuffer([]); + + /** + * StartAtVotePollIdInfo startPollIdentifierIncluded. + * @member {boolean} startPollIdentifierIncluded + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfo + * @instance + */ + StartAtVotePollIdInfo.prototype.startPollIdentifierIncluded = false; + + /** + * Creates a new StartAtVotePollIdInfo instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfo + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.IStartAtVotePollIdInfo=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfo} StartAtVotePollIdInfo instance + */ + StartAtVotePollIdInfo.create = function create(properties) { + return new StartAtVotePollIdInfo(properties); + }; + + /** + * Encodes the specified StartAtVotePollIdInfo message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfo.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfo + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.IStartAtVotePollIdInfo} message StartAtVotePollIdInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StartAtVotePollIdInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.startAtPollIdentifier != null && Object.hasOwnProperty.call(message, "startAtPollIdentifier")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.startAtPollIdentifier); + if (message.startPollIdentifierIncluded != null && Object.hasOwnProperty.call(message, "startPollIdentifierIncluded")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.startPollIdentifierIncluded); + return writer; + }; + + /** + * Encodes the specified StartAtVotePollIdInfo message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfo + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.IStartAtVotePollIdInfo} message StartAtVotePollIdInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StartAtVotePollIdInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StartAtVotePollIdInfo message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfo} StartAtVotePollIdInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StartAtVotePollIdInfo.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.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.startAtPollIdentifier = reader.bytes(); + break; + case 2: + message.startPollIdentifierIncluded = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StartAtVotePollIdInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfo} StartAtVotePollIdInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StartAtVotePollIdInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StartAtVotePollIdInfo message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StartAtVotePollIdInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.startAtPollIdentifier != null && message.hasOwnProperty("startAtPollIdentifier")) + if (!(message.startAtPollIdentifier && typeof message.startAtPollIdentifier.length === "number" || $util.isString(message.startAtPollIdentifier))) + return "startAtPollIdentifier: buffer expected"; + if (message.startPollIdentifierIncluded != null && message.hasOwnProperty("startPollIdentifierIncluded")) + if (typeof message.startPollIdentifierIncluded !== "boolean") + return "startPollIdentifierIncluded: boolean expected"; + return null; + }; + + /** + * Creates a StartAtVotePollIdInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfo + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfo} StartAtVotePollIdInfo + */ + StartAtVotePollIdInfo.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfo) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfo(); + if (object.startAtPollIdentifier != null) + if (typeof object.startAtPollIdentifier === "string") + $util.base64.decode(object.startAtPollIdentifier, message.startAtPollIdentifier = $util.newBuffer($util.base64.length(object.startAtPollIdentifier)), 0); + else if (object.startAtPollIdentifier.length >= 0) + message.startAtPollIdentifier = object.startAtPollIdentifier; + if (object.startPollIdentifierIncluded != null) + message.startPollIdentifierIncluded = Boolean(object.startPollIdentifierIncluded); + return message; + }; + + /** + * Creates a plain object from a StartAtVotePollIdInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfo + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfo} message StartAtVotePollIdInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StartAtVotePollIdInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.startAtPollIdentifier = ""; + else { + object.startAtPollIdentifier = []; + if (options.bytes !== Array) + object.startAtPollIdentifier = $util.newBuffer(object.startAtPollIdentifier); + } + object.startPollIdentifierIncluded = false; + } + if (message.startAtPollIdentifier != null && message.hasOwnProperty("startAtPollIdentifier")) + object.startAtPollIdentifier = options.bytes === String ? $util.base64.encode(message.startAtPollIdentifier, 0, message.startAtPollIdentifier.length) : options.bytes === Array ? Array.prototype.slice.call(message.startAtPollIdentifier) : message.startAtPollIdentifier; + if (message.startPollIdentifierIncluded != null && message.hasOwnProperty("startPollIdentifierIncluded")) + object.startPollIdentifierIncluded = message.startPollIdentifierIncluded; + return object; + }; + + /** + * Converts this StartAtVotePollIdInfo to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfo + * @instance + * @returns {Object.} JSON object + */ + StartAtVotePollIdInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return StartAtVotePollIdInfo; + })(); + + return GetContestedResourceIdentityVotesRequestV0; + })(); + + return GetContestedResourceIdentityVotesRequest; + })(); + + v0.GetContestedResourceIdentityVotesResponse = (function() { + + /** + * Properties of a GetContestedResourceIdentityVotesResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetContestedResourceIdentityVotesResponse + * @property {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.IGetContestedResourceIdentityVotesResponseV0|null} [v0] GetContestedResourceIdentityVotesResponse v0 + */ + + /** + * Constructs a new GetContestedResourceIdentityVotesResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetContestedResourceIdentityVotesResponse. + * @implements IGetContestedResourceIdentityVotesResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IGetContestedResourceIdentityVotesResponse=} [properties] Properties to set + */ + function GetContestedResourceIdentityVotesResponse(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]]; + } + + /** + * GetContestedResourceIdentityVotesResponse v0. + * @member {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.IGetContestedResourceIdentityVotesResponseV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse + * @instance + */ + GetContestedResourceIdentityVotesResponse.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetContestedResourceIdentityVotesResponse version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse + * @instance + */ + Object.defineProperty(GetContestedResourceIdentityVotesResponse.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetContestedResourceIdentityVotesResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetContestedResourceIdentityVotesResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse} GetContestedResourceIdentityVotesResponse instance + */ + GetContestedResourceIdentityVotesResponse.create = function create(properties) { + return new GetContestedResourceIdentityVotesResponse(properties); + }; + + /** + * Encodes the specified GetContestedResourceIdentityVotesResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetContestedResourceIdentityVotesResponse} message GetContestedResourceIdentityVotesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetContestedResourceIdentityVotesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetContestedResourceIdentityVotesResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetContestedResourceIdentityVotesResponse} message GetContestedResourceIdentityVotesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetContestedResourceIdentityVotesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetContestedResourceIdentityVotesResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse} GetContestedResourceIdentityVotesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetContestedResourceIdentityVotesResponse.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.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetContestedResourceIdentityVotesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse} GetContestedResourceIdentityVotesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetContestedResourceIdentityVotesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetContestedResourceIdentityVotesResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetContestedResourceIdentityVotesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetContestedResourceIdentityVotesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse} GetContestedResourceIdentityVotesResponse + */ + GetContestedResourceIdentityVotesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetContestedResourceIdentityVotesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse} message GetContestedResourceIdentityVotesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetContestedResourceIdentityVotesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetContestedResourceIdentityVotesResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse + * @instance + * @returns {Object.} JSON object + */ + GetContestedResourceIdentityVotesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0 = (function() { + + /** + * Properties of a GetContestedResourceIdentityVotesResponseV0. + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse + * @interface IGetContestedResourceIdentityVotesResponseV0 + * @property {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.IContestedResourceIdentityVotes|null} [votes] GetContestedResourceIdentityVotesResponseV0 votes + * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetContestedResourceIdentityVotesResponseV0 proof + * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetContestedResourceIdentityVotesResponseV0 metadata + */ + + /** + * Constructs a new GetContestedResourceIdentityVotesResponseV0. + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse + * @classdesc Represents a GetContestedResourceIdentityVotesResponseV0. + * @implements IGetContestedResourceIdentityVotesResponseV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.IGetContestedResourceIdentityVotesResponseV0=} [properties] Properties to set + */ + function GetContestedResourceIdentityVotesResponseV0(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]]; + } + + /** + * GetContestedResourceIdentityVotesResponseV0 votes. + * @member {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.IContestedResourceIdentityVotes|null|undefined} votes + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0 + * @instance + */ + GetContestedResourceIdentityVotesResponseV0.prototype.votes = null; + + /** + * GetContestedResourceIdentityVotesResponseV0 proof. + * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0 + * @instance + */ + GetContestedResourceIdentityVotesResponseV0.prototype.proof = null; + + /** + * GetContestedResourceIdentityVotesResponseV0 metadata. + * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0 + * @instance + */ + GetContestedResourceIdentityVotesResponseV0.prototype.metadata = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetContestedResourceIdentityVotesResponseV0 result. + * @member {"votes"|"proof"|undefined} result + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0 + * @instance + */ + Object.defineProperty(GetContestedResourceIdentityVotesResponseV0.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["votes", "proof"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetContestedResourceIdentityVotesResponseV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.IGetContestedResourceIdentityVotesResponseV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0} GetContestedResourceIdentityVotesResponseV0 instance + */ + GetContestedResourceIdentityVotesResponseV0.create = function create(properties) { + return new GetContestedResourceIdentityVotesResponseV0(properties); + }; + + /** + * Encodes the specified GetContestedResourceIdentityVotesResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.IGetContestedResourceIdentityVotesResponseV0} message GetContestedResourceIdentityVotesResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetContestedResourceIdentityVotesResponseV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.votes != null && Object.hasOwnProperty.call(message, "votes")) + $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes.encode(message.votes, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetContestedResourceIdentityVotesResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.IGetContestedResourceIdentityVotesResponseV0} message GetContestedResourceIdentityVotesResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetContestedResourceIdentityVotesResponseV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetContestedResourceIdentityVotesResponseV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0} GetContestedResourceIdentityVotesResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetContestedResourceIdentityVotesResponseV0.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.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.votes = $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes.decode(reader, reader.uint32()); + break; + case 2: + message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); + break; + case 3: + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetContestedResourceIdentityVotesResponseV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0} GetContestedResourceIdentityVotesResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetContestedResourceIdentityVotesResponseV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetContestedResourceIdentityVotesResponseV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetContestedResourceIdentityVotesResponseV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.votes != null && message.hasOwnProperty("votes")) { + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes.verify(message.votes); + if (error) + return "votes." + error; + } + } + if (message.proof != null && message.hasOwnProperty("proof")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); + if (error) + return "proof." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a GetContestedResourceIdentityVotesResponseV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0} GetContestedResourceIdentityVotesResponseV0 + */ + GetContestedResourceIdentityVotesResponseV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0(); + if (object.votes != null) { + if (typeof object.votes !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.votes: object expected"); + message.votes = $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes.fromObject(object.votes); + } + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.proof: object expected"); + message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.metadata: object expected"); + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a GetContestedResourceIdentityVotesResponseV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0} message GetContestedResourceIdentityVotesResponseV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetContestedResourceIdentityVotesResponseV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.metadata = null; + if (message.votes != null && message.hasOwnProperty("votes")) { + object.votes = $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes.toObject(message.votes, options); + if (options.oneofs) + object.result = "votes"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); + if (options.oneofs) + object.result = "proof"; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this GetContestedResourceIdentityVotesResponseV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0 + * @instance + * @returns {Object.} JSON object + */ + GetContestedResourceIdentityVotesResponseV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes = (function() { + + /** + * Properties of a ContestedResourceIdentityVotes. + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0 + * @interface IContestedResourceIdentityVotes + * @property {Array.|null} [contestedResourceIdentityVotes] ContestedResourceIdentityVotes contestedResourceIdentityVotes + * @property {boolean|null} [finishedResults] ContestedResourceIdentityVotes finishedResults + */ + + /** + * Constructs a new ContestedResourceIdentityVotes. + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0 + * @classdesc Represents a ContestedResourceIdentityVotes. + * @implements IContestedResourceIdentityVotes + * @constructor + * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.IContestedResourceIdentityVotes=} [properties] Properties to set + */ + function ContestedResourceIdentityVotes(properties) { + this.contestedResourceIdentityVotes = []; + 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]]; + } + + /** + * ContestedResourceIdentityVotes contestedResourceIdentityVotes. + * @member {Array.} contestedResourceIdentityVotes + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes + * @instance + */ + ContestedResourceIdentityVotes.prototype.contestedResourceIdentityVotes = $util.emptyArray; + + /** + * ContestedResourceIdentityVotes finishedResults. + * @member {boolean} finishedResults + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes + * @instance + */ + ContestedResourceIdentityVotes.prototype.finishedResults = false; + + /** + * Creates a new ContestedResourceIdentityVotes instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.IContestedResourceIdentityVotes=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes} ContestedResourceIdentityVotes instance + */ + ContestedResourceIdentityVotes.create = function create(properties) { + return new ContestedResourceIdentityVotes(properties); + }; + + /** + * Encodes the specified ContestedResourceIdentityVotes message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.IContestedResourceIdentityVotes} message ContestedResourceIdentityVotes message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContestedResourceIdentityVotes.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.contestedResourceIdentityVotes != null && message.contestedResourceIdentityVotes.length) + for (var i = 0; i < message.contestedResourceIdentityVotes.length; ++i) + $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote.encode(message.contestedResourceIdentityVotes[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.finishedResults != null && Object.hasOwnProperty.call(message, "finishedResults")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.finishedResults); + return writer; + }; + + /** + * Encodes the specified ContestedResourceIdentityVotes message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.IContestedResourceIdentityVotes} message ContestedResourceIdentityVotes message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContestedResourceIdentityVotes.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ContestedResourceIdentityVotes message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes} ContestedResourceIdentityVotes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContestedResourceIdentityVotes.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.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.contestedResourceIdentityVotes && message.contestedResourceIdentityVotes.length)) + message.contestedResourceIdentityVotes = []; + message.contestedResourceIdentityVotes.push($root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote.decode(reader, reader.uint32())); + break; + case 2: + message.finishedResults = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ContestedResourceIdentityVotes message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes} ContestedResourceIdentityVotes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContestedResourceIdentityVotes.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ContestedResourceIdentityVotes message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ContestedResourceIdentityVotes.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.contestedResourceIdentityVotes != null && message.hasOwnProperty("contestedResourceIdentityVotes")) { + if (!Array.isArray(message.contestedResourceIdentityVotes)) + return "contestedResourceIdentityVotes: array expected"; + for (var i = 0; i < message.contestedResourceIdentityVotes.length; ++i) { + var error = $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote.verify(message.contestedResourceIdentityVotes[i]); + if (error) + return "contestedResourceIdentityVotes." + error; + } + } + if (message.finishedResults != null && message.hasOwnProperty("finishedResults")) + if (typeof message.finishedResults !== "boolean") + return "finishedResults: boolean expected"; + return null; + }; + + /** + * Creates a ContestedResourceIdentityVotes message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes} ContestedResourceIdentityVotes + */ + ContestedResourceIdentityVotes.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes(); + if (object.contestedResourceIdentityVotes) { + if (!Array.isArray(object.contestedResourceIdentityVotes)) + throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes.contestedResourceIdentityVotes: array expected"); + message.contestedResourceIdentityVotes = []; + for (var i = 0; i < object.contestedResourceIdentityVotes.length; ++i) { + if (typeof object.contestedResourceIdentityVotes[i] !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes.contestedResourceIdentityVotes: object expected"); + message.contestedResourceIdentityVotes[i] = $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote.fromObject(object.contestedResourceIdentityVotes[i]); + } + } + if (object.finishedResults != null) + message.finishedResults = Boolean(object.finishedResults); + return message; + }; + + /** + * Creates a plain object from a ContestedResourceIdentityVotes message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes} message ContestedResourceIdentityVotes + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ContestedResourceIdentityVotes.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.contestedResourceIdentityVotes = []; + if (options.defaults) + object.finishedResults = false; + if (message.contestedResourceIdentityVotes && message.contestedResourceIdentityVotes.length) { + object.contestedResourceIdentityVotes = []; + for (var j = 0; j < message.contestedResourceIdentityVotes.length; ++j) + object.contestedResourceIdentityVotes[j] = $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote.toObject(message.contestedResourceIdentityVotes[j], options); + } + if (message.finishedResults != null && message.hasOwnProperty("finishedResults")) + object.finishedResults = message.finishedResults; + return object; + }; + + /** + * Converts this ContestedResourceIdentityVotes to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes + * @instance + * @returns {Object.} JSON object + */ + ContestedResourceIdentityVotes.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ContestedResourceIdentityVotes; + })(); + + GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice = (function() { + + /** + * Properties of a ResourceVoteChoice. + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0 + * @interface IResourceVoteChoice + * @property {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice.VoteChoiceType|null} [voteChoiceType] ResourceVoteChoice voteChoiceType + * @property {Uint8Array|null} [identityId] ResourceVoteChoice identityId + */ + + /** + * Constructs a new ResourceVoteChoice. + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0 + * @classdesc Represents a ResourceVoteChoice. + * @implements IResourceVoteChoice + * @constructor + * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.IResourceVoteChoice=} [properties] Properties to set + */ + function ResourceVoteChoice(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]]; + } + + /** + * ResourceVoteChoice voteChoiceType. + * @member {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice.VoteChoiceType} voteChoiceType + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice + * @instance + */ + ResourceVoteChoice.prototype.voteChoiceType = 0; + + /** + * ResourceVoteChoice identityId. + * @member {Uint8Array} identityId + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice + * @instance + */ + ResourceVoteChoice.prototype.identityId = $util.newBuffer([]); + + /** + * Creates a new ResourceVoteChoice instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.IResourceVoteChoice=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice} ResourceVoteChoice instance + */ + ResourceVoteChoice.create = function create(properties) { + return new ResourceVoteChoice(properties); + }; + + /** + * Encodes the specified ResourceVoteChoice message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.IResourceVoteChoice} message ResourceVoteChoice message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceVoteChoice.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.voteChoiceType != null && Object.hasOwnProperty.call(message, "voteChoiceType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.voteChoiceType); + if (message.identityId != null && Object.hasOwnProperty.call(message, "identityId")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.identityId); + return writer; + }; + + /** + * Encodes the specified ResourceVoteChoice message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.IResourceVoteChoice} message ResourceVoteChoice message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceVoteChoice.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceVoteChoice message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice} ResourceVoteChoice + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceVoteChoice.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.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.voteChoiceType = reader.int32(); + break; + case 2: + message.identityId = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceVoteChoice message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice} ResourceVoteChoice + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceVoteChoice.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceVoteChoice message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceVoteChoice.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.voteChoiceType != null && message.hasOwnProperty("voteChoiceType")) + switch (message.voteChoiceType) { + default: + return "voteChoiceType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.identityId != null && message.hasOwnProperty("identityId")) + if (!(message.identityId && typeof message.identityId.length === "number" || $util.isString(message.identityId))) + return "identityId: buffer expected"; + return null; + }; + + /** + * Creates a ResourceVoteChoice message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice} ResourceVoteChoice + */ + ResourceVoteChoice.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice(); + switch (object.voteChoiceType) { + case "TOWARDS_IDENTITY": + case 0: + message.voteChoiceType = 0; + break; + case "ABSTAIN": + case 1: + message.voteChoiceType = 1; + break; + case "LOCK": + case 2: + message.voteChoiceType = 2; + break; + } + if (object.identityId != null) + if (typeof object.identityId === "string") + $util.base64.decode(object.identityId, message.identityId = $util.newBuffer($util.base64.length(object.identityId)), 0); + else if (object.identityId.length >= 0) + message.identityId = object.identityId; + return message; + }; + + /** + * Creates a plain object from a ResourceVoteChoice message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice} message ResourceVoteChoice + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceVoteChoice.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.voteChoiceType = options.enums === String ? "TOWARDS_IDENTITY" : 0; + if (options.bytes === String) + object.identityId = ""; + else { + object.identityId = []; + if (options.bytes !== Array) + object.identityId = $util.newBuffer(object.identityId); + } + } + if (message.voteChoiceType != null && message.hasOwnProperty("voteChoiceType")) + object.voteChoiceType = options.enums === String ? $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice.VoteChoiceType[message.voteChoiceType] : message.voteChoiceType; + if (message.identityId != null && message.hasOwnProperty("identityId")) + object.identityId = options.bytes === String ? $util.base64.encode(message.identityId, 0, message.identityId.length) : options.bytes === Array ? Array.prototype.slice.call(message.identityId) : message.identityId; + return object; + }; + + /** + * Converts this ResourceVoteChoice to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice + * @instance + * @returns {Object.} JSON object + */ + ResourceVoteChoice.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * VoteChoiceType enum. + * @name org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice.VoteChoiceType + * @enum {number} + * @property {number} TOWARDS_IDENTITY=0 TOWARDS_IDENTITY value + * @property {number} ABSTAIN=1 ABSTAIN value + * @property {number} LOCK=2 LOCK value + */ + ResourceVoteChoice.VoteChoiceType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TOWARDS_IDENTITY"] = 0; + values[valuesById[1] = "ABSTAIN"] = 1; + values[valuesById[2] = "LOCK"] = 2; + return values; + })(); + + return ResourceVoteChoice; + })(); + + GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote = (function() { + + /** + * Properties of a ContestedResourceIdentityVote. + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0 + * @interface IContestedResourceIdentityVote + * @property {Uint8Array|null} [contractId] ContestedResourceIdentityVote contractId + * @property {string|null} [documentTypeName] ContestedResourceIdentityVote documentTypeName + * @property {Array.|null} [serializedIndexStorageValues] ContestedResourceIdentityVote serializedIndexStorageValues + * @property {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.IResourceVoteChoice|null} [voteChoice] ContestedResourceIdentityVote voteChoice + */ + + /** + * Constructs a new ContestedResourceIdentityVote. + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0 + * @classdesc Represents a ContestedResourceIdentityVote. + * @implements IContestedResourceIdentityVote + * @constructor + * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.IContestedResourceIdentityVote=} [properties] Properties to set + */ + function ContestedResourceIdentityVote(properties) { + this.serializedIndexStorageValues = []; + 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]]; + } + + /** + * ContestedResourceIdentityVote contractId. + * @member {Uint8Array} contractId + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote + * @instance + */ + ContestedResourceIdentityVote.prototype.contractId = $util.newBuffer([]); + + /** + * ContestedResourceIdentityVote documentTypeName. + * @member {string} documentTypeName + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote + * @instance + */ + ContestedResourceIdentityVote.prototype.documentTypeName = ""; + + /** + * ContestedResourceIdentityVote serializedIndexStorageValues. + * @member {Array.} serializedIndexStorageValues + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote + * @instance + */ + ContestedResourceIdentityVote.prototype.serializedIndexStorageValues = $util.emptyArray; + + /** + * ContestedResourceIdentityVote voteChoice. + * @member {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.IResourceVoteChoice|null|undefined} voteChoice + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote + * @instance + */ + ContestedResourceIdentityVote.prototype.voteChoice = null; + + /** + * Creates a new ContestedResourceIdentityVote instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.IContestedResourceIdentityVote=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote} ContestedResourceIdentityVote instance + */ + ContestedResourceIdentityVote.create = function create(properties) { + return new ContestedResourceIdentityVote(properties); + }; + + /** + * Encodes the specified ContestedResourceIdentityVote message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.IContestedResourceIdentityVote} message ContestedResourceIdentityVote message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContestedResourceIdentityVote.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.contractId != null && Object.hasOwnProperty.call(message, "contractId")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.contractId); + if (message.documentTypeName != null && Object.hasOwnProperty.call(message, "documentTypeName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.documentTypeName); + if (message.serializedIndexStorageValues != null && message.serializedIndexStorageValues.length) + for (var i = 0; i < message.serializedIndexStorageValues.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.serializedIndexStorageValues[i]); + if (message.voteChoice != null && Object.hasOwnProperty.call(message, "voteChoice")) + $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice.encode(message.voteChoice, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ContestedResourceIdentityVote message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.IContestedResourceIdentityVote} message ContestedResourceIdentityVote message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContestedResourceIdentityVote.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ContestedResourceIdentityVote message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote} ContestedResourceIdentityVote + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContestedResourceIdentityVote.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.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.contractId = reader.bytes(); + break; + case 2: + message.documentTypeName = reader.string(); + break; + case 3: + if (!(message.serializedIndexStorageValues && message.serializedIndexStorageValues.length)) + message.serializedIndexStorageValues = []; + message.serializedIndexStorageValues.push(reader.bytes()); + break; + case 4: + message.voteChoice = $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ContestedResourceIdentityVote message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote} ContestedResourceIdentityVote + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContestedResourceIdentityVote.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ContestedResourceIdentityVote message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ContestedResourceIdentityVote.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.contractId != null && message.hasOwnProperty("contractId")) + if (!(message.contractId && typeof message.contractId.length === "number" || $util.isString(message.contractId))) + return "contractId: buffer expected"; + if (message.documentTypeName != null && message.hasOwnProperty("documentTypeName")) + if (!$util.isString(message.documentTypeName)) + return "documentTypeName: string expected"; + if (message.serializedIndexStorageValues != null && message.hasOwnProperty("serializedIndexStorageValues")) { + if (!Array.isArray(message.serializedIndexStorageValues)) + return "serializedIndexStorageValues: array expected"; + for (var i = 0; i < message.serializedIndexStorageValues.length; ++i) + if (!(message.serializedIndexStorageValues[i] && typeof message.serializedIndexStorageValues[i].length === "number" || $util.isString(message.serializedIndexStorageValues[i]))) + return "serializedIndexStorageValues: buffer[] expected"; + } + if (message.voteChoice != null && message.hasOwnProperty("voteChoice")) { + var error = $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice.verify(message.voteChoice); + if (error) + return "voteChoice." + error; + } + return null; + }; + + /** + * Creates a ContestedResourceIdentityVote message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote} ContestedResourceIdentityVote + */ + ContestedResourceIdentityVote.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote(); + if (object.contractId != null) + if (typeof object.contractId === "string") + $util.base64.decode(object.contractId, message.contractId = $util.newBuffer($util.base64.length(object.contractId)), 0); + else if (object.contractId.length >= 0) + message.contractId = object.contractId; + if (object.documentTypeName != null) + message.documentTypeName = String(object.documentTypeName); + if (object.serializedIndexStorageValues) { + if (!Array.isArray(object.serializedIndexStorageValues)) + throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote.serializedIndexStorageValues: array expected"); + message.serializedIndexStorageValues = []; + for (var i = 0; i < object.serializedIndexStorageValues.length; ++i) + if (typeof object.serializedIndexStorageValues[i] === "string") + $util.base64.decode(object.serializedIndexStorageValues[i], message.serializedIndexStorageValues[i] = $util.newBuffer($util.base64.length(object.serializedIndexStorageValues[i])), 0); + else if (object.serializedIndexStorageValues[i].length >= 0) + message.serializedIndexStorageValues[i] = object.serializedIndexStorageValues[i]; + } + if (object.voteChoice != null) { + if (typeof object.voteChoice !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote.voteChoice: object expected"); + message.voteChoice = $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice.fromObject(object.voteChoice); + } + return message; + }; + + /** + * Creates a plain object from a ContestedResourceIdentityVote message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote} message ContestedResourceIdentityVote + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ContestedResourceIdentityVote.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.serializedIndexStorageValues = []; + if (options.defaults) { + if (options.bytes === String) + object.contractId = ""; + else { + object.contractId = []; + if (options.bytes !== Array) + object.contractId = $util.newBuffer(object.contractId); + } + object.documentTypeName = ""; + object.voteChoice = null; + } + if (message.contractId != null && message.hasOwnProperty("contractId")) + object.contractId = options.bytes === String ? $util.base64.encode(message.contractId, 0, message.contractId.length) : options.bytes === Array ? Array.prototype.slice.call(message.contractId) : message.contractId; + if (message.documentTypeName != null && message.hasOwnProperty("documentTypeName")) + object.documentTypeName = message.documentTypeName; + if (message.serializedIndexStorageValues && message.serializedIndexStorageValues.length) { + object.serializedIndexStorageValues = []; + for (var j = 0; j < message.serializedIndexStorageValues.length; ++j) + object.serializedIndexStorageValues[j] = options.bytes === String ? $util.base64.encode(message.serializedIndexStorageValues[j], 0, message.serializedIndexStorageValues[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.serializedIndexStorageValues[j]) : message.serializedIndexStorageValues[j]; + } + if (message.voteChoice != null && message.hasOwnProperty("voteChoice")) + object.voteChoice = $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice.toObject(message.voteChoice, options); + return object; + }; + + /** + * Converts this ContestedResourceIdentityVote to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote + * @instance + * @returns {Object.} JSON object + */ + ContestedResourceIdentityVote.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ContestedResourceIdentityVote; + })(); + + return GetContestedResourceIdentityVotesResponseV0; + })(); + + return GetContestedResourceIdentityVotesResponse; + })(); + + v0.GetPrefundedSpecializedBalanceRequest = (function() { + + /** + * Properties of a GetPrefundedSpecializedBalanceRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetPrefundedSpecializedBalanceRequest + * @property {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.IGetPrefundedSpecializedBalanceRequestV0|null} [v0] GetPrefundedSpecializedBalanceRequest v0 + */ + + /** + * Constructs a new GetPrefundedSpecializedBalanceRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetPrefundedSpecializedBalanceRequest. + * @implements IGetPrefundedSpecializedBalanceRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IGetPrefundedSpecializedBalanceRequest=} [properties] Properties to set + */ + function GetPrefundedSpecializedBalanceRequest(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]]; + } + + /** + * GetPrefundedSpecializedBalanceRequest v0. + * @member {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.IGetPrefundedSpecializedBalanceRequestV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest + * @instance + */ + GetPrefundedSpecializedBalanceRequest.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetPrefundedSpecializedBalanceRequest version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest + * @instance + */ + Object.defineProperty(GetPrefundedSpecializedBalanceRequest.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetPrefundedSpecializedBalanceRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetPrefundedSpecializedBalanceRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest} GetPrefundedSpecializedBalanceRequest instance + */ + GetPrefundedSpecializedBalanceRequest.create = function create(properties) { + return new GetPrefundedSpecializedBalanceRequest(properties); + }; + + /** + * Encodes the specified GetPrefundedSpecializedBalanceRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetPrefundedSpecializedBalanceRequest} message GetPrefundedSpecializedBalanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetPrefundedSpecializedBalanceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetPrefundedSpecializedBalanceRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetPrefundedSpecializedBalanceRequest} message GetPrefundedSpecializedBalanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetPrefundedSpecializedBalanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetPrefundedSpecializedBalanceRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest} GetPrefundedSpecializedBalanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetPrefundedSpecializedBalanceRequest.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.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetPrefundedSpecializedBalanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest} GetPrefundedSpecializedBalanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetPrefundedSpecializedBalanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetPrefundedSpecializedBalanceRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetPrefundedSpecializedBalanceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetPrefundedSpecializedBalanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest} GetPrefundedSpecializedBalanceRequest + */ + GetPrefundedSpecializedBalanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetPrefundedSpecializedBalanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest + * @static + * @param {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest} message GetPrefundedSpecializedBalanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetPrefundedSpecializedBalanceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetPrefundedSpecializedBalanceRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest + * @instance + * @returns {Object.} JSON object + */ + GetPrefundedSpecializedBalanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0 = (function() { + + /** + * Properties of a GetPrefundedSpecializedBalanceRequestV0. + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest + * @interface IGetPrefundedSpecializedBalanceRequestV0 + * @property {Uint8Array|null} [id] GetPrefundedSpecializedBalanceRequestV0 id + * @property {boolean|null} [prove] GetPrefundedSpecializedBalanceRequestV0 prove + */ + + /** + * Constructs a new GetPrefundedSpecializedBalanceRequestV0. + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest + * @classdesc Represents a GetPrefundedSpecializedBalanceRequestV0. + * @implements IGetPrefundedSpecializedBalanceRequestV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.IGetPrefundedSpecializedBalanceRequestV0=} [properties] Properties to set + */ + function GetPrefundedSpecializedBalanceRequestV0(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]]; + } + + /** + * GetPrefundedSpecializedBalanceRequestV0 id. + * @member {Uint8Array} id + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0 + * @instance + */ + GetPrefundedSpecializedBalanceRequestV0.prototype.id = $util.newBuffer([]); + + /** + * GetPrefundedSpecializedBalanceRequestV0 prove. + * @member {boolean} prove + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0 + * @instance + */ + GetPrefundedSpecializedBalanceRequestV0.prototype.prove = false; + + /** + * Creates a new GetPrefundedSpecializedBalanceRequestV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.IGetPrefundedSpecializedBalanceRequestV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0} GetPrefundedSpecializedBalanceRequestV0 instance + */ + GetPrefundedSpecializedBalanceRequestV0.create = function create(properties) { + return new GetPrefundedSpecializedBalanceRequestV0(properties); + }; + + /** + * Encodes the specified GetPrefundedSpecializedBalanceRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.IGetPrefundedSpecializedBalanceRequestV0} message GetPrefundedSpecializedBalanceRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetPrefundedSpecializedBalanceRequestV0.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).bytes(message.id); + if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.prove); + return writer; + }; + + /** + * Encodes the specified GetPrefundedSpecializedBalanceRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.IGetPrefundedSpecializedBalanceRequestV0} message GetPrefundedSpecializedBalanceRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetPrefundedSpecializedBalanceRequestV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetPrefundedSpecializedBalanceRequestV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0} GetPrefundedSpecializedBalanceRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetPrefundedSpecializedBalanceRequestV0.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.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.bytes(); + break; + case 2: + message.prove = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetPrefundedSpecializedBalanceRequestV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0} GetPrefundedSpecializedBalanceRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetPrefundedSpecializedBalanceRequestV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetPrefundedSpecializedBalanceRequestV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetPrefundedSpecializedBalanceRequestV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.id != null && message.hasOwnProperty("id")) + if (!(message.id && typeof message.id.length === "number" || $util.isString(message.id))) + return "id: buffer expected"; + if (message.prove != null && message.hasOwnProperty("prove")) + if (typeof message.prove !== "boolean") + return "prove: boolean expected"; + return null; + }; + + /** + * Creates a GetPrefundedSpecializedBalanceRequestV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0} GetPrefundedSpecializedBalanceRequestV0 + */ + GetPrefundedSpecializedBalanceRequestV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0(); + if (object.id != null) + if (typeof object.id === "string") + $util.base64.decode(object.id, message.id = $util.newBuffer($util.base64.length(object.id)), 0); + else if (object.id.length >= 0) + message.id = object.id; + if (object.prove != null) + message.prove = Boolean(object.prove); + return message; + }; + + /** + * Creates a plain object from a GetPrefundedSpecializedBalanceRequestV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0} message GetPrefundedSpecializedBalanceRequestV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetPrefundedSpecializedBalanceRequestV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.id = ""; + else { + object.id = []; + if (options.bytes !== Array) + object.id = $util.newBuffer(object.id); + } + object.prove = false; + } + if (message.id != null && message.hasOwnProperty("id")) + object.id = options.bytes === String ? $util.base64.encode(message.id, 0, message.id.length) : options.bytes === Array ? Array.prototype.slice.call(message.id) : message.id; + if (message.prove != null && message.hasOwnProperty("prove")) + object.prove = message.prove; + return object; + }; + + /** + * Converts this GetPrefundedSpecializedBalanceRequestV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0 + * @instance + * @returns {Object.} JSON object + */ + GetPrefundedSpecializedBalanceRequestV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetPrefundedSpecializedBalanceRequestV0; + })(); + + return GetPrefundedSpecializedBalanceRequest; + })(); + + v0.GetPrefundedSpecializedBalanceResponse = (function() { + + /** + * Properties of a GetPrefundedSpecializedBalanceResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetPrefundedSpecializedBalanceResponse + * @property {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.IGetPrefundedSpecializedBalanceResponseV0|null} [v0] GetPrefundedSpecializedBalanceResponse v0 + */ + + /** + * Constructs a new GetPrefundedSpecializedBalanceResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetPrefundedSpecializedBalanceResponse. + * @implements IGetPrefundedSpecializedBalanceResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IGetPrefundedSpecializedBalanceResponse=} [properties] Properties to set + */ + function GetPrefundedSpecializedBalanceResponse(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]]; + } + + /** + * GetPrefundedSpecializedBalanceResponse v0. + * @member {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.IGetPrefundedSpecializedBalanceResponseV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse + * @instance + */ + GetPrefundedSpecializedBalanceResponse.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetPrefundedSpecializedBalanceResponse version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse + * @instance + */ + Object.defineProperty(GetPrefundedSpecializedBalanceResponse.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetPrefundedSpecializedBalanceResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetPrefundedSpecializedBalanceResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse} GetPrefundedSpecializedBalanceResponse instance + */ + GetPrefundedSpecializedBalanceResponse.create = function create(properties) { + return new GetPrefundedSpecializedBalanceResponse(properties); + }; + + /** + * Encodes the specified GetPrefundedSpecializedBalanceResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetPrefundedSpecializedBalanceResponse} message GetPrefundedSpecializedBalanceResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetPrefundedSpecializedBalanceResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetPrefundedSpecializedBalanceResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetPrefundedSpecializedBalanceResponse} message GetPrefundedSpecializedBalanceResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetPrefundedSpecializedBalanceResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetPrefundedSpecializedBalanceResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse} GetPrefundedSpecializedBalanceResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetPrefundedSpecializedBalanceResponse.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.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetPrefundedSpecializedBalanceResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse} GetPrefundedSpecializedBalanceResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetPrefundedSpecializedBalanceResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetPrefundedSpecializedBalanceResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetPrefundedSpecializedBalanceResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetPrefundedSpecializedBalanceResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse} GetPrefundedSpecializedBalanceResponse + */ + GetPrefundedSpecializedBalanceResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetPrefundedSpecializedBalanceResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse + * @static + * @param {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse} message GetPrefundedSpecializedBalanceResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetPrefundedSpecializedBalanceResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetPrefundedSpecializedBalanceResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse + * @instance + * @returns {Object.} JSON object + */ + GetPrefundedSpecializedBalanceResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0 = (function() { + + /** + * Properties of a GetPrefundedSpecializedBalanceResponseV0. + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse + * @interface IGetPrefundedSpecializedBalanceResponseV0 + * @property {number|Long|null} [balance] GetPrefundedSpecializedBalanceResponseV0 balance + * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetPrefundedSpecializedBalanceResponseV0 proof + * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetPrefundedSpecializedBalanceResponseV0 metadata + */ + + /** + * Constructs a new GetPrefundedSpecializedBalanceResponseV0. + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse + * @classdesc Represents a GetPrefundedSpecializedBalanceResponseV0. + * @implements IGetPrefundedSpecializedBalanceResponseV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.IGetPrefundedSpecializedBalanceResponseV0=} [properties] Properties to set + */ + function GetPrefundedSpecializedBalanceResponseV0(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]]; + } + + /** + * GetPrefundedSpecializedBalanceResponseV0 balance. + * @member {number|Long} balance + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0 + * @instance + */ + GetPrefundedSpecializedBalanceResponseV0.prototype.balance = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * GetPrefundedSpecializedBalanceResponseV0 proof. + * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0 + * @instance + */ + GetPrefundedSpecializedBalanceResponseV0.prototype.proof = null; + + /** + * GetPrefundedSpecializedBalanceResponseV0 metadata. + * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0 + * @instance + */ + GetPrefundedSpecializedBalanceResponseV0.prototype.metadata = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetPrefundedSpecializedBalanceResponseV0 result. + * @member {"balance"|"proof"|undefined} result + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0 + * @instance + */ + Object.defineProperty(GetPrefundedSpecializedBalanceResponseV0.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["balance", "proof"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetPrefundedSpecializedBalanceResponseV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.IGetPrefundedSpecializedBalanceResponseV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0} GetPrefundedSpecializedBalanceResponseV0 instance + */ + GetPrefundedSpecializedBalanceResponseV0.create = function create(properties) { + return new GetPrefundedSpecializedBalanceResponseV0(properties); + }; + + /** + * Encodes the specified GetPrefundedSpecializedBalanceResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.IGetPrefundedSpecializedBalanceResponseV0} message GetPrefundedSpecializedBalanceResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetPrefundedSpecializedBalanceResponseV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.balance != null && Object.hasOwnProperty.call(message, "balance")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.balance); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetPrefundedSpecializedBalanceResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.IGetPrefundedSpecializedBalanceResponseV0} message GetPrefundedSpecializedBalanceResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetPrefundedSpecializedBalanceResponseV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetPrefundedSpecializedBalanceResponseV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0} GetPrefundedSpecializedBalanceResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetPrefundedSpecializedBalanceResponseV0.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.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.balance = reader.uint64(); + break; + case 2: + message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); + break; + case 3: + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetPrefundedSpecializedBalanceResponseV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0} GetPrefundedSpecializedBalanceResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetPrefundedSpecializedBalanceResponseV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetPrefundedSpecializedBalanceResponseV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetPrefundedSpecializedBalanceResponseV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.balance != null && message.hasOwnProperty("balance")) { + properties.result = 1; + if (!$util.isInteger(message.balance) && !(message.balance && $util.isInteger(message.balance.low) && $util.isInteger(message.balance.high))) + return "balance: integer|Long expected"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); + if (error) + return "proof." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a GetPrefundedSpecializedBalanceResponseV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0} GetPrefundedSpecializedBalanceResponseV0 + */ + GetPrefundedSpecializedBalanceResponseV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0(); + if (object.balance != null) + if ($util.Long) + (message.balance = $util.Long.fromValue(object.balance)).unsigned = true; + else if (typeof object.balance === "string") + message.balance = parseInt(object.balance, 10); + else if (typeof object.balance === "number") + message.balance = object.balance; + else if (typeof object.balance === "object") + message.balance = new $util.LongBits(object.balance.low >>> 0, object.balance.high >>> 0).toNumber(true); + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0.proof: object expected"); + message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0.metadata: object expected"); + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a GetPrefundedSpecializedBalanceResponseV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0} message GetPrefundedSpecializedBalanceResponseV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetPrefundedSpecializedBalanceResponseV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.metadata = null; + if (message.balance != null && message.hasOwnProperty("balance")) { + if (typeof message.balance === "number") + object.balance = options.longs === String ? String(message.balance) : message.balance; + else + object.balance = options.longs === String ? $util.Long.prototype.toString.call(message.balance) : options.longs === Number ? new $util.LongBits(message.balance.low >>> 0, message.balance.high >>> 0).toNumber(true) : message.balance; + if (options.oneofs) + object.result = "balance"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); + if (options.oneofs) + object.result = "proof"; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this GetPrefundedSpecializedBalanceResponseV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0 + * @instance + * @returns {Object.} JSON object + */ + GetPrefundedSpecializedBalanceResponseV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetPrefundedSpecializedBalanceResponseV0; + })(); + + return GetPrefundedSpecializedBalanceResponse; + })(); + + v0.GetTotalCreditsInPlatformRequest = (function() { + + /** + * Properties of a GetTotalCreditsInPlatformRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetTotalCreditsInPlatformRequest + * @property {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.IGetTotalCreditsInPlatformRequestV0|null} [v0] GetTotalCreditsInPlatformRequest v0 + */ + + /** + * Constructs a new GetTotalCreditsInPlatformRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetTotalCreditsInPlatformRequest. + * @implements IGetTotalCreditsInPlatformRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IGetTotalCreditsInPlatformRequest=} [properties] Properties to set + */ + function GetTotalCreditsInPlatformRequest(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]]; + } + + /** + * GetTotalCreditsInPlatformRequest v0. + * @member {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.IGetTotalCreditsInPlatformRequestV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest + * @instance + */ + GetTotalCreditsInPlatformRequest.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetTotalCreditsInPlatformRequest version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest + * @instance + */ + Object.defineProperty(GetTotalCreditsInPlatformRequest.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetTotalCreditsInPlatformRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetTotalCreditsInPlatformRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest} GetTotalCreditsInPlatformRequest instance + */ + GetTotalCreditsInPlatformRequest.create = function create(properties) { + return new GetTotalCreditsInPlatformRequest(properties); + }; + + /** + * Encodes the specified GetTotalCreditsInPlatformRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetTotalCreditsInPlatformRequest} message GetTotalCreditsInPlatformRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTotalCreditsInPlatformRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetTotalCreditsInPlatformRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetTotalCreditsInPlatformRequest} message GetTotalCreditsInPlatformRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTotalCreditsInPlatformRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetTotalCreditsInPlatformRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest} GetTotalCreditsInPlatformRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTotalCreditsInPlatformRequest.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.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetTotalCreditsInPlatformRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest} GetTotalCreditsInPlatformRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTotalCreditsInPlatformRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetTotalCreditsInPlatformRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetTotalCreditsInPlatformRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetTotalCreditsInPlatformRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest} GetTotalCreditsInPlatformRequest + */ + GetTotalCreditsInPlatformRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetTotalCreditsInPlatformRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest + * @static + * @param {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest} message GetTotalCreditsInPlatformRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetTotalCreditsInPlatformRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetTotalCreditsInPlatformRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest + * @instance + * @returns {Object.} JSON object + */ + GetTotalCreditsInPlatformRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0 = (function() { + + /** + * Properties of a GetTotalCreditsInPlatformRequestV0. + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest + * @interface IGetTotalCreditsInPlatformRequestV0 + * @property {boolean|null} [prove] GetTotalCreditsInPlatformRequestV0 prove + */ + + /** + * Constructs a new GetTotalCreditsInPlatformRequestV0. + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest + * @classdesc Represents a GetTotalCreditsInPlatformRequestV0. + * @implements IGetTotalCreditsInPlatformRequestV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.IGetTotalCreditsInPlatformRequestV0=} [properties] Properties to set + */ + function GetTotalCreditsInPlatformRequestV0(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]]; + } + + /** + * GetTotalCreditsInPlatformRequestV0 prove. + * @member {boolean} prove + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0 + * @instance + */ + GetTotalCreditsInPlatformRequestV0.prototype.prove = false; + + /** + * Creates a new GetTotalCreditsInPlatformRequestV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.IGetTotalCreditsInPlatformRequestV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0} GetTotalCreditsInPlatformRequestV0 instance + */ + GetTotalCreditsInPlatformRequestV0.create = function create(properties) { + return new GetTotalCreditsInPlatformRequestV0(properties); + }; + + /** + * Encodes the specified GetTotalCreditsInPlatformRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.IGetTotalCreditsInPlatformRequestV0} message GetTotalCreditsInPlatformRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTotalCreditsInPlatformRequestV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.prove); + return writer; + }; + + /** + * Encodes the specified GetTotalCreditsInPlatformRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.IGetTotalCreditsInPlatformRequestV0} message GetTotalCreditsInPlatformRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTotalCreditsInPlatformRequestV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetTotalCreditsInPlatformRequestV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0} GetTotalCreditsInPlatformRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTotalCreditsInPlatformRequestV0.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.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.prove = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetTotalCreditsInPlatformRequestV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0} GetTotalCreditsInPlatformRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTotalCreditsInPlatformRequestV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetTotalCreditsInPlatformRequestV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetTotalCreditsInPlatformRequestV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.prove != null && message.hasOwnProperty("prove")) + if (typeof message.prove !== "boolean") + return "prove: boolean expected"; + return null; + }; + + /** + * Creates a GetTotalCreditsInPlatformRequestV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0} GetTotalCreditsInPlatformRequestV0 + */ + GetTotalCreditsInPlatformRequestV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0(); + if (object.prove != null) + message.prove = Boolean(object.prove); + return message; + }; + + /** + * Creates a plain object from a GetTotalCreditsInPlatformRequestV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0} message GetTotalCreditsInPlatformRequestV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetTotalCreditsInPlatformRequestV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.prove = false; + if (message.prove != null && message.hasOwnProperty("prove")) + object.prove = message.prove; + return object; + }; + + /** + * Converts this GetTotalCreditsInPlatformRequestV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0 + * @instance + * @returns {Object.} JSON object + */ + GetTotalCreditsInPlatformRequestV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetTotalCreditsInPlatformRequestV0; + })(); + + return GetTotalCreditsInPlatformRequest; + })(); + + v0.GetTotalCreditsInPlatformResponse = (function() { + + /** + * Properties of a GetTotalCreditsInPlatformResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetTotalCreditsInPlatformResponse + * @property {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.IGetTotalCreditsInPlatformResponseV0|null} [v0] GetTotalCreditsInPlatformResponse v0 + */ + + /** + * Constructs a new GetTotalCreditsInPlatformResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetTotalCreditsInPlatformResponse. + * @implements IGetTotalCreditsInPlatformResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IGetTotalCreditsInPlatformResponse=} [properties] Properties to set + */ + function GetTotalCreditsInPlatformResponse(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]]; + } + + /** + * GetTotalCreditsInPlatformResponse v0. + * @member {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.IGetTotalCreditsInPlatformResponseV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse + * @instance + */ + GetTotalCreditsInPlatformResponse.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetTotalCreditsInPlatformResponse version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse + * @instance + */ + Object.defineProperty(GetTotalCreditsInPlatformResponse.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetTotalCreditsInPlatformResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetTotalCreditsInPlatformResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse} GetTotalCreditsInPlatformResponse instance + */ + GetTotalCreditsInPlatformResponse.create = function create(properties) { + return new GetTotalCreditsInPlatformResponse(properties); + }; + + /** + * Encodes the specified GetTotalCreditsInPlatformResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetTotalCreditsInPlatformResponse} message GetTotalCreditsInPlatformResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTotalCreditsInPlatformResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetTotalCreditsInPlatformResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetTotalCreditsInPlatformResponse} message GetTotalCreditsInPlatformResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTotalCreditsInPlatformResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetTotalCreditsInPlatformResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse} GetTotalCreditsInPlatformResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTotalCreditsInPlatformResponse.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.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetTotalCreditsInPlatformResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse} GetTotalCreditsInPlatformResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTotalCreditsInPlatformResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetTotalCreditsInPlatformResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetTotalCreditsInPlatformResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetTotalCreditsInPlatformResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse} GetTotalCreditsInPlatformResponse + */ + GetTotalCreditsInPlatformResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetTotalCreditsInPlatformResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse + * @static + * @param {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse} message GetTotalCreditsInPlatformResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetTotalCreditsInPlatformResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetTotalCreditsInPlatformResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse + * @instance + * @returns {Object.} JSON object + */ + GetTotalCreditsInPlatformResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0 = (function() { + + /** + * Properties of a GetTotalCreditsInPlatformResponseV0. + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse + * @interface IGetTotalCreditsInPlatformResponseV0 + * @property {number|Long|null} [credits] GetTotalCreditsInPlatformResponseV0 credits + * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetTotalCreditsInPlatformResponseV0 proof + * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetTotalCreditsInPlatformResponseV0 metadata + */ + + /** + * Constructs a new GetTotalCreditsInPlatformResponseV0. + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse + * @classdesc Represents a GetTotalCreditsInPlatformResponseV0. + * @implements IGetTotalCreditsInPlatformResponseV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.IGetTotalCreditsInPlatformResponseV0=} [properties] Properties to set + */ + function GetTotalCreditsInPlatformResponseV0(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]]; + } + + /** + * GetTotalCreditsInPlatformResponseV0 credits. + * @member {number|Long} credits + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0 + * @instance + */ + GetTotalCreditsInPlatformResponseV0.prototype.credits = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * GetTotalCreditsInPlatformResponseV0 proof. + * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0 + * @instance + */ + GetTotalCreditsInPlatformResponseV0.prototype.proof = null; + + /** + * GetTotalCreditsInPlatformResponseV0 metadata. + * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0 + * @instance + */ + GetTotalCreditsInPlatformResponseV0.prototype.metadata = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetTotalCreditsInPlatformResponseV0 result. + * @member {"credits"|"proof"|undefined} result + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0 + * @instance + */ + Object.defineProperty(GetTotalCreditsInPlatformResponseV0.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["credits", "proof"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetTotalCreditsInPlatformResponseV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.IGetTotalCreditsInPlatformResponseV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0} GetTotalCreditsInPlatformResponseV0 instance + */ + GetTotalCreditsInPlatformResponseV0.create = function create(properties) { + return new GetTotalCreditsInPlatformResponseV0(properties); + }; + + /** + * Encodes the specified GetTotalCreditsInPlatformResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.IGetTotalCreditsInPlatformResponseV0} message GetTotalCreditsInPlatformResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTotalCreditsInPlatformResponseV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.credits != null && Object.hasOwnProperty.call(message, "credits")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.credits); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetTotalCreditsInPlatformResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.IGetTotalCreditsInPlatformResponseV0} message GetTotalCreditsInPlatformResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTotalCreditsInPlatformResponseV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetTotalCreditsInPlatformResponseV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0} GetTotalCreditsInPlatformResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTotalCreditsInPlatformResponseV0.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.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.credits = reader.uint64(); + break; + case 2: + message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); + break; + case 3: + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetTotalCreditsInPlatformResponseV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0} GetTotalCreditsInPlatformResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTotalCreditsInPlatformResponseV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetTotalCreditsInPlatformResponseV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetTotalCreditsInPlatformResponseV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.credits != null && message.hasOwnProperty("credits")) { + properties.result = 1; + if (!$util.isInteger(message.credits) && !(message.credits && $util.isInteger(message.credits.low) && $util.isInteger(message.credits.high))) + return "credits: integer|Long expected"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); + if (error) + return "proof." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a GetTotalCreditsInPlatformResponseV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0} GetTotalCreditsInPlatformResponseV0 + */ + GetTotalCreditsInPlatformResponseV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0(); + if (object.credits != null) + if ($util.Long) + (message.credits = $util.Long.fromValue(object.credits)).unsigned = true; + else if (typeof object.credits === "string") + message.credits = parseInt(object.credits, 10); + else if (typeof object.credits === "number") + message.credits = object.credits; + else if (typeof object.credits === "object") + message.credits = new $util.LongBits(object.credits.low >>> 0, object.credits.high >>> 0).toNumber(true); + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0.proof: object expected"); + message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0.metadata: object expected"); + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a GetTotalCreditsInPlatformResponseV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0} message GetTotalCreditsInPlatformResponseV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetTotalCreditsInPlatformResponseV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.metadata = null; + if (message.credits != null && message.hasOwnProperty("credits")) { + if (typeof message.credits === "number") + object.credits = options.longs === String ? String(message.credits) : message.credits; + else + object.credits = options.longs === String ? $util.Long.prototype.toString.call(message.credits) : options.longs === Number ? new $util.LongBits(message.credits.low >>> 0, message.credits.high >>> 0).toNumber(true) : message.credits; + if (options.oneofs) + object.result = "credits"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); + if (options.oneofs) + object.result = "proof"; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this GetTotalCreditsInPlatformResponseV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0 + * @instance + * @returns {Object.} JSON object + */ + GetTotalCreditsInPlatformResponseV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetTotalCreditsInPlatformResponseV0; + })(); + + return GetTotalCreditsInPlatformResponse; + })(); + + v0.GetPathElementsRequest = (function() { + + /** + * Properties of a GetPathElementsRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetPathElementsRequest + * @property {org.dash.platform.dapi.v0.GetPathElementsRequest.IGetPathElementsRequestV0|null} [v0] GetPathElementsRequest v0 + */ + + /** + * Constructs a new GetPathElementsRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetPathElementsRequest. + * @implements IGetPathElementsRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IGetPathElementsRequest=} [properties] Properties to set + */ + function GetPathElementsRequest(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]]; + } + + /** + * GetPathElementsRequest v0. + * @member {org.dash.platform.dapi.v0.GetPathElementsRequest.IGetPathElementsRequestV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetPathElementsRequest + * @instance + */ + GetPathElementsRequest.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetPathElementsRequest version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetPathElementsRequest + * @instance + */ + Object.defineProperty(GetPathElementsRequest.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetPathElementsRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetPathElementsRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetPathElementsRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetPathElementsRequest} GetPathElementsRequest instance + */ + GetPathElementsRequest.create = function create(properties) { + return new GetPathElementsRequest(properties); + }; + + /** + * Encodes the specified GetPathElementsRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetPathElementsRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetPathElementsRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetPathElementsRequest} message GetPathElementsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetPathElementsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetPathElementsRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetPathElementsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetPathElementsRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetPathElementsRequest} message GetPathElementsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetPathElementsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetPathElementsRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetPathElementsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetPathElementsRequest} GetPathElementsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetPathElementsRequest.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.org.dash.platform.dapi.v0.GetPathElementsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetPathElementsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetPathElementsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetPathElementsRequest} GetPathElementsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetPathElementsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetPathElementsRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetPathElementsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetPathElementsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetPathElementsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetPathElementsRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetPathElementsRequest} GetPathElementsRequest + */ + GetPathElementsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetPathElementsRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetPathElementsRequest(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetPathElementsRequest.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetPathElementsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetPathElementsRequest + * @static + * @param {org.dash.platform.dapi.v0.GetPathElementsRequest} message GetPathElementsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetPathElementsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetPathElementsRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetPathElementsRequest + * @instance + * @returns {Object.} JSON object + */ + GetPathElementsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetPathElementsRequest.GetPathElementsRequestV0 = (function() { + + /** + * Properties of a GetPathElementsRequestV0. + * @memberof org.dash.platform.dapi.v0.GetPathElementsRequest + * @interface IGetPathElementsRequestV0 + * @property {Array.|null} [path] GetPathElementsRequestV0 path + * @property {Array.|null} [keys] GetPathElementsRequestV0 keys + * @property {boolean|null} [prove] GetPathElementsRequestV0 prove + */ + + /** + * Constructs a new GetPathElementsRequestV0. + * @memberof org.dash.platform.dapi.v0.GetPathElementsRequest + * @classdesc Represents a GetPathElementsRequestV0. + * @implements IGetPathElementsRequestV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetPathElementsRequest.IGetPathElementsRequestV0=} [properties] Properties to set + */ + function GetPathElementsRequestV0(properties) { + this.path = []; + this.keys = []; + 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]]; + } + + /** + * GetPathElementsRequestV0 path. + * @member {Array.} path + * @memberof org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0 + * @instance + */ + GetPathElementsRequestV0.prototype.path = $util.emptyArray; + + /** + * GetPathElementsRequestV0 keys. + * @member {Array.} keys + * @memberof org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0 + * @instance + */ + GetPathElementsRequestV0.prototype.keys = $util.emptyArray; + + /** + * GetPathElementsRequestV0 prove. + * @member {boolean} prove + * @memberof org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0 + * @instance + */ + GetPathElementsRequestV0.prototype.prove = false; + + /** + * Creates a new GetPathElementsRequestV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetPathElementsRequest.IGetPathElementsRequestV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0} GetPathElementsRequestV0 instance + */ + GetPathElementsRequestV0.create = function create(properties) { + return new GetPathElementsRequestV0(properties); + }; + + /** + * Encodes the specified GetPathElementsRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetPathElementsRequest.IGetPathElementsRequestV0} message GetPathElementsRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetPathElementsRequestV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && message.path.length) + for (var i = 0; i < message.path.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.path[i]); + if (message.keys != null && message.keys.length) + for (var i = 0; i < message.keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.keys[i]); + if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.prove); + return writer; + }; + + /** + * Encodes the specified GetPathElementsRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetPathElementsRequest.IGetPathElementsRequestV0} message GetPathElementsRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetPathElementsRequestV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetPathElementsRequestV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0} GetPathElementsRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetPathElementsRequestV0.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.org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.path && message.path.length)) + message.path = []; + message.path.push(reader.bytes()); + break; + case 2: + if (!(message.keys && message.keys.length)) + message.keys = []; + message.keys.push(reader.bytes()); + break; + case 3: + message.prove = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetPathElementsRequestV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0} GetPathElementsRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetPathElementsRequestV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetPathElementsRequestV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetPathElementsRequestV0.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 (!(message.path[i] && typeof message.path[i].length === "number" || $util.isString(message.path[i]))) + return "path: buffer[] expected"; + } + if (message.keys != null && message.hasOwnProperty("keys")) { + if (!Array.isArray(message.keys)) + return "keys: array expected"; + for (var i = 0; i < message.keys.length; ++i) + if (!(message.keys[i] && typeof message.keys[i].length === "number" || $util.isString(message.keys[i]))) + return "keys: buffer[] expected"; + } + if (message.prove != null && message.hasOwnProperty("prove")) + if (typeof message.prove !== "boolean") + return "prove: boolean expected"; + return null; + }; + + /** + * Creates a GetPathElementsRequestV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0} GetPathElementsRequestV0 + */ + GetPathElementsRequestV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0(); + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0.path: array expected"); + message.path = []; + for (var i = 0; i < object.path.length; ++i) + if (typeof object.path[i] === "string") + $util.base64.decode(object.path[i], message.path[i] = $util.newBuffer($util.base64.length(object.path[i])), 0); + else if (object.path[i].length >= 0) + message.path[i] = object.path[i]; + } + if (object.keys) { + if (!Array.isArray(object.keys)) + throw TypeError(".org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0.keys: array expected"); + message.keys = []; + for (var i = 0; i < object.keys.length; ++i) + if (typeof object.keys[i] === "string") + $util.base64.decode(object.keys[i], message.keys[i] = $util.newBuffer($util.base64.length(object.keys[i])), 0); + else if (object.keys[i].length >= 0) + message.keys[i] = object.keys[i]; + } + if (object.prove != null) + message.prove = Boolean(object.prove); + return message; + }; + + /** + * Creates a plain object from a GetPathElementsRequestV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0} message GetPathElementsRequestV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetPathElementsRequestV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.path = []; + object.keys = []; + } + if (options.defaults) + object.prove = false; + if (message.path && message.path.length) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = options.bytes === String ? $util.base64.encode(message.path[j], 0, message.path[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.path[j]) : message.path[j]; + } + if (message.keys && message.keys.length) { + object.keys = []; + for (var j = 0; j < message.keys.length; ++j) + object.keys[j] = options.bytes === String ? $util.base64.encode(message.keys[j], 0, message.keys[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.keys[j]) : message.keys[j]; + } + if (message.prove != null && message.hasOwnProperty("prove")) + object.prove = message.prove; + return object; + }; + + /** + * Converts this GetPathElementsRequestV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0 + * @instance + * @returns {Object.} JSON object + */ + GetPathElementsRequestV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetPathElementsRequestV0; + })(); + + return GetPathElementsRequest; + })(); + + v0.GetPathElementsResponse = (function() { + + /** + * Properties of a GetPathElementsResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetPathElementsResponse + * @property {org.dash.platform.dapi.v0.GetPathElementsResponse.IGetPathElementsResponseV0|null} [v0] GetPathElementsResponse v0 + */ + + /** + * Constructs a new GetPathElementsResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetPathElementsResponse. + * @implements IGetPathElementsResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IGetPathElementsResponse=} [properties] Properties to set + */ + function GetPathElementsResponse(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]]; + } + + /** + * GetPathElementsResponse v0. + * @member {org.dash.platform.dapi.v0.GetPathElementsResponse.IGetPathElementsResponseV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse + * @instance + */ + GetPathElementsResponse.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetPathElementsResponse version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse + * @instance + */ + Object.defineProperty(GetPathElementsResponse.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetPathElementsResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetPathElementsResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetPathElementsResponse} GetPathElementsResponse instance + */ + GetPathElementsResponse.create = function create(properties) { + return new GetPathElementsResponse(properties); + }; + + /** + * Encodes the specified GetPathElementsResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetPathElementsResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetPathElementsResponse} message GetPathElementsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetPathElementsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetPathElementsResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetPathElementsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetPathElementsResponse} message GetPathElementsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetPathElementsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetPathElementsResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetPathElementsResponse} GetPathElementsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetPathElementsResponse.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.org.dash.platform.dapi.v0.GetPathElementsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetPathElementsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetPathElementsResponse} GetPathElementsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetPathElementsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetPathElementsResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetPathElementsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetPathElementsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetPathElementsResponse} GetPathElementsResponse + */ + GetPathElementsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetPathElementsResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetPathElementsResponse(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetPathElementsResponse.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetPathElementsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse + * @static + * @param {org.dash.platform.dapi.v0.GetPathElementsResponse} message GetPathElementsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetPathElementsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetPathElementsResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse + * @instance + * @returns {Object.} JSON object + */ + GetPathElementsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetPathElementsResponse.GetPathElementsResponseV0 = (function() { + + /** + * Properties of a GetPathElementsResponseV0. + * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse + * @interface IGetPathElementsResponseV0 + * @property {org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.IElements|null} [elements] GetPathElementsResponseV0 elements + * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetPathElementsResponseV0 proof + * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetPathElementsResponseV0 metadata + */ + + /** + * Constructs a new GetPathElementsResponseV0. + * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse + * @classdesc Represents a GetPathElementsResponseV0. + * @implements IGetPathElementsResponseV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetPathElementsResponse.IGetPathElementsResponseV0=} [properties] Properties to set + */ + function GetPathElementsResponseV0(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]]; + } + + /** + * GetPathElementsResponseV0 elements. + * @member {org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.IElements|null|undefined} elements + * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0 + * @instance + */ + GetPathElementsResponseV0.prototype.elements = null; + + /** + * GetPathElementsResponseV0 proof. + * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof + * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0 + * @instance + */ + GetPathElementsResponseV0.prototype.proof = null; + + /** + * GetPathElementsResponseV0 metadata. + * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata + * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0 + * @instance + */ + GetPathElementsResponseV0.prototype.metadata = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetPathElementsResponseV0 result. + * @member {"elements"|"proof"|undefined} result + * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0 + * @instance + */ + Object.defineProperty(GetPathElementsResponseV0.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["elements", "proof"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetPathElementsResponseV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetPathElementsResponse.IGetPathElementsResponseV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0} GetPathElementsResponseV0 instance + */ + GetPathElementsResponseV0.create = function create(properties) { + return new GetPathElementsResponseV0(properties); + }; + + /** + * Encodes the specified GetPathElementsResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetPathElementsResponse.IGetPathElementsResponseV0} message GetPathElementsResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetPathElementsResponseV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.elements != null && Object.hasOwnProperty.call(message, "elements")) + $root.org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.Elements.encode(message.elements, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetPathElementsResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetPathElementsResponse.IGetPathElementsResponseV0} message GetPathElementsResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetPathElementsResponseV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetPathElementsResponseV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0} GetPathElementsResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetPathElementsResponseV0.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.org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.elements = $root.org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.Elements.decode(reader, reader.uint32()); + break; + case 2: + message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); + break; + case 3: + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetPathElementsResponseV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0} GetPathElementsResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetPathElementsResponseV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetPathElementsResponseV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetPathElementsResponseV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.elements != null && message.hasOwnProperty("elements")) { + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.Elements.verify(message.elements); + if (error) + return "elements." + error; + } + } + if (message.proof != null && message.hasOwnProperty("proof")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); + if (error) + return "proof." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a GetPathElementsResponseV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0} GetPathElementsResponseV0 + */ + GetPathElementsResponseV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0(); + if (object.elements != null) { + if (typeof object.elements !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.elements: object expected"); + message.elements = $root.org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.Elements.fromObject(object.elements); + } + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.proof: object expected"); + message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.metadata: object expected"); + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a GetPathElementsResponseV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0} message GetPathElementsResponseV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetPathElementsResponseV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.metadata = null; + if (message.elements != null && message.hasOwnProperty("elements")) { + object.elements = $root.org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.Elements.toObject(message.elements, options); + if (options.oneofs) + object.result = "elements"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); + if (options.oneofs) + object.result = "proof"; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this GetPathElementsResponseV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0 + * @instance + * @returns {Object.} JSON object + */ + GetPathElementsResponseV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetPathElementsResponseV0.Elements = (function() { + + /** + * Properties of an Elements. + * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0 + * @interface IElements + * @property {Array.|null} [elements] Elements elements + */ + + /** + * Constructs a new Elements. + * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0 + * @classdesc Represents an Elements. + * @implements IElements + * @constructor + * @param {org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.IElements=} [properties] Properties to set + */ + function Elements(properties) { + this.elements = []; + 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]]; + } + + /** + * Elements elements. + * @member {Array.} elements + * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.Elements + * @instance + */ + Elements.prototype.elements = $util.emptyArray; + + /** + * Creates a new Elements instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.Elements + * @static + * @param {org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.IElements=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.Elements} Elements instance + */ + Elements.create = function create(properties) { + return new Elements(properties); + }; + + /** + * Encodes the specified Elements message. Does not implicitly {@link org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.Elements.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.Elements + * @static + * @param {org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.IElements} message Elements message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Elements.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.elements != null && message.elements.length) + for (var i = 0; i < message.elements.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.elements[i]); + return writer; + }; + + /** + * Encodes the specified Elements message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.Elements.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.Elements + * @static + * @param {org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.IElements} message Elements message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Elements.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Elements message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.Elements + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.Elements} Elements + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Elements.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.org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.Elements(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.elements && message.elements.length)) + message.elements = []; + message.elements.push(reader.bytes()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Elements message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.Elements + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.Elements} Elements + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Elements.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Elements message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.Elements + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Elements.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.elements != null && message.hasOwnProperty("elements")) { + if (!Array.isArray(message.elements)) + return "elements: array expected"; + for (var i = 0; i < message.elements.length; ++i) + if (!(message.elements[i] && typeof message.elements[i].length === "number" || $util.isString(message.elements[i]))) + return "elements: buffer[] expected"; + } + return null; + }; + + /** + * Creates an Elements message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.Elements + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.Elements} Elements + */ + Elements.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.Elements) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.Elements(); + if (object.elements) { + if (!Array.isArray(object.elements)) + throw TypeError(".org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.Elements.elements: array expected"); + message.elements = []; + for (var i = 0; i < object.elements.length; ++i) + if (typeof object.elements[i] === "string") + $util.base64.decode(object.elements[i], message.elements[i] = $util.newBuffer($util.base64.length(object.elements[i])), 0); + else if (object.elements[i].length >= 0) + message.elements[i] = object.elements[i]; + } + return message; + }; + + /** + * Creates a plain object from an Elements message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.Elements + * @static + * @param {org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.Elements} message Elements + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Elements.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.elements = []; + if (message.elements && message.elements.length) { + object.elements = []; + for (var j = 0; j < message.elements.length; ++j) + object.elements[j] = options.bytes === String ? $util.base64.encode(message.elements[j], 0, message.elements[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.elements[j]) : message.elements[j]; + } + return object; + }; + + /** + * Converts this Elements to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.Elements + * @instance + * @returns {Object.} JSON object + */ + Elements.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Elements; + })(); + + return GetPathElementsResponseV0; + })(); + + return GetPathElementsResponse; + })(); + + v0.GetStatusRequest = (function() { + + /** + * Properties of a GetStatusRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetStatusRequest + * @property {org.dash.platform.dapi.v0.GetStatusRequest.IGetStatusRequestV0|null} [v0] GetStatusRequest v0 + */ + + /** + * Constructs a new GetStatusRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetStatusRequest. + * @implements IGetStatusRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IGetStatusRequest=} [properties] Properties to set + */ + function GetStatusRequest(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]]; + } + + /** + * GetStatusRequest v0. + * @member {org.dash.platform.dapi.v0.GetStatusRequest.IGetStatusRequestV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetStatusRequest + * @instance + */ + GetStatusRequest.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetStatusRequest version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetStatusRequest + * @instance + */ + Object.defineProperty(GetStatusRequest.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetStatusRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetStatusRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetStatusRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetStatusRequest} GetStatusRequest instance + */ + GetStatusRequest.create = function create(properties) { + return new GetStatusRequest(properties); + }; + + /** + * Encodes the specified GetStatusRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetStatusRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetStatusRequest} message GetStatusRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetStatusRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetStatusRequest.GetStatusRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetStatusRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetStatusRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetStatusRequest} message GetStatusRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetStatusRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetStatusRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetStatusRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetStatusRequest} GetStatusRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetStatusRequest.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.org.dash.platform.dapi.v0.GetStatusRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetStatusRequest.GetStatusRequestV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetStatusRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetStatusRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetStatusRequest} GetStatusRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetStatusRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetStatusRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetStatusRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetStatusRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetStatusRequest.GetStatusRequestV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetStatusRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetStatusRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetStatusRequest} GetStatusRequest + */ + GetStatusRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetStatusRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetStatusRequest(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetStatusRequest.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetStatusRequest.GetStatusRequestV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetStatusRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetStatusRequest + * @static + * @param {org.dash.platform.dapi.v0.GetStatusRequest} message GetStatusRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetStatusRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetStatusRequest.GetStatusRequestV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetStatusRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetStatusRequest + * @instance + * @returns {Object.} JSON object + */ + GetStatusRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetStatusRequest.GetStatusRequestV0 = (function() { + + /** + * Properties of a GetStatusRequestV0. + * @memberof org.dash.platform.dapi.v0.GetStatusRequest + * @interface IGetStatusRequestV0 + */ + + /** + * Constructs a new GetStatusRequestV0. + * @memberof org.dash.platform.dapi.v0.GetStatusRequest + * @classdesc Represents a GetStatusRequestV0. + * @implements IGetStatusRequestV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetStatusRequest.IGetStatusRequestV0=} [properties] Properties to set + */ + function GetStatusRequestV0(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]]; + } + + /** + * Creates a new GetStatusRequestV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetStatusRequest.GetStatusRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetStatusRequest.IGetStatusRequestV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetStatusRequest.GetStatusRequestV0} GetStatusRequestV0 instance + */ + GetStatusRequestV0.create = function create(properties) { + return new GetStatusRequestV0(properties); + }; + + /** + * Encodes the specified GetStatusRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusRequest.GetStatusRequestV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetStatusRequest.GetStatusRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetStatusRequest.IGetStatusRequestV0} message GetStatusRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetStatusRequestV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified GetStatusRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusRequest.GetStatusRequestV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetStatusRequest.GetStatusRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetStatusRequest.IGetStatusRequestV0} message GetStatusRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetStatusRequestV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetStatusRequestV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetStatusRequest.GetStatusRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetStatusRequest.GetStatusRequestV0} GetStatusRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetStatusRequestV0.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.org.dash.platform.dapi.v0.GetStatusRequest.GetStatusRequestV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetStatusRequestV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetStatusRequest.GetStatusRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetStatusRequest.GetStatusRequestV0} GetStatusRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetStatusRequestV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetStatusRequestV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetStatusRequest.GetStatusRequestV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetStatusRequestV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a GetStatusRequestV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetStatusRequest.GetStatusRequestV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetStatusRequest.GetStatusRequestV0} GetStatusRequestV0 + */ + GetStatusRequestV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetStatusRequest.GetStatusRequestV0) + return object; + return new $root.org.dash.platform.dapi.v0.GetStatusRequest.GetStatusRequestV0(); + }; + + /** + * Creates a plain object from a GetStatusRequestV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetStatusRequest.GetStatusRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetStatusRequest.GetStatusRequestV0} message GetStatusRequestV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetStatusRequestV0.toObject = function toObject() { + return {}; + }; + + /** + * Converts this GetStatusRequestV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetStatusRequest.GetStatusRequestV0 + * @instance + * @returns {Object.} JSON object + */ + GetStatusRequestV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetStatusRequestV0; + })(); + + return GetStatusRequest; + })(); + + v0.GetStatusResponse = (function() { + + /** + * Properties of a GetStatusResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetStatusResponse + * @property {org.dash.platform.dapi.v0.GetStatusResponse.IGetStatusResponseV0|null} [v0] GetStatusResponse v0 + */ + + /** + * Constructs a new GetStatusResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetStatusResponse. + * @implements IGetStatusResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IGetStatusResponse=} [properties] Properties to set + */ + function GetStatusResponse(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]]; + } + + /** + * GetStatusResponse v0. + * @member {org.dash.platform.dapi.v0.GetStatusResponse.IGetStatusResponseV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetStatusResponse + * @instance + */ + GetStatusResponse.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetStatusResponse version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetStatusResponse + * @instance + */ + Object.defineProperty(GetStatusResponse.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetStatusResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetStatusResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetStatusResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetStatusResponse} GetStatusResponse instance + */ + GetStatusResponse.create = function create(properties) { + return new GetStatusResponse(properties); + }; + + /** + * Encodes the specified GetStatusResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetStatusResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetStatusResponse} message GetStatusResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetStatusResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetStatusResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetStatusResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetStatusResponse} message GetStatusResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetStatusResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetStatusResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetStatusResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetStatusResponse} GetStatusResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetStatusResponse.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.org.dash.platform.dapi.v0.GetStatusResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetStatusResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetStatusResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetStatusResponse} GetStatusResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetStatusResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetStatusResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetStatusResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetStatusResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetStatusResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetStatusResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetStatusResponse} GetStatusResponse + */ + GetStatusResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetStatusResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetStatusResponse(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetStatusResponse.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetStatusResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetStatusResponse + * @static + * @param {org.dash.platform.dapi.v0.GetStatusResponse} message GetStatusResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetStatusResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetStatusResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetStatusResponse + * @instance + * @returns {Object.} JSON object + */ + GetStatusResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetStatusResponse.GetStatusResponseV0 = (function() { + + /** + * Properties of a GetStatusResponseV0. + * @memberof org.dash.platform.dapi.v0.GetStatusResponse + * @interface IGetStatusResponseV0 + * @property {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.IVersion|null} [version] GetStatusResponseV0 version + * @property {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.INode|null} [node] GetStatusResponseV0 node + * @property {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.IChain|null} [chain] GetStatusResponseV0 chain + * @property {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.INetwork|null} [network] GetStatusResponseV0 network + * @property {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.IStateSync|null} [stateSync] GetStatusResponseV0 stateSync + * @property {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.ITime|null} [time] GetStatusResponseV0 time + */ + + /** + * Constructs a new GetStatusResponseV0. + * @memberof org.dash.platform.dapi.v0.GetStatusResponse + * @classdesc Represents a GetStatusResponseV0. + * @implements IGetStatusResponseV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetStatusResponse.IGetStatusResponseV0=} [properties] Properties to set + */ + function GetStatusResponseV0(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]]; + } + + /** + * GetStatusResponseV0 version. + * @member {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.IVersion|null|undefined} version + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0 + * @instance + */ + GetStatusResponseV0.prototype.version = null; + + /** + * GetStatusResponseV0 node. + * @member {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.INode|null|undefined} node + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0 + * @instance + */ + GetStatusResponseV0.prototype.node = null; + + /** + * GetStatusResponseV0 chain. + * @member {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.IChain|null|undefined} chain + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0 + * @instance + */ + GetStatusResponseV0.prototype.chain = null; + + /** + * GetStatusResponseV0 network. + * @member {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.INetwork|null|undefined} network + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0 + * @instance + */ + GetStatusResponseV0.prototype.network = null; + + /** + * GetStatusResponseV0 stateSync. + * @member {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.IStateSync|null|undefined} stateSync + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0 + * @instance + */ + GetStatusResponseV0.prototype.stateSync = null; + + /** + * GetStatusResponseV0 time. + * @member {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.ITime|null|undefined} time + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0 + * @instance + */ + GetStatusResponseV0.prototype.time = null; + + /** + * Creates a new GetStatusResponseV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetStatusResponse.IGetStatusResponseV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0} GetStatusResponseV0 instance + */ + GetStatusResponseV0.create = function create(properties) { + return new GetStatusResponseV0(properties); + }; + + /** + * Encodes the specified GetStatusResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetStatusResponse.IGetStatusResponseV0} message GetStatusResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetStatusResponseV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.encode(message.version, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.node != null && Object.hasOwnProperty.call(message, "node")) + $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node.encode(message.node, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.chain != null && Object.hasOwnProperty.call(message, "chain")) + $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain.encode(message.chain, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.network != null && Object.hasOwnProperty.call(message, "network")) + $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network.encode(message.network, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.stateSync != null && Object.hasOwnProperty.call(message, "stateSync")) + $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync.encode(message.stateSync, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.time != null && Object.hasOwnProperty.call(message, "time")) + $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time.encode(message.time, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetStatusResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetStatusResponse.IGetStatusResponseV0} message GetStatusResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetStatusResponseV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetStatusResponseV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0} GetStatusResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetStatusResponseV0.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.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.version = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.decode(reader, reader.uint32()); + break; + case 2: + message.node = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node.decode(reader, reader.uint32()); + break; + case 3: + message.chain = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain.decode(reader, reader.uint32()); + break; + case 4: + message.network = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network.decode(reader, reader.uint32()); + break; + case 5: + message.stateSync = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync.decode(reader, reader.uint32()); + break; + case 6: + message.time = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetStatusResponseV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0} GetStatusResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetStatusResponseV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetStatusResponseV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetStatusResponseV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.version != null && message.hasOwnProperty("version")) { + var error = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.verify(message.version); + if (error) + return "version." + error; + } + if (message.node != null && message.hasOwnProperty("node")) { + var error = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node.verify(message.node); + if (error) + return "node." + error; + } + if (message.chain != null && message.hasOwnProperty("chain")) { + var error = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain.verify(message.chain); + if (error) + return "chain." + error; + } + if (message.network != null && message.hasOwnProperty("network")) { + var error = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network.verify(message.network); + if (error) + return "network." + error; + } + if (message.stateSync != null && message.hasOwnProperty("stateSync")) { + var error = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync.verify(message.stateSync); + if (error) + return "stateSync." + error; + } + if (message.time != null && message.hasOwnProperty("time")) { + var error = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time.verify(message.time); + if (error) + return "time." + error; + } + return null; + }; + + /** + * Creates a GetStatusResponseV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0} GetStatusResponseV0 + */ + GetStatusResponseV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0(); + if (object.version != null) { + if (typeof object.version !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.version: object expected"); + message.version = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.fromObject(object.version); + } + if (object.node != null) { + if (typeof object.node !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.node: object expected"); + message.node = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node.fromObject(object.node); + } + if (object.chain != null) { + if (typeof object.chain !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.chain: object expected"); + message.chain = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain.fromObject(object.chain); + } + if (object.network != null) { + if (typeof object.network !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.network: object expected"); + message.network = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network.fromObject(object.network); + } + if (object.stateSync != null) { + if (typeof object.stateSync !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.stateSync: object expected"); + message.stateSync = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync.fromObject(object.stateSync); + } + if (object.time != null) { + if (typeof object.time !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.time: object expected"); + message.time = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time.fromObject(object.time); + } + return message; + }; + + /** + * Creates a plain object from a GetStatusResponseV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0} message GetStatusResponseV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetStatusResponseV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.version = null; + object.node = null; + object.chain = null; + object.network = null; + object.stateSync = null; + object.time = null; + } + if (message.version != null && message.hasOwnProperty("version")) + object.version = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.toObject(message.version, options); + if (message.node != null && message.hasOwnProperty("node")) + object.node = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node.toObject(message.node, options); + if (message.chain != null && message.hasOwnProperty("chain")) + object.chain = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain.toObject(message.chain, options); + if (message.network != null && message.hasOwnProperty("network")) + object.network = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network.toObject(message.network, options); + if (message.stateSync != null && message.hasOwnProperty("stateSync")) + object.stateSync = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync.toObject(message.stateSync, options); + if (message.time != null && message.hasOwnProperty("time")) + object.time = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time.toObject(message.time, options); + return object; + }; + + /** + * Converts this GetStatusResponseV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0 + * @instance + * @returns {Object.} JSON object + */ + GetStatusResponseV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetStatusResponseV0.Version = (function() { + + /** + * Properties of a Version. + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0 + * @interface IVersion + * @property {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.ISoftware|null} [software] Version software + * @property {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.IProtocol|null} [protocol] Version protocol + */ + + /** + * Constructs a new Version. + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0 + * @classdesc Represents a Version. + * @implements IVersion + * @constructor + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.IVersion=} [properties] Properties to set + */ + function Version(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]]; + } + + /** + * Version software. + * @member {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.ISoftware|null|undefined} software + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version + * @instance + */ + Version.prototype.software = null; + + /** + * Version protocol. + * @member {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.IProtocol|null|undefined} protocol + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version + * @instance + */ + Version.prototype.protocol = null; + + /** + * Creates a new Version instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version + * @static + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.IVersion=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version} Version instance + */ + Version.create = function create(properties) { + return new Version(properties); + }; + + /** + * Encodes the specified Version message. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version + * @static + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.IVersion} message Version message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Version.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.software != null && Object.hasOwnProperty.call(message, "software")) + $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software.encode(message.software, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.protocol != null && Object.hasOwnProperty.call(message, "protocol")) + $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.encode(message.protocol, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Version message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version + * @static + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.IVersion} message Version message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Version.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Version message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version} Version + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Version.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.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.software = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software.decode(reader, reader.uint32()); + break; + case 2: + message.protocol = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Version message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version} Version + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Version.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Version message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Version.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.software != null && message.hasOwnProperty("software")) { + var error = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software.verify(message.software); + if (error) + return "software." + error; + } + if (message.protocol != null && message.hasOwnProperty("protocol")) { + var error = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.verify(message.protocol); + if (error) + return "protocol." + error; + } + return null; + }; + + /** + * Creates a Version message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version} Version + */ + Version.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version(); + if (object.software != null) { + if (typeof object.software !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.software: object expected"); + message.software = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software.fromObject(object.software); + } + if (object.protocol != null) { + if (typeof object.protocol !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.protocol: object expected"); + message.protocol = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.fromObject(object.protocol); + } + return message; + }; + + /** + * Creates a plain object from a Version message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version + * @static + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version} message Version + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Version.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.software = null; + object.protocol = null; + } + if (message.software != null && message.hasOwnProperty("software")) + object.software = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software.toObject(message.software, options); + if (message.protocol != null && message.hasOwnProperty("protocol")) + object.protocol = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.toObject(message.protocol, options); + return object; + }; + + /** + * Converts this Version to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version + * @instance + * @returns {Object.} JSON object + */ + Version.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + Version.Software = (function() { + + /** + * Properties of a Software. + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version + * @interface ISoftware + * @property {string|null} [dapi] Software dapi + * @property {string|null} [drive] Software drive + * @property {string|null} [tenderdash] Software tenderdash + */ + + /** + * Constructs a new Software. + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version + * @classdesc Represents a Software. + * @implements ISoftware + * @constructor + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.ISoftware=} [properties] Properties to set + */ + function Software(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]]; + } + + /** + * Software dapi. + * @member {string} dapi + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software + * @instance + */ + Software.prototype.dapi = ""; + + /** + * Software drive. + * @member {string} drive + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software + * @instance + */ + Software.prototype.drive = ""; + + /** + * Software tenderdash. + * @member {string} tenderdash + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software + * @instance + */ + Software.prototype.tenderdash = ""; + + /** + * Creates a new Software instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software + * @static + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.ISoftware=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software} Software instance + */ + Software.create = function create(properties) { + return new Software(properties); + }; + + /** + * Encodes the specified Software message. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software + * @static + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.ISoftware} message Software message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Software.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dapi != null && Object.hasOwnProperty.call(message, "dapi")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.dapi); + if (message.drive != null && Object.hasOwnProperty.call(message, "drive")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.drive); + if (message.tenderdash != null && Object.hasOwnProperty.call(message, "tenderdash")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.tenderdash); + return writer; + }; + + /** + * Encodes the specified Software message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software + * @static + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.ISoftware} message Software message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Software.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Software message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software} Software + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Software.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.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.dapi = reader.string(); + break; + case 2: + message.drive = reader.string(); + break; + case 3: + message.tenderdash = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Software message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software} Software + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Software.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Software message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Software.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.dapi != null && message.hasOwnProperty("dapi")) + if (!$util.isString(message.dapi)) + return "dapi: string expected"; + if (message.drive != null && message.hasOwnProperty("drive")) + if (!$util.isString(message.drive)) + return "drive: string expected"; + if (message.tenderdash != null && message.hasOwnProperty("tenderdash")) + if (!$util.isString(message.tenderdash)) + return "tenderdash: string expected"; + return null; + }; + + /** + * Creates a Software message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software} Software + */ + Software.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software(); + if (object.dapi != null) + message.dapi = String(object.dapi); + if (object.drive != null) + message.drive = String(object.drive); + if (object.tenderdash != null) + message.tenderdash = String(object.tenderdash); + return message; + }; + + /** + * Creates a plain object from a Software message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software + * @static + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software} message Software + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Software.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.dapi = ""; + object.drive = ""; + object.tenderdash = ""; + } + if (message.dapi != null && message.hasOwnProperty("dapi")) + object.dapi = message.dapi; + if (message.drive != null && message.hasOwnProperty("drive")) + object.drive = message.drive; + if (message.tenderdash != null && message.hasOwnProperty("tenderdash")) + object.tenderdash = message.tenderdash; + return object; + }; + + /** + * Converts this Software to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software + * @instance + * @returns {Object.} JSON object + */ + Software.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Software; + })(); + + Version.Protocol = (function() { + + /** + * Properties of a Protocol. + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version + * @interface IProtocol + * @property {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.ITenderdash|null} [tenderdash] Protocol tenderdash + * @property {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.IDrive|null} [drive] Protocol drive + */ + + /** + * Constructs a new Protocol. + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version + * @classdesc Represents a Protocol. + * @implements IProtocol + * @constructor + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.IProtocol=} [properties] Properties to set + */ + function Protocol(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]]; + } + + /** + * Protocol tenderdash. + * @member {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.ITenderdash|null|undefined} tenderdash + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol + * @instance + */ + Protocol.prototype.tenderdash = null; + + /** + * Protocol drive. + * @member {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.IDrive|null|undefined} drive + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol + * @instance + */ + Protocol.prototype.drive = null; + + /** + * Creates a new Protocol instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol + * @static + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.IProtocol=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol} Protocol instance + */ + Protocol.create = function create(properties) { + return new Protocol(properties); + }; + + /** + * Encodes the specified Protocol message. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol + * @static + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.IProtocol} message Protocol message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Protocol.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tenderdash != null && Object.hasOwnProperty.call(message, "tenderdash")) + $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash.encode(message.tenderdash, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.drive != null && Object.hasOwnProperty.call(message, "drive")) + $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive.encode(message.drive, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Protocol message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol + * @static + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.IProtocol} message Protocol message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Protocol.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Protocol message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol} Protocol + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Protocol.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.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tenderdash = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash.decode(reader, reader.uint32()); + break; + case 2: + message.drive = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Protocol message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol} Protocol + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Protocol.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Protocol message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Protocol.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tenderdash != null && message.hasOwnProperty("tenderdash")) { + var error = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash.verify(message.tenderdash); + if (error) + return "tenderdash." + error; + } + if (message.drive != null && message.hasOwnProperty("drive")) { + var error = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive.verify(message.drive); + if (error) + return "drive." + error; + } + return null; + }; + + /** + * Creates a Protocol message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol} Protocol + */ + Protocol.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol(); + if (object.tenderdash != null) { + if (typeof object.tenderdash !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.tenderdash: object expected"); + message.tenderdash = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash.fromObject(object.tenderdash); + } + if (object.drive != null) { + if (typeof object.drive !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.drive: object expected"); + message.drive = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive.fromObject(object.drive); + } + return message; + }; + + /** + * Creates a plain object from a Protocol message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol + * @static + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol} message Protocol + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Protocol.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.tenderdash = null; + object.drive = null; + } + if (message.tenderdash != null && message.hasOwnProperty("tenderdash")) + object.tenderdash = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash.toObject(message.tenderdash, options); + if (message.drive != null && message.hasOwnProperty("drive")) + object.drive = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive.toObject(message.drive, options); + return object; + }; + + /** + * Converts this Protocol to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol + * @instance + * @returns {Object.} JSON object + */ + Protocol.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + Protocol.Tenderdash = (function() { + + /** + * Properties of a Tenderdash. + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol + * @interface ITenderdash + * @property {number|null} [p2p] Tenderdash p2p + * @property {number|null} [block] Tenderdash block + */ + + /** + * Constructs a new Tenderdash. + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol + * @classdesc Represents a Tenderdash. + * @implements ITenderdash + * @constructor + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.ITenderdash=} [properties] Properties to set + */ + function Tenderdash(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]]; + } + + /** + * Tenderdash p2p. + * @member {number} p2p + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash + * @instance + */ + Tenderdash.prototype.p2p = 0; + + /** + * Tenderdash block. + * @member {number} block + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash + * @instance + */ + Tenderdash.prototype.block = 0; + + /** + * Creates a new Tenderdash instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash + * @static + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.ITenderdash=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash} Tenderdash instance + */ + Tenderdash.create = function create(properties) { + return new Tenderdash(properties); + }; + + /** + * Encodes the specified Tenderdash message. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash + * @static + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.ITenderdash} message Tenderdash message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Tenderdash.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.p2p != null && Object.hasOwnProperty.call(message, "p2p")) + writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.p2p); + if (message.block != null && Object.hasOwnProperty.call(message, "block")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.block); + return writer; + }; + + /** + * Encodes the specified Tenderdash message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash + * @static + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.ITenderdash} message Tenderdash message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Tenderdash.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Tenderdash message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash} Tenderdash + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Tenderdash.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.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.p2p = reader.uint32(); + break; + case 2: + message.block = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Tenderdash message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash} Tenderdash + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Tenderdash.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Tenderdash message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Tenderdash.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.p2p != null && message.hasOwnProperty("p2p")) + if (!$util.isInteger(message.p2p)) + return "p2p: integer expected"; + if (message.block != null && message.hasOwnProperty("block")) + if (!$util.isInteger(message.block)) + return "block: integer expected"; + return null; + }; + + /** + * Creates a Tenderdash message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash} Tenderdash + */ + Tenderdash.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash(); + if (object.p2p != null) + message.p2p = object.p2p >>> 0; + if (object.block != null) + message.block = object.block >>> 0; + return message; + }; + + /** + * Creates a plain object from a Tenderdash message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash + * @static + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash} message Tenderdash + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Tenderdash.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.p2p = 0; + object.block = 0; + } + if (message.p2p != null && message.hasOwnProperty("p2p")) + object.p2p = message.p2p; + if (message.block != null && message.hasOwnProperty("block")) + object.block = message.block; + return object; + }; + + /** + * Converts this Tenderdash to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash + * @instance + * @returns {Object.} JSON object + */ + Tenderdash.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Tenderdash; + })(); + + Protocol.Drive = (function() { + + /** + * Properties of a Drive. + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol + * @interface IDrive + * @property {number|null} [latest] Drive latest + * @property {number|null} [current] Drive current + */ + + /** + * Constructs a new Drive. + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol + * @classdesc Represents a Drive. + * @implements IDrive + * @constructor + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.IDrive=} [properties] Properties to set + */ + function Drive(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]]; + } + + /** + * Drive latest. + * @member {number} latest + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive + * @instance + */ + Drive.prototype.latest = 0; + + /** + * Drive current. + * @member {number} current + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive + * @instance + */ + Drive.prototype.current = 0; + + /** + * Creates a new Drive instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive + * @static + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.IDrive=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive} Drive instance + */ + Drive.create = function create(properties) { + return new Drive(properties); + }; + + /** + * Encodes the specified Drive message. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive + * @static + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.IDrive} message Drive message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Drive.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.latest != null && Object.hasOwnProperty.call(message, "latest")) + writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.latest); + if (message.current != null && Object.hasOwnProperty.call(message, "current")) + writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.current); + return writer; + }; + + /** + * Encodes the specified Drive message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive + * @static + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.IDrive} message Drive message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Drive.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Drive message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive} Drive + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Drive.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.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: + message.latest = reader.uint32(); + break; + case 4: + message.current = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Drive message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive} Drive + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Drive.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Drive message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Drive.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.latest != null && message.hasOwnProperty("latest")) + if (!$util.isInteger(message.latest)) + return "latest: integer expected"; + if (message.current != null && message.hasOwnProperty("current")) + if (!$util.isInteger(message.current)) + return "current: integer expected"; + return null; + }; + + /** + * Creates a Drive message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive} Drive + */ + Drive.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive(); + if (object.latest != null) + message.latest = object.latest >>> 0; + if (object.current != null) + message.current = object.current >>> 0; + return message; + }; + + /** + * Creates a plain object from a Drive message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive + * @static + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive} message Drive + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Drive.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.latest = 0; + object.current = 0; + } + if (message.latest != null && message.hasOwnProperty("latest")) + object.latest = message.latest; + if (message.current != null && message.hasOwnProperty("current")) + object.current = message.current; + return object; + }; + + /** + * Converts this Drive to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive + * @instance + * @returns {Object.} JSON object + */ + Drive.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Drive; + })(); + + return Protocol; + })(); + + return Version; + })(); + + GetStatusResponseV0.Time = (function() { + + /** + * Properties of a Time. + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0 + * @interface ITime + * @property {number|Long|null} [local] Time local + * @property {number|Long|null} [block] Time block + * @property {number|Long|null} [genesis] Time genesis + * @property {number|null} [epoch] Time epoch + */ + + /** + * Constructs a new Time. + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0 + * @classdesc Represents a Time. + * @implements ITime + * @constructor + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.ITime=} [properties] Properties to set + */ + function Time(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]]; + } + + /** + * Time local. + * @member {number|Long} local + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time + * @instance + */ + Time.prototype.local = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Time block. + * @member {number|Long} block + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time + * @instance + */ + Time.prototype.block = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Time genesis. + * @member {number|Long} genesis + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time + * @instance + */ + Time.prototype.genesis = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Time epoch. + * @member {number} epoch + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time + * @instance + */ + Time.prototype.epoch = 0; + + /** + * Creates a new Time instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time + * @static + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.ITime=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time} Time instance + */ + Time.create = function create(properties) { + return new Time(properties); + }; + + /** + * Encodes the specified Time message. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time + * @static + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.ITime} message Time message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Time.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.local != null && Object.hasOwnProperty.call(message, "local")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.local); + if (message.block != null && Object.hasOwnProperty.call(message, "block")) + writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.block); + if (message.genesis != null && Object.hasOwnProperty.call(message, "genesis")) + writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.genesis); + if (message.epoch != null && Object.hasOwnProperty.call(message, "epoch")) + writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.epoch); + return writer; + }; + + /** + * Encodes the specified Time message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time + * @static + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.ITime} message Time message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Time.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Time message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time} Time + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Time.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.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.local = reader.uint64(); + break; + case 2: + message.block = reader.uint64(); + break; + case 3: + message.genesis = reader.uint64(); + break; + case 4: + message.epoch = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Time message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time} Time + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Time.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Time message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Time.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.local != null && message.hasOwnProperty("local")) + if (!$util.isInteger(message.local) && !(message.local && $util.isInteger(message.local.low) && $util.isInteger(message.local.high))) + return "local: integer|Long expected"; + if (message.block != null && message.hasOwnProperty("block")) + if (!$util.isInteger(message.block) && !(message.block && $util.isInteger(message.block.low) && $util.isInteger(message.block.high))) + return "block: integer|Long expected"; + if (message.genesis != null && message.hasOwnProperty("genesis")) + if (!$util.isInteger(message.genesis) && !(message.genesis && $util.isInteger(message.genesis.low) && $util.isInteger(message.genesis.high))) + return "genesis: integer|Long expected"; + if (message.epoch != null && message.hasOwnProperty("epoch")) + if (!$util.isInteger(message.epoch)) + return "epoch: integer expected"; + return null; + }; + + /** + * Creates a Time message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time} Time + */ + Time.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time(); + if (object.local != null) + if ($util.Long) + (message.local = $util.Long.fromValue(object.local)).unsigned = true; + else if (typeof object.local === "string") + message.local = parseInt(object.local, 10); + else if (typeof object.local === "number") + message.local = object.local; + else if (typeof object.local === "object") + message.local = new $util.LongBits(object.local.low >>> 0, object.local.high >>> 0).toNumber(true); + if (object.block != null) + if ($util.Long) + (message.block = $util.Long.fromValue(object.block)).unsigned = true; + else if (typeof object.block === "string") + message.block = parseInt(object.block, 10); + else if (typeof object.block === "number") + message.block = object.block; + else if (typeof object.block === "object") + message.block = new $util.LongBits(object.block.low >>> 0, object.block.high >>> 0).toNumber(true); + if (object.genesis != null) + if ($util.Long) + (message.genesis = $util.Long.fromValue(object.genesis)).unsigned = true; + else if (typeof object.genesis === "string") + message.genesis = parseInt(object.genesis, 10); + else if (typeof object.genesis === "number") + message.genesis = object.genesis; + else if (typeof object.genesis === "object") + message.genesis = new $util.LongBits(object.genesis.low >>> 0, object.genesis.high >>> 0).toNumber(true); + if (object.epoch != null) + message.epoch = object.epoch >>> 0; + return message; + }; + + /** + * Creates a plain object from a Time message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time + * @static + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time} message Time + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Time.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.local = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.local = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.block = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.block = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.genesis = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.genesis = options.longs === String ? "0" : 0; + object.epoch = 0; + } + if (message.local != null && message.hasOwnProperty("local")) + if (typeof message.local === "number") + object.local = options.longs === String ? String(message.local) : message.local; + else + object.local = options.longs === String ? $util.Long.prototype.toString.call(message.local) : options.longs === Number ? new $util.LongBits(message.local.low >>> 0, message.local.high >>> 0).toNumber(true) : message.local; + if (message.block != null && message.hasOwnProperty("block")) + if (typeof message.block === "number") + object.block = options.longs === String ? String(message.block) : message.block; + else + object.block = options.longs === String ? $util.Long.prototype.toString.call(message.block) : options.longs === Number ? new $util.LongBits(message.block.low >>> 0, message.block.high >>> 0).toNumber(true) : message.block; + if (message.genesis != null && message.hasOwnProperty("genesis")) + if (typeof message.genesis === "number") + object.genesis = options.longs === String ? String(message.genesis) : message.genesis; + else + object.genesis = options.longs === String ? $util.Long.prototype.toString.call(message.genesis) : options.longs === Number ? new $util.LongBits(message.genesis.low >>> 0, message.genesis.high >>> 0).toNumber(true) : message.genesis; + if (message.epoch != null && message.hasOwnProperty("epoch")) + object.epoch = message.epoch; + return object; + }; + + /** + * Converts this Time to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time + * @instance + * @returns {Object.} JSON object + */ + Time.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Time; + })(); + + GetStatusResponseV0.Node = (function() { + + /** + * Properties of a Node. + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0 + * @interface INode + * @property {Uint8Array|null} [id] Node id + * @property {Uint8Array|null} [proTxHash] Node proTxHash + */ + + /** + * Constructs a new Node. + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0 + * @classdesc Represents a Node. + * @implements INode + * @constructor + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.INode=} [properties] Properties to set + */ + function Node(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]]; + } + + /** + * Node id. + * @member {Uint8Array} id + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node + * @instance + */ + Node.prototype.id = $util.newBuffer([]); + + /** + * Node proTxHash. + * @member {Uint8Array} proTxHash + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node + * @instance + */ + Node.prototype.proTxHash = $util.newBuffer([]); + + /** + * Creates a new Node instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node + * @static + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.INode=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node} Node instance + */ + Node.create = function create(properties) { + return new Node(properties); + }; + + /** + * Encodes the specified Node message. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node + * @static + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.INode} message Node message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Node.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).bytes(message.id); + if (message.proTxHash != null && Object.hasOwnProperty.call(message, "proTxHash")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.proTxHash); + return writer; + }; + + /** + * Encodes the specified Node message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node + * @static + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.INode} message Node message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Node.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Node message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node} Node + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Node.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.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.bytes(); + break; + case 2: + message.proTxHash = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Node message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node} Node + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Node.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Node message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Node.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.id != null && message.hasOwnProperty("id")) + if (!(message.id && typeof message.id.length === "number" || $util.isString(message.id))) + return "id: buffer expected"; + if (message.proTxHash != null && message.hasOwnProperty("proTxHash")) + if (!(message.proTxHash && typeof message.proTxHash.length === "number" || $util.isString(message.proTxHash))) + return "proTxHash: buffer expected"; + return null; + }; + + /** + * Creates a Node message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node} Node + */ + Node.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node(); + if (object.id != null) + if (typeof object.id === "string") + $util.base64.decode(object.id, message.id = $util.newBuffer($util.base64.length(object.id)), 0); + else if (object.id.length >= 0) + message.id = object.id; + if (object.proTxHash != null) + if (typeof object.proTxHash === "string") + $util.base64.decode(object.proTxHash, message.proTxHash = $util.newBuffer($util.base64.length(object.proTxHash)), 0); + else if (object.proTxHash.length >= 0) + message.proTxHash = object.proTxHash; + return message; + }; + + /** + * Creates a plain object from a Node message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node + * @static + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node} message Node + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Node.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.id = ""; + else { + object.id = []; + if (options.bytes !== Array) + object.id = $util.newBuffer(object.id); + } + if (options.bytes === String) + object.proTxHash = ""; + else { + object.proTxHash = []; + if (options.bytes !== Array) + object.proTxHash = $util.newBuffer(object.proTxHash); + } + } + if (message.id != null && message.hasOwnProperty("id")) + object.id = options.bytes === String ? $util.base64.encode(message.id, 0, message.id.length) : options.bytes === Array ? Array.prototype.slice.call(message.id) : message.id; + if (message.proTxHash != null && message.hasOwnProperty("proTxHash")) + object.proTxHash = options.bytes === String ? $util.base64.encode(message.proTxHash, 0, message.proTxHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.proTxHash) : message.proTxHash; + return object; + }; + + /** + * Converts this Node to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node + * @instance + * @returns {Object.} JSON object + */ + Node.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Node; + })(); + + GetStatusResponseV0.Chain = (function() { + + /** + * Properties of a Chain. + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0 + * @interface IChain + * @property {boolean|null} [catchingUp] Chain catchingUp + * @property {Uint8Array|null} [latestBlockHash] Chain latestBlockHash + * @property {Uint8Array|null} [latestAppHash] Chain latestAppHash + * @property {number|Long|null} [latestBlockHeight] Chain latestBlockHeight + * @property {Uint8Array|null} [earliestBlockHash] Chain earliestBlockHash + * @property {Uint8Array|null} [earliestAppHash] Chain earliestAppHash + * @property {number|Long|null} [earliestBlockHeight] Chain earliestBlockHeight + * @property {number|Long|null} [maxPeerBlockHeight] Chain maxPeerBlockHeight + * @property {number|null} [coreChainLockedHeight] Chain coreChainLockedHeight + */ + + /** + * Constructs a new Chain. + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0 + * @classdesc Represents a Chain. + * @implements IChain + * @constructor + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.IChain=} [properties] Properties to set + */ + function Chain(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]]; + } + + /** + * Chain catchingUp. + * @member {boolean} catchingUp + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain + * @instance + */ + Chain.prototype.catchingUp = false; + + /** + * Chain latestBlockHash. + * @member {Uint8Array} latestBlockHash + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain + * @instance + */ + Chain.prototype.latestBlockHash = $util.newBuffer([]); + + /** + * Chain latestAppHash. + * @member {Uint8Array} latestAppHash + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain + * @instance + */ + Chain.prototype.latestAppHash = $util.newBuffer([]); + + /** + * Chain latestBlockHeight. + * @member {number|Long} latestBlockHeight + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain + * @instance + */ + Chain.prototype.latestBlockHeight = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Chain earliestBlockHash. + * @member {Uint8Array} earliestBlockHash + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain + * @instance + */ + Chain.prototype.earliestBlockHash = $util.newBuffer([]); + + /** + * Chain earliestAppHash. + * @member {Uint8Array} earliestAppHash + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain + * @instance + */ + Chain.prototype.earliestAppHash = $util.newBuffer([]); + + /** + * Chain earliestBlockHeight. + * @member {number|Long} earliestBlockHeight + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain + * @instance + */ + Chain.prototype.earliestBlockHeight = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Chain maxPeerBlockHeight. + * @member {number|Long} maxPeerBlockHeight + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain + * @instance + */ + Chain.prototype.maxPeerBlockHeight = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Chain coreChainLockedHeight. + * @member {number} coreChainLockedHeight + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain + * @instance + */ + Chain.prototype.coreChainLockedHeight = 0; + + /** + * Creates a new Chain instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain + * @static + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.IChain=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain} Chain instance + */ + Chain.create = function create(properties) { + return new Chain(properties); + }; + + /** + * Encodes the specified Chain message. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain + * @static + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.IChain} message Chain message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Chain.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.catchingUp != null && Object.hasOwnProperty.call(message, "catchingUp")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.catchingUp); + if (message.latestBlockHash != null && Object.hasOwnProperty.call(message, "latestBlockHash")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.latestBlockHash); + if (message.latestAppHash != null && Object.hasOwnProperty.call(message, "latestAppHash")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.latestAppHash); + if (message.latestBlockHeight != null && Object.hasOwnProperty.call(message, "latestBlockHeight")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.latestBlockHeight); + if (message.earliestBlockHash != null && Object.hasOwnProperty.call(message, "earliestBlockHash")) + writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.earliestBlockHash); + if (message.earliestAppHash != null && Object.hasOwnProperty.call(message, "earliestAppHash")) + writer.uint32(/* id 6, wireType 2 =*/50).bytes(message.earliestAppHash); + if (message.earliestBlockHeight != null && Object.hasOwnProperty.call(message, "earliestBlockHeight")) + writer.uint32(/* id 7, wireType 0 =*/56).uint64(message.earliestBlockHeight); + if (message.maxPeerBlockHeight != null && Object.hasOwnProperty.call(message, "maxPeerBlockHeight")) + writer.uint32(/* id 9, wireType 0 =*/72).uint64(message.maxPeerBlockHeight); + if (message.coreChainLockedHeight != null && Object.hasOwnProperty.call(message, "coreChainLockedHeight")) + writer.uint32(/* id 10, wireType 0 =*/80).uint32(message.coreChainLockedHeight); + return writer; + }; + + /** + * Encodes the specified Chain message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain + * @static + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.IChain} message Chain message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Chain.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Chain message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain} Chain + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Chain.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.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.catchingUp = reader.bool(); + break; + case 2: + message.latestBlockHash = reader.bytes(); + break; + case 3: + message.latestAppHash = reader.bytes(); + break; + case 4: + message.latestBlockHeight = reader.uint64(); + break; + case 5: + message.earliestBlockHash = reader.bytes(); + break; + case 6: + message.earliestAppHash = reader.bytes(); + break; + case 7: + message.earliestBlockHeight = reader.uint64(); + break; + case 9: + message.maxPeerBlockHeight = reader.uint64(); + break; + case 10: + message.coreChainLockedHeight = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Chain message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain} Chain + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Chain.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Chain message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Chain.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.catchingUp != null && message.hasOwnProperty("catchingUp")) + if (typeof message.catchingUp !== "boolean") + return "catchingUp: boolean expected"; + if (message.latestBlockHash != null && message.hasOwnProperty("latestBlockHash")) + if (!(message.latestBlockHash && typeof message.latestBlockHash.length === "number" || $util.isString(message.latestBlockHash))) + return "latestBlockHash: buffer expected"; + if (message.latestAppHash != null && message.hasOwnProperty("latestAppHash")) + if (!(message.latestAppHash && typeof message.latestAppHash.length === "number" || $util.isString(message.latestAppHash))) + return "latestAppHash: buffer expected"; + if (message.latestBlockHeight != null && message.hasOwnProperty("latestBlockHeight")) + if (!$util.isInteger(message.latestBlockHeight) && !(message.latestBlockHeight && $util.isInteger(message.latestBlockHeight.low) && $util.isInteger(message.latestBlockHeight.high))) + return "latestBlockHeight: integer|Long expected"; + if (message.earliestBlockHash != null && message.hasOwnProperty("earliestBlockHash")) + if (!(message.earliestBlockHash && typeof message.earliestBlockHash.length === "number" || $util.isString(message.earliestBlockHash))) + return "earliestBlockHash: buffer expected"; + if (message.earliestAppHash != null && message.hasOwnProperty("earliestAppHash")) + if (!(message.earliestAppHash && typeof message.earliestAppHash.length === "number" || $util.isString(message.earliestAppHash))) + return "earliestAppHash: buffer expected"; + if (message.earliestBlockHeight != null && message.hasOwnProperty("earliestBlockHeight")) + if (!$util.isInteger(message.earliestBlockHeight) && !(message.earliestBlockHeight && $util.isInteger(message.earliestBlockHeight.low) && $util.isInteger(message.earliestBlockHeight.high))) + return "earliestBlockHeight: integer|Long expected"; + if (message.maxPeerBlockHeight != null && message.hasOwnProperty("maxPeerBlockHeight")) + if (!$util.isInteger(message.maxPeerBlockHeight) && !(message.maxPeerBlockHeight && $util.isInteger(message.maxPeerBlockHeight.low) && $util.isInteger(message.maxPeerBlockHeight.high))) + return "maxPeerBlockHeight: integer|Long expected"; + if (message.coreChainLockedHeight != null && message.hasOwnProperty("coreChainLockedHeight")) + if (!$util.isInteger(message.coreChainLockedHeight)) + return "coreChainLockedHeight: integer expected"; + return null; + }; + + /** + * Creates a Chain message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain} Chain + */ + Chain.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain(); + if (object.catchingUp != null) + message.catchingUp = Boolean(object.catchingUp); + if (object.latestBlockHash != null) + if (typeof object.latestBlockHash === "string") + $util.base64.decode(object.latestBlockHash, message.latestBlockHash = $util.newBuffer($util.base64.length(object.latestBlockHash)), 0); + else if (object.latestBlockHash.length >= 0) + message.latestBlockHash = object.latestBlockHash; + if (object.latestAppHash != null) + if (typeof object.latestAppHash === "string") + $util.base64.decode(object.latestAppHash, message.latestAppHash = $util.newBuffer($util.base64.length(object.latestAppHash)), 0); + else if (object.latestAppHash.length >= 0) + message.latestAppHash = object.latestAppHash; + if (object.latestBlockHeight != null) + if ($util.Long) + (message.latestBlockHeight = $util.Long.fromValue(object.latestBlockHeight)).unsigned = true; + else if (typeof object.latestBlockHeight === "string") + message.latestBlockHeight = parseInt(object.latestBlockHeight, 10); + else if (typeof object.latestBlockHeight === "number") + message.latestBlockHeight = object.latestBlockHeight; + else if (typeof object.latestBlockHeight === "object") + message.latestBlockHeight = new $util.LongBits(object.latestBlockHeight.low >>> 0, object.latestBlockHeight.high >>> 0).toNumber(true); + if (object.earliestBlockHash != null) + if (typeof object.earliestBlockHash === "string") + $util.base64.decode(object.earliestBlockHash, message.earliestBlockHash = $util.newBuffer($util.base64.length(object.earliestBlockHash)), 0); + else if (object.earliestBlockHash.length >= 0) + message.earliestBlockHash = object.earliestBlockHash; + if (object.earliestAppHash != null) + if (typeof object.earliestAppHash === "string") + $util.base64.decode(object.earliestAppHash, message.earliestAppHash = $util.newBuffer($util.base64.length(object.earliestAppHash)), 0); + else if (object.earliestAppHash.length >= 0) + message.earliestAppHash = object.earliestAppHash; + if (object.earliestBlockHeight != null) + if ($util.Long) + (message.earliestBlockHeight = $util.Long.fromValue(object.earliestBlockHeight)).unsigned = true; + else if (typeof object.earliestBlockHeight === "string") + message.earliestBlockHeight = parseInt(object.earliestBlockHeight, 10); + else if (typeof object.earliestBlockHeight === "number") + message.earliestBlockHeight = object.earliestBlockHeight; + else if (typeof object.earliestBlockHeight === "object") + message.earliestBlockHeight = new $util.LongBits(object.earliestBlockHeight.low >>> 0, object.earliestBlockHeight.high >>> 0).toNumber(true); + if (object.maxPeerBlockHeight != null) + if ($util.Long) + (message.maxPeerBlockHeight = $util.Long.fromValue(object.maxPeerBlockHeight)).unsigned = true; + else if (typeof object.maxPeerBlockHeight === "string") + message.maxPeerBlockHeight = parseInt(object.maxPeerBlockHeight, 10); + else if (typeof object.maxPeerBlockHeight === "number") + message.maxPeerBlockHeight = object.maxPeerBlockHeight; + else if (typeof object.maxPeerBlockHeight === "object") + message.maxPeerBlockHeight = new $util.LongBits(object.maxPeerBlockHeight.low >>> 0, object.maxPeerBlockHeight.high >>> 0).toNumber(true); + if (object.coreChainLockedHeight != null) + message.coreChainLockedHeight = object.coreChainLockedHeight >>> 0; + return message; + }; + + /** + * Creates a plain object from a Chain message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain + * @static + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain} message Chain + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Chain.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.catchingUp = false; + if (options.bytes === String) + object.latestBlockHash = ""; + else { + object.latestBlockHash = []; + if (options.bytes !== Array) + object.latestBlockHash = $util.newBuffer(object.latestBlockHash); + } + if (options.bytes === String) + object.latestAppHash = ""; + else { + object.latestAppHash = []; + if (options.bytes !== Array) + object.latestAppHash = $util.newBuffer(object.latestAppHash); + } + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.latestBlockHeight = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.latestBlockHeight = options.longs === String ? "0" : 0; + if (options.bytes === String) + object.earliestBlockHash = ""; + else { + object.earliestBlockHash = []; + if (options.bytes !== Array) + object.earliestBlockHash = $util.newBuffer(object.earliestBlockHash); + } + if (options.bytes === String) + object.earliestAppHash = ""; + else { + object.earliestAppHash = []; + if (options.bytes !== Array) + object.earliestAppHash = $util.newBuffer(object.earliestAppHash); + } + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.earliestBlockHeight = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.earliestBlockHeight = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.maxPeerBlockHeight = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.maxPeerBlockHeight = options.longs === String ? "0" : 0; + object.coreChainLockedHeight = 0; + } + if (message.catchingUp != null && message.hasOwnProperty("catchingUp")) + object.catchingUp = message.catchingUp; + if (message.latestBlockHash != null && message.hasOwnProperty("latestBlockHash")) + object.latestBlockHash = options.bytes === String ? $util.base64.encode(message.latestBlockHash, 0, message.latestBlockHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.latestBlockHash) : message.latestBlockHash; + if (message.latestAppHash != null && message.hasOwnProperty("latestAppHash")) + object.latestAppHash = options.bytes === String ? $util.base64.encode(message.latestAppHash, 0, message.latestAppHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.latestAppHash) : message.latestAppHash; + if (message.latestBlockHeight != null && message.hasOwnProperty("latestBlockHeight")) + if (typeof message.latestBlockHeight === "number") + object.latestBlockHeight = options.longs === String ? String(message.latestBlockHeight) : message.latestBlockHeight; + else + object.latestBlockHeight = options.longs === String ? $util.Long.prototype.toString.call(message.latestBlockHeight) : options.longs === Number ? new $util.LongBits(message.latestBlockHeight.low >>> 0, message.latestBlockHeight.high >>> 0).toNumber(true) : message.latestBlockHeight; + if (message.earliestBlockHash != null && message.hasOwnProperty("earliestBlockHash")) + object.earliestBlockHash = options.bytes === String ? $util.base64.encode(message.earliestBlockHash, 0, message.earliestBlockHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.earliestBlockHash) : message.earliestBlockHash; + if (message.earliestAppHash != null && message.hasOwnProperty("earliestAppHash")) + object.earliestAppHash = options.bytes === String ? $util.base64.encode(message.earliestAppHash, 0, message.earliestAppHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.earliestAppHash) : message.earliestAppHash; + if (message.earliestBlockHeight != null && message.hasOwnProperty("earliestBlockHeight")) + if (typeof message.earliestBlockHeight === "number") + object.earliestBlockHeight = options.longs === String ? String(message.earliestBlockHeight) : message.earliestBlockHeight; + else + object.earliestBlockHeight = options.longs === String ? $util.Long.prototype.toString.call(message.earliestBlockHeight) : options.longs === Number ? new $util.LongBits(message.earliestBlockHeight.low >>> 0, message.earliestBlockHeight.high >>> 0).toNumber(true) : message.earliestBlockHeight; + if (message.maxPeerBlockHeight != null && message.hasOwnProperty("maxPeerBlockHeight")) + if (typeof message.maxPeerBlockHeight === "number") + object.maxPeerBlockHeight = options.longs === String ? String(message.maxPeerBlockHeight) : message.maxPeerBlockHeight; + else + object.maxPeerBlockHeight = options.longs === String ? $util.Long.prototype.toString.call(message.maxPeerBlockHeight) : options.longs === Number ? new $util.LongBits(message.maxPeerBlockHeight.low >>> 0, message.maxPeerBlockHeight.high >>> 0).toNumber(true) : message.maxPeerBlockHeight; + if (message.coreChainLockedHeight != null && message.hasOwnProperty("coreChainLockedHeight")) + object.coreChainLockedHeight = message.coreChainLockedHeight; + return object; + }; + + /** + * Converts this Chain to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain + * @instance + * @returns {Object.} JSON object + */ + Chain.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Chain; + })(); + + GetStatusResponseV0.Network = (function() { + + /** + * Properties of a Network. + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0 + * @interface INetwork + * @property {string|null} [chainId] Network chainId + * @property {number|null} [peersCount] Network peersCount + * @property {boolean|null} [listening] Network listening + */ + + /** + * Constructs a new Network. + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0 + * @classdesc Represents a Network. + * @implements INetwork + * @constructor + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.INetwork=} [properties] Properties to set + */ + function Network(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]]; + } + + /** + * Network chainId. + * @member {string} chainId + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network + * @instance + */ + Network.prototype.chainId = ""; + + /** + * Network peersCount. + * @member {number} peersCount + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network + * @instance + */ + Network.prototype.peersCount = 0; + + /** + * Network listening. + * @member {boolean} listening + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network + * @instance + */ + Network.prototype.listening = false; + + /** + * Creates a new Network instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network + * @static + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.INetwork=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network} Network instance + */ + Network.create = function create(properties) { + return new Network(properties); + }; + + /** + * Encodes the specified Network message. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network + * @static + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.INetwork} message Network message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Network.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.chainId != null && Object.hasOwnProperty.call(message, "chainId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.chainId); + if (message.peersCount != null && Object.hasOwnProperty.call(message, "peersCount")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.peersCount); + if (message.listening != null && Object.hasOwnProperty.call(message, "listening")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.listening); + return writer; + }; + + /** + * Encodes the specified Network message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network + * @static + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.INetwork} message Network message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Network.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Network message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network} Network + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Network.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.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.chainId = reader.string(); + break; + case 2: + message.peersCount = reader.uint32(); + break; + case 3: + message.listening = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Network message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network} Network + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Network.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Network message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Network.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.chainId != null && message.hasOwnProperty("chainId")) + if (!$util.isString(message.chainId)) + return "chainId: string expected"; + if (message.peersCount != null && message.hasOwnProperty("peersCount")) + if (!$util.isInteger(message.peersCount)) + return "peersCount: integer expected"; + if (message.listening != null && message.hasOwnProperty("listening")) + if (typeof message.listening !== "boolean") + return "listening: boolean expected"; + return null; + }; + + /** + * Creates a Network message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network} Network + */ + Network.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network(); + if (object.chainId != null) + message.chainId = String(object.chainId); + if (object.peersCount != null) + message.peersCount = object.peersCount >>> 0; + if (object.listening != null) + message.listening = Boolean(object.listening); + return message; + }; + + /** + * Creates a plain object from a Network message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network + * @static + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network} message Network + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Network.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.chainId = ""; + object.peersCount = 0; + object.listening = false; + } + if (message.chainId != null && message.hasOwnProperty("chainId")) + object.chainId = message.chainId; + if (message.peersCount != null && message.hasOwnProperty("peersCount")) + object.peersCount = message.peersCount; + if (message.listening != null && message.hasOwnProperty("listening")) + object.listening = message.listening; + return object; + }; + + /** + * Converts this Network to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network + * @instance + * @returns {Object.} JSON object + */ + Network.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Network; + })(); + + GetStatusResponseV0.StateSync = (function() { + + /** + * Properties of a StateSync. + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0 + * @interface IStateSync + * @property {number|Long|null} [totalSyncedTime] StateSync totalSyncedTime + * @property {number|Long|null} [remainingTime] StateSync remainingTime + * @property {number|null} [totalSnapshots] StateSync totalSnapshots + * @property {number|Long|null} [chunkProcessAvgTime] StateSync chunkProcessAvgTime + * @property {number|Long|null} [snapshotHeight] StateSync snapshotHeight + * @property {number|Long|null} [snapshotChunksCount] StateSync snapshotChunksCount + * @property {number|Long|null} [backfilledBlocks] StateSync backfilledBlocks + * @property {number|Long|null} [backfillBlocksTotal] StateSync backfillBlocksTotal + */ + + /** + * Constructs a new StateSync. + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0 + * @classdesc Represents a StateSync. + * @implements IStateSync + * @constructor + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.IStateSync=} [properties] Properties to set + */ + function StateSync(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]]; + } + + /** + * StateSync totalSyncedTime. + * @member {number|Long} totalSyncedTime + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync + * @instance + */ + StateSync.prototype.totalSyncedTime = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * StateSync remainingTime. + * @member {number|Long} remainingTime + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync + * @instance + */ + StateSync.prototype.remainingTime = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * StateSync totalSnapshots. + * @member {number} totalSnapshots + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync + * @instance + */ + StateSync.prototype.totalSnapshots = 0; + + /** + * StateSync chunkProcessAvgTime. + * @member {number|Long} chunkProcessAvgTime + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync + * @instance + */ + StateSync.prototype.chunkProcessAvgTime = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * StateSync snapshotHeight. + * @member {number|Long} snapshotHeight + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync + * @instance + */ + StateSync.prototype.snapshotHeight = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * StateSync snapshotChunksCount. + * @member {number|Long} snapshotChunksCount + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync + * @instance + */ + StateSync.prototype.snapshotChunksCount = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * StateSync backfilledBlocks. + * @member {number|Long} backfilledBlocks + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync + * @instance + */ + StateSync.prototype.backfilledBlocks = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * StateSync backfillBlocksTotal. + * @member {number|Long} backfillBlocksTotal + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync + * @instance + */ + StateSync.prototype.backfillBlocksTotal = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new StateSync instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync + * @static + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.IStateSync=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync} StateSync instance + */ + StateSync.create = function create(properties) { + return new StateSync(properties); + }; + + /** + * Encodes the specified StateSync message. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync + * @static + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.IStateSync} message StateSync message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StateSync.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.totalSyncedTime != null && Object.hasOwnProperty.call(message, "totalSyncedTime")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.totalSyncedTime); + if (message.remainingTime != null && Object.hasOwnProperty.call(message, "remainingTime")) + writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.remainingTime); + if (message.totalSnapshots != null && Object.hasOwnProperty.call(message, "totalSnapshots")) + writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.totalSnapshots); + if (message.chunkProcessAvgTime != null && Object.hasOwnProperty.call(message, "chunkProcessAvgTime")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.chunkProcessAvgTime); + if (message.snapshotHeight != null && Object.hasOwnProperty.call(message, "snapshotHeight")) + writer.uint32(/* id 5, wireType 0 =*/40).uint64(message.snapshotHeight); + if (message.snapshotChunksCount != null && Object.hasOwnProperty.call(message, "snapshotChunksCount")) + writer.uint32(/* id 6, wireType 0 =*/48).uint64(message.snapshotChunksCount); + if (message.backfilledBlocks != null && Object.hasOwnProperty.call(message, "backfilledBlocks")) + writer.uint32(/* id 7, wireType 0 =*/56).uint64(message.backfilledBlocks); + if (message.backfillBlocksTotal != null && Object.hasOwnProperty.call(message, "backfillBlocksTotal")) + writer.uint32(/* id 8, wireType 0 =*/64).uint64(message.backfillBlocksTotal); + return writer; + }; + + /** + * Encodes the specified StateSync message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync + * @static + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.IStateSync} message StateSync message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StateSync.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StateSync message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync} StateSync + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StateSync.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.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.totalSyncedTime = reader.uint64(); + break; + case 2: + message.remainingTime = reader.uint64(); + break; + case 3: + message.totalSnapshots = reader.uint32(); + break; + case 4: + message.chunkProcessAvgTime = reader.uint64(); + break; + case 5: + message.snapshotHeight = reader.uint64(); + break; + case 6: + message.snapshotChunksCount = reader.uint64(); + break; + case 7: + message.backfilledBlocks = reader.uint64(); + break; + case 8: + message.backfillBlocksTotal = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StateSync message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync} StateSync + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StateSync.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StateSync message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StateSync.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.totalSyncedTime != null && message.hasOwnProperty("totalSyncedTime")) + if (!$util.isInteger(message.totalSyncedTime) && !(message.totalSyncedTime && $util.isInteger(message.totalSyncedTime.low) && $util.isInteger(message.totalSyncedTime.high))) + return "totalSyncedTime: integer|Long expected"; + if (message.remainingTime != null && message.hasOwnProperty("remainingTime")) + if (!$util.isInteger(message.remainingTime) && !(message.remainingTime && $util.isInteger(message.remainingTime.low) && $util.isInteger(message.remainingTime.high))) + return "remainingTime: integer|Long expected"; + if (message.totalSnapshots != null && message.hasOwnProperty("totalSnapshots")) + if (!$util.isInteger(message.totalSnapshots)) + return "totalSnapshots: integer expected"; + if (message.chunkProcessAvgTime != null && message.hasOwnProperty("chunkProcessAvgTime")) + if (!$util.isInteger(message.chunkProcessAvgTime) && !(message.chunkProcessAvgTime && $util.isInteger(message.chunkProcessAvgTime.low) && $util.isInteger(message.chunkProcessAvgTime.high))) + return "chunkProcessAvgTime: integer|Long expected"; + if (message.snapshotHeight != null && message.hasOwnProperty("snapshotHeight")) + if (!$util.isInteger(message.snapshotHeight) && !(message.snapshotHeight && $util.isInteger(message.snapshotHeight.low) && $util.isInteger(message.snapshotHeight.high))) + return "snapshotHeight: integer|Long expected"; + if (message.snapshotChunksCount != null && message.hasOwnProperty("snapshotChunksCount")) + if (!$util.isInteger(message.snapshotChunksCount) && !(message.snapshotChunksCount && $util.isInteger(message.snapshotChunksCount.low) && $util.isInteger(message.snapshotChunksCount.high))) + return "snapshotChunksCount: integer|Long expected"; + if (message.backfilledBlocks != null && message.hasOwnProperty("backfilledBlocks")) + if (!$util.isInteger(message.backfilledBlocks) && !(message.backfilledBlocks && $util.isInteger(message.backfilledBlocks.low) && $util.isInteger(message.backfilledBlocks.high))) + return "backfilledBlocks: integer|Long expected"; + if (message.backfillBlocksTotal != null && message.hasOwnProperty("backfillBlocksTotal")) + if (!$util.isInteger(message.backfillBlocksTotal) && !(message.backfillBlocksTotal && $util.isInteger(message.backfillBlocksTotal.low) && $util.isInteger(message.backfillBlocksTotal.high))) + return "backfillBlocksTotal: integer|Long expected"; + return null; + }; + + /** + * Creates a StateSync message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync} StateSync + */ + StateSync.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync(); + if (object.totalSyncedTime != null) + if ($util.Long) + (message.totalSyncedTime = $util.Long.fromValue(object.totalSyncedTime)).unsigned = true; + else if (typeof object.totalSyncedTime === "string") + message.totalSyncedTime = parseInt(object.totalSyncedTime, 10); + else if (typeof object.totalSyncedTime === "number") + message.totalSyncedTime = object.totalSyncedTime; + else if (typeof object.totalSyncedTime === "object") + message.totalSyncedTime = new $util.LongBits(object.totalSyncedTime.low >>> 0, object.totalSyncedTime.high >>> 0).toNumber(true); + if (object.remainingTime != null) + if ($util.Long) + (message.remainingTime = $util.Long.fromValue(object.remainingTime)).unsigned = true; + else if (typeof object.remainingTime === "string") + message.remainingTime = parseInt(object.remainingTime, 10); + else if (typeof object.remainingTime === "number") + message.remainingTime = object.remainingTime; + else if (typeof object.remainingTime === "object") + message.remainingTime = new $util.LongBits(object.remainingTime.low >>> 0, object.remainingTime.high >>> 0).toNumber(true); + if (object.totalSnapshots != null) + message.totalSnapshots = object.totalSnapshots >>> 0; + if (object.chunkProcessAvgTime != null) + if ($util.Long) + (message.chunkProcessAvgTime = $util.Long.fromValue(object.chunkProcessAvgTime)).unsigned = true; + else if (typeof object.chunkProcessAvgTime === "string") + message.chunkProcessAvgTime = parseInt(object.chunkProcessAvgTime, 10); + else if (typeof object.chunkProcessAvgTime === "number") + message.chunkProcessAvgTime = object.chunkProcessAvgTime; + else if (typeof object.chunkProcessAvgTime === "object") + message.chunkProcessAvgTime = new $util.LongBits(object.chunkProcessAvgTime.low >>> 0, object.chunkProcessAvgTime.high >>> 0).toNumber(true); + if (object.snapshotHeight != null) + if ($util.Long) + (message.snapshotHeight = $util.Long.fromValue(object.snapshotHeight)).unsigned = true; + else if (typeof object.snapshotHeight === "string") + message.snapshotHeight = parseInt(object.snapshotHeight, 10); + else if (typeof object.snapshotHeight === "number") + message.snapshotHeight = object.snapshotHeight; + else if (typeof object.snapshotHeight === "object") + message.snapshotHeight = new $util.LongBits(object.snapshotHeight.low >>> 0, object.snapshotHeight.high >>> 0).toNumber(true); + if (object.snapshotChunksCount != null) + if ($util.Long) + (message.snapshotChunksCount = $util.Long.fromValue(object.snapshotChunksCount)).unsigned = true; + else if (typeof object.snapshotChunksCount === "string") + message.snapshotChunksCount = parseInt(object.snapshotChunksCount, 10); + else if (typeof object.snapshotChunksCount === "number") + message.snapshotChunksCount = object.snapshotChunksCount; + else if (typeof object.snapshotChunksCount === "object") + message.snapshotChunksCount = new $util.LongBits(object.snapshotChunksCount.low >>> 0, object.snapshotChunksCount.high >>> 0).toNumber(true); + if (object.backfilledBlocks != null) + if ($util.Long) + (message.backfilledBlocks = $util.Long.fromValue(object.backfilledBlocks)).unsigned = true; + else if (typeof object.backfilledBlocks === "string") + message.backfilledBlocks = parseInt(object.backfilledBlocks, 10); + else if (typeof object.backfilledBlocks === "number") + message.backfilledBlocks = object.backfilledBlocks; + else if (typeof object.backfilledBlocks === "object") + message.backfilledBlocks = new $util.LongBits(object.backfilledBlocks.low >>> 0, object.backfilledBlocks.high >>> 0).toNumber(true); + if (object.backfillBlocksTotal != null) + if ($util.Long) + (message.backfillBlocksTotal = $util.Long.fromValue(object.backfillBlocksTotal)).unsigned = true; + else if (typeof object.backfillBlocksTotal === "string") + message.backfillBlocksTotal = parseInt(object.backfillBlocksTotal, 10); + else if (typeof object.backfillBlocksTotal === "number") + message.backfillBlocksTotal = object.backfillBlocksTotal; + else if (typeof object.backfillBlocksTotal === "object") + message.backfillBlocksTotal = new $util.LongBits(object.backfillBlocksTotal.low >>> 0, object.backfillBlocksTotal.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from a StateSync message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync + * @static + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync} message StateSync + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StateSync.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.totalSyncedTime = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.totalSyncedTime = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.remainingTime = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.remainingTime = options.longs === String ? "0" : 0; + object.totalSnapshots = 0; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.chunkProcessAvgTime = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.chunkProcessAvgTime = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.snapshotHeight = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.snapshotHeight = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.snapshotChunksCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.snapshotChunksCount = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.backfilledBlocks = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.backfilledBlocks = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.backfillBlocksTotal = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.backfillBlocksTotal = options.longs === String ? "0" : 0; + } + if (message.totalSyncedTime != null && message.hasOwnProperty("totalSyncedTime")) + if (typeof message.totalSyncedTime === "number") + object.totalSyncedTime = options.longs === String ? String(message.totalSyncedTime) : message.totalSyncedTime; + else + object.totalSyncedTime = options.longs === String ? $util.Long.prototype.toString.call(message.totalSyncedTime) : options.longs === Number ? new $util.LongBits(message.totalSyncedTime.low >>> 0, message.totalSyncedTime.high >>> 0).toNumber(true) : message.totalSyncedTime; + if (message.remainingTime != null && message.hasOwnProperty("remainingTime")) + if (typeof message.remainingTime === "number") + object.remainingTime = options.longs === String ? String(message.remainingTime) : message.remainingTime; + else + object.remainingTime = options.longs === String ? $util.Long.prototype.toString.call(message.remainingTime) : options.longs === Number ? new $util.LongBits(message.remainingTime.low >>> 0, message.remainingTime.high >>> 0).toNumber(true) : message.remainingTime; + if (message.totalSnapshots != null && message.hasOwnProperty("totalSnapshots")) + object.totalSnapshots = message.totalSnapshots; + if (message.chunkProcessAvgTime != null && message.hasOwnProperty("chunkProcessAvgTime")) + if (typeof message.chunkProcessAvgTime === "number") + object.chunkProcessAvgTime = options.longs === String ? String(message.chunkProcessAvgTime) : message.chunkProcessAvgTime; + else + object.chunkProcessAvgTime = options.longs === String ? $util.Long.prototype.toString.call(message.chunkProcessAvgTime) : options.longs === Number ? new $util.LongBits(message.chunkProcessAvgTime.low >>> 0, message.chunkProcessAvgTime.high >>> 0).toNumber(true) : message.chunkProcessAvgTime; + if (message.snapshotHeight != null && message.hasOwnProperty("snapshotHeight")) + if (typeof message.snapshotHeight === "number") + object.snapshotHeight = options.longs === String ? String(message.snapshotHeight) : message.snapshotHeight; + else + object.snapshotHeight = options.longs === String ? $util.Long.prototype.toString.call(message.snapshotHeight) : options.longs === Number ? new $util.LongBits(message.snapshotHeight.low >>> 0, message.snapshotHeight.high >>> 0).toNumber(true) : message.snapshotHeight; + if (message.snapshotChunksCount != null && message.hasOwnProperty("snapshotChunksCount")) + if (typeof message.snapshotChunksCount === "number") + object.snapshotChunksCount = options.longs === String ? String(message.snapshotChunksCount) : message.snapshotChunksCount; + else + object.snapshotChunksCount = options.longs === String ? $util.Long.prototype.toString.call(message.snapshotChunksCount) : options.longs === Number ? new $util.LongBits(message.snapshotChunksCount.low >>> 0, message.snapshotChunksCount.high >>> 0).toNumber(true) : message.snapshotChunksCount; + if (message.backfilledBlocks != null && message.hasOwnProperty("backfilledBlocks")) + if (typeof message.backfilledBlocks === "number") + object.backfilledBlocks = options.longs === String ? String(message.backfilledBlocks) : message.backfilledBlocks; + else + object.backfilledBlocks = options.longs === String ? $util.Long.prototype.toString.call(message.backfilledBlocks) : options.longs === Number ? new $util.LongBits(message.backfilledBlocks.low >>> 0, message.backfilledBlocks.high >>> 0).toNumber(true) : message.backfilledBlocks; + if (message.backfillBlocksTotal != null && message.hasOwnProperty("backfillBlocksTotal")) + if (typeof message.backfillBlocksTotal === "number") + object.backfillBlocksTotal = options.longs === String ? String(message.backfillBlocksTotal) : message.backfillBlocksTotal; + else + object.backfillBlocksTotal = options.longs === String ? $util.Long.prototype.toString.call(message.backfillBlocksTotal) : options.longs === Number ? new $util.LongBits(message.backfillBlocksTotal.low >>> 0, message.backfillBlocksTotal.high >>> 0).toNumber(true) : message.backfillBlocksTotal; + return object; + }; + + /** + * Converts this StateSync to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync + * @instance + * @returns {Object.} JSON object + */ + StateSync.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return StateSync; + })(); + + return GetStatusResponseV0; + })(); + + return GetStatusResponse; + })(); + + v0.GetCurrentQuorumsInfoRequest = (function() { + + /** + * Properties of a GetCurrentQuorumsInfoRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetCurrentQuorumsInfoRequest + * @property {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.IGetCurrentQuorumsInfoRequestV0|null} [v0] GetCurrentQuorumsInfoRequest v0 + */ + + /** + * Constructs a new GetCurrentQuorumsInfoRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetCurrentQuorumsInfoRequest. + * @implements IGetCurrentQuorumsInfoRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IGetCurrentQuorumsInfoRequest=} [properties] Properties to set + */ + function GetCurrentQuorumsInfoRequest(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]]; + } + + /** + * GetCurrentQuorumsInfoRequest v0. + * @member {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.IGetCurrentQuorumsInfoRequestV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest + * @instance + */ + GetCurrentQuorumsInfoRequest.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetCurrentQuorumsInfoRequest version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest + * @instance + */ + Object.defineProperty(GetCurrentQuorumsInfoRequest.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetCurrentQuorumsInfoRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetCurrentQuorumsInfoRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest} GetCurrentQuorumsInfoRequest instance + */ + GetCurrentQuorumsInfoRequest.create = function create(properties) { + return new GetCurrentQuorumsInfoRequest(properties); + }; + + /** + * Encodes the specified GetCurrentQuorumsInfoRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetCurrentQuorumsInfoRequest} message GetCurrentQuorumsInfoRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetCurrentQuorumsInfoRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetCurrentQuorumsInfoRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetCurrentQuorumsInfoRequest} message GetCurrentQuorumsInfoRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetCurrentQuorumsInfoRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetCurrentQuorumsInfoRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest} GetCurrentQuorumsInfoRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetCurrentQuorumsInfoRequest.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.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetCurrentQuorumsInfoRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest} GetCurrentQuorumsInfoRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetCurrentQuorumsInfoRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetCurrentQuorumsInfoRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetCurrentQuorumsInfoRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetCurrentQuorumsInfoRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest} GetCurrentQuorumsInfoRequest + */ + GetCurrentQuorumsInfoRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetCurrentQuorumsInfoRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest + * @static + * @param {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest} message GetCurrentQuorumsInfoRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetCurrentQuorumsInfoRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetCurrentQuorumsInfoRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest + * @instance + * @returns {Object.} JSON object + */ + GetCurrentQuorumsInfoRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0 = (function() { + + /** + * Properties of a GetCurrentQuorumsInfoRequestV0. + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest + * @interface IGetCurrentQuorumsInfoRequestV0 + */ + + /** + * Constructs a new GetCurrentQuorumsInfoRequestV0. + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest + * @classdesc Represents a GetCurrentQuorumsInfoRequestV0. + * @implements IGetCurrentQuorumsInfoRequestV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.IGetCurrentQuorumsInfoRequestV0=} [properties] Properties to set + */ + function GetCurrentQuorumsInfoRequestV0(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]]; + } + + /** + * Creates a new GetCurrentQuorumsInfoRequestV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.IGetCurrentQuorumsInfoRequestV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0} GetCurrentQuorumsInfoRequestV0 instance + */ + GetCurrentQuorumsInfoRequestV0.create = function create(properties) { + return new GetCurrentQuorumsInfoRequestV0(properties); + }; + + /** + * Encodes the specified GetCurrentQuorumsInfoRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.IGetCurrentQuorumsInfoRequestV0} message GetCurrentQuorumsInfoRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetCurrentQuorumsInfoRequestV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified GetCurrentQuorumsInfoRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.IGetCurrentQuorumsInfoRequestV0} message GetCurrentQuorumsInfoRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetCurrentQuorumsInfoRequestV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetCurrentQuorumsInfoRequestV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0} GetCurrentQuorumsInfoRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetCurrentQuorumsInfoRequestV0.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.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetCurrentQuorumsInfoRequestV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0} GetCurrentQuorumsInfoRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetCurrentQuorumsInfoRequestV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetCurrentQuorumsInfoRequestV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetCurrentQuorumsInfoRequestV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a GetCurrentQuorumsInfoRequestV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0} GetCurrentQuorumsInfoRequestV0 + */ + GetCurrentQuorumsInfoRequestV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0) + return object; + return new $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0(); + }; + + /** + * Creates a plain object from a GetCurrentQuorumsInfoRequestV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0} message GetCurrentQuorumsInfoRequestV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetCurrentQuorumsInfoRequestV0.toObject = function toObject() { + return {}; + }; + + /** + * Converts this GetCurrentQuorumsInfoRequestV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0 + * @instance + * @returns {Object.} JSON object + */ + GetCurrentQuorumsInfoRequestV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetCurrentQuorumsInfoRequestV0; + })(); + + return GetCurrentQuorumsInfoRequest; + })(); + + v0.GetCurrentQuorumsInfoResponse = (function() { + + /** + * Properties of a GetCurrentQuorumsInfoResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetCurrentQuorumsInfoResponse + * @property {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.IGetCurrentQuorumsInfoResponseV0|null} [v0] GetCurrentQuorumsInfoResponse v0 + */ + + /** + * Constructs a new GetCurrentQuorumsInfoResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetCurrentQuorumsInfoResponse. + * @implements IGetCurrentQuorumsInfoResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IGetCurrentQuorumsInfoResponse=} [properties] Properties to set + */ + function GetCurrentQuorumsInfoResponse(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]]; + } + + /** + * GetCurrentQuorumsInfoResponse v0. + * @member {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.IGetCurrentQuorumsInfoResponseV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse + * @instance + */ + GetCurrentQuorumsInfoResponse.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetCurrentQuorumsInfoResponse version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse + * @instance + */ + Object.defineProperty(GetCurrentQuorumsInfoResponse.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetCurrentQuorumsInfoResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetCurrentQuorumsInfoResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse} GetCurrentQuorumsInfoResponse instance + */ + GetCurrentQuorumsInfoResponse.create = function create(properties) { + return new GetCurrentQuorumsInfoResponse(properties); + }; + + /** + * Encodes the specified GetCurrentQuorumsInfoResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetCurrentQuorumsInfoResponse} message GetCurrentQuorumsInfoResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetCurrentQuorumsInfoResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetCurrentQuorumsInfoResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetCurrentQuorumsInfoResponse} message GetCurrentQuorumsInfoResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetCurrentQuorumsInfoResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetCurrentQuorumsInfoResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse} GetCurrentQuorumsInfoResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetCurrentQuorumsInfoResponse.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.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetCurrentQuorumsInfoResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse} GetCurrentQuorumsInfoResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetCurrentQuorumsInfoResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetCurrentQuorumsInfoResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetCurrentQuorumsInfoResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetCurrentQuorumsInfoResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse} GetCurrentQuorumsInfoResponse + */ + GetCurrentQuorumsInfoResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetCurrentQuorumsInfoResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse + * @static + * @param {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse} message GetCurrentQuorumsInfoResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetCurrentQuorumsInfoResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetCurrentQuorumsInfoResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse + * @instance + * @returns {Object.} JSON object + */ + GetCurrentQuorumsInfoResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetCurrentQuorumsInfoResponse.ValidatorV0 = (function() { + + /** + * Properties of a ValidatorV0. + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse + * @interface IValidatorV0 + * @property {Uint8Array|null} [proTxHash] ValidatorV0 proTxHash + * @property {string|null} [nodeIp] ValidatorV0 nodeIp + * @property {boolean|null} [isBanned] ValidatorV0 isBanned + */ + + /** + * Constructs a new ValidatorV0. + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse + * @classdesc Represents a ValidatorV0. + * @implements IValidatorV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.IValidatorV0=} [properties] Properties to set + */ + function ValidatorV0(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]]; + } + + /** + * ValidatorV0 proTxHash. + * @member {Uint8Array} proTxHash + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0 + * @instance + */ + ValidatorV0.prototype.proTxHash = $util.newBuffer([]); + + /** + * ValidatorV0 nodeIp. + * @member {string} nodeIp + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0 + * @instance + */ + ValidatorV0.prototype.nodeIp = ""; + + /** + * ValidatorV0 isBanned. + * @member {boolean} isBanned + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0 + * @instance + */ + ValidatorV0.prototype.isBanned = false; + + /** + * Creates a new ValidatorV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0 + * @static + * @param {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.IValidatorV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0} ValidatorV0 instance + */ + ValidatorV0.create = function create(properties) { + return new ValidatorV0(properties); + }; + + /** + * Encodes the specified ValidatorV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0 + * @static + * @param {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.IValidatorV0} message ValidatorV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ValidatorV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.proTxHash != null && Object.hasOwnProperty.call(message, "proTxHash")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.proTxHash); + if (message.nodeIp != null && Object.hasOwnProperty.call(message, "nodeIp")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nodeIp); + if (message.isBanned != null && Object.hasOwnProperty.call(message, "isBanned")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.isBanned); + return writer; + }; + + /** + * Encodes the specified ValidatorV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0 + * @static + * @param {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.IValidatorV0} message ValidatorV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ValidatorV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ValidatorV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0} ValidatorV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ValidatorV0.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.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proTxHash = reader.bytes(); + break; + case 2: + message.nodeIp = reader.string(); + break; + case 3: + message.isBanned = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ValidatorV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0} ValidatorV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ValidatorV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ValidatorV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ValidatorV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.proTxHash != null && message.hasOwnProperty("proTxHash")) + if (!(message.proTxHash && typeof message.proTxHash.length === "number" || $util.isString(message.proTxHash))) + return "proTxHash: buffer expected"; + if (message.nodeIp != null && message.hasOwnProperty("nodeIp")) + if (!$util.isString(message.nodeIp)) + return "nodeIp: string expected"; + if (message.isBanned != null && message.hasOwnProperty("isBanned")) + if (typeof message.isBanned !== "boolean") + return "isBanned: boolean expected"; + return null; + }; + + /** + * Creates a ValidatorV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0} ValidatorV0 + */ + ValidatorV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0(); + if (object.proTxHash != null) + if (typeof object.proTxHash === "string") + $util.base64.decode(object.proTxHash, message.proTxHash = $util.newBuffer($util.base64.length(object.proTxHash)), 0); + else if (object.proTxHash.length >= 0) + message.proTxHash = object.proTxHash; + if (object.nodeIp != null) + message.nodeIp = String(object.nodeIp); + if (object.isBanned != null) + message.isBanned = Boolean(object.isBanned); + return message; + }; + + /** + * Creates a plain object from a ValidatorV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0 + * @static + * @param {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0} message ValidatorV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ValidatorV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.proTxHash = ""; + else { + object.proTxHash = []; + if (options.bytes !== Array) + object.proTxHash = $util.newBuffer(object.proTxHash); + } + object.nodeIp = ""; + object.isBanned = false; + } + if (message.proTxHash != null && message.hasOwnProperty("proTxHash")) + object.proTxHash = options.bytes === String ? $util.base64.encode(message.proTxHash, 0, message.proTxHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.proTxHash) : message.proTxHash; + if (message.nodeIp != null && message.hasOwnProperty("nodeIp")) + object.nodeIp = message.nodeIp; + if (message.isBanned != null && message.hasOwnProperty("isBanned")) + object.isBanned = message.isBanned; + return object; + }; + + /** + * Converts this ValidatorV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0 + * @instance + * @returns {Object.} JSON object + */ + ValidatorV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ValidatorV0; + })(); + + GetCurrentQuorumsInfoResponse.ValidatorSetV0 = (function() { + + /** + * Properties of a ValidatorSetV0. + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse + * @interface IValidatorSetV0 + * @property {Uint8Array|null} [quorumHash] ValidatorSetV0 quorumHash + * @property {number|null} [coreHeight] ValidatorSetV0 coreHeight + * @property {Array.|null} [members] ValidatorSetV0 members + * @property {Uint8Array|null} [thresholdPublicKey] ValidatorSetV0 thresholdPublicKey + */ + + /** + * Constructs a new ValidatorSetV0. + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse + * @classdesc Represents a ValidatorSetV0. + * @implements IValidatorSetV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.IValidatorSetV0=} [properties] Properties to set + */ + function ValidatorSetV0(properties) { + this.members = []; + 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]]; + } + + /** + * ValidatorSetV0 quorumHash. + * @member {Uint8Array} quorumHash + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0 + * @instance + */ + ValidatorSetV0.prototype.quorumHash = $util.newBuffer([]); + + /** + * ValidatorSetV0 coreHeight. + * @member {number} coreHeight + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0 + * @instance + */ + ValidatorSetV0.prototype.coreHeight = 0; + + /** + * ValidatorSetV0 members. + * @member {Array.} members + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0 + * @instance + */ + ValidatorSetV0.prototype.members = $util.emptyArray; + + /** + * ValidatorSetV0 thresholdPublicKey. + * @member {Uint8Array} thresholdPublicKey + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0 + * @instance + */ + ValidatorSetV0.prototype.thresholdPublicKey = $util.newBuffer([]); + + /** + * Creates a new ValidatorSetV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0 + * @static + * @param {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.IValidatorSetV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0} ValidatorSetV0 instance + */ + ValidatorSetV0.create = function create(properties) { + return new ValidatorSetV0(properties); + }; + + /** + * Encodes the specified ValidatorSetV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0 + * @static + * @param {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.IValidatorSetV0} message ValidatorSetV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ValidatorSetV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.quorumHash != null && Object.hasOwnProperty.call(message, "quorumHash")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.quorumHash); + if (message.coreHeight != null && Object.hasOwnProperty.call(message, "coreHeight")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.coreHeight); + if (message.members != null && message.members.length) + for (var i = 0; i < message.members.length; ++i) + $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0.encode(message.members[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.thresholdPublicKey != null && Object.hasOwnProperty.call(message, "thresholdPublicKey")) + writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.thresholdPublicKey); + return writer; + }; + + /** + * Encodes the specified ValidatorSetV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0 + * @static + * @param {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.IValidatorSetV0} message ValidatorSetV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ValidatorSetV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ValidatorSetV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0} ValidatorSetV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ValidatorSetV0.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.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.quorumHash = reader.bytes(); + break; + case 2: + message.coreHeight = reader.uint32(); + break; + case 3: + if (!(message.members && message.members.length)) + message.members = []; + message.members.push($root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0.decode(reader, reader.uint32())); + break; + case 4: + message.thresholdPublicKey = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ValidatorSetV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0} ValidatorSetV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ValidatorSetV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ValidatorSetV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ValidatorSetV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.quorumHash != null && message.hasOwnProperty("quorumHash")) + if (!(message.quorumHash && typeof message.quorumHash.length === "number" || $util.isString(message.quorumHash))) + return "quorumHash: buffer expected"; + if (message.coreHeight != null && message.hasOwnProperty("coreHeight")) + if (!$util.isInteger(message.coreHeight)) + return "coreHeight: integer expected"; + if (message.members != null && message.hasOwnProperty("members")) { + if (!Array.isArray(message.members)) + return "members: array expected"; + for (var i = 0; i < message.members.length; ++i) { + var error = $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0.verify(message.members[i]); + if (error) + return "members." + error; + } + } + if (message.thresholdPublicKey != null && message.hasOwnProperty("thresholdPublicKey")) + if (!(message.thresholdPublicKey && typeof message.thresholdPublicKey.length === "number" || $util.isString(message.thresholdPublicKey))) + return "thresholdPublicKey: buffer expected"; + return null; + }; + + /** + * Creates a ValidatorSetV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0} ValidatorSetV0 + */ + ValidatorSetV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0(); + if (object.quorumHash != null) + if (typeof object.quorumHash === "string") + $util.base64.decode(object.quorumHash, message.quorumHash = $util.newBuffer($util.base64.length(object.quorumHash)), 0); + else if (object.quorumHash.length >= 0) + message.quorumHash = object.quorumHash; + if (object.coreHeight != null) + message.coreHeight = object.coreHeight >>> 0; + if (object.members) { + if (!Array.isArray(object.members)) + throw TypeError(".org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0.members: array expected"); + message.members = []; + for (var i = 0; i < object.members.length; ++i) { + if (typeof object.members[i] !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0.members: object expected"); + message.members[i] = $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0.fromObject(object.members[i]); + } + } + if (object.thresholdPublicKey != null) + if (typeof object.thresholdPublicKey === "string") + $util.base64.decode(object.thresholdPublicKey, message.thresholdPublicKey = $util.newBuffer($util.base64.length(object.thresholdPublicKey)), 0); + else if (object.thresholdPublicKey.length >= 0) + message.thresholdPublicKey = object.thresholdPublicKey; + return message; + }; + + /** + * Creates a plain object from a ValidatorSetV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0 + * @static + * @param {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0} message ValidatorSetV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ValidatorSetV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.members = []; + if (options.defaults) { + if (options.bytes === String) + object.quorumHash = ""; + else { + object.quorumHash = []; + if (options.bytes !== Array) + object.quorumHash = $util.newBuffer(object.quorumHash); + } + object.coreHeight = 0; + if (options.bytes === String) + object.thresholdPublicKey = ""; + else { + object.thresholdPublicKey = []; + if (options.bytes !== Array) + object.thresholdPublicKey = $util.newBuffer(object.thresholdPublicKey); + } + } + if (message.quorumHash != null && message.hasOwnProperty("quorumHash")) + object.quorumHash = options.bytes === String ? $util.base64.encode(message.quorumHash, 0, message.quorumHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.quorumHash) : message.quorumHash; + if (message.coreHeight != null && message.hasOwnProperty("coreHeight")) + object.coreHeight = message.coreHeight; + if (message.members && message.members.length) { + object.members = []; + for (var j = 0; j < message.members.length; ++j) + object.members[j] = $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0.toObject(message.members[j], options); + } + if (message.thresholdPublicKey != null && message.hasOwnProperty("thresholdPublicKey")) + object.thresholdPublicKey = options.bytes === String ? $util.base64.encode(message.thresholdPublicKey, 0, message.thresholdPublicKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.thresholdPublicKey) : message.thresholdPublicKey; + return object; + }; + + /** + * Converts this ValidatorSetV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0 + * @instance + * @returns {Object.} JSON object + */ + ValidatorSetV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ValidatorSetV0; + })(); + + GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0 = (function() { + + /** + * Properties of a GetCurrentQuorumsInfoResponseV0. + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse + * @interface IGetCurrentQuorumsInfoResponseV0 + * @property {Array.|null} [quorumHashes] GetCurrentQuorumsInfoResponseV0 quorumHashes + * @property {Uint8Array|null} [currentQuorumHash] GetCurrentQuorumsInfoResponseV0 currentQuorumHash + * @property {Array.|null} [validatorSets] GetCurrentQuorumsInfoResponseV0 validatorSets + * @property {Uint8Array|null} [lastBlockProposer] GetCurrentQuorumsInfoResponseV0 lastBlockProposer + * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetCurrentQuorumsInfoResponseV0 metadata + */ + + /** + * Constructs a new GetCurrentQuorumsInfoResponseV0. + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse + * @classdesc Represents a GetCurrentQuorumsInfoResponseV0. + * @implements IGetCurrentQuorumsInfoResponseV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.IGetCurrentQuorumsInfoResponseV0=} [properties] Properties to set + */ + function GetCurrentQuorumsInfoResponseV0(properties) { + this.quorumHashes = []; + this.validatorSets = []; + 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]]; + } + + /** + * GetCurrentQuorumsInfoResponseV0 quorumHashes. + * @member {Array.} quorumHashes + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0 + * @instance + */ + GetCurrentQuorumsInfoResponseV0.prototype.quorumHashes = $util.emptyArray; + + /** + * GetCurrentQuorumsInfoResponseV0 currentQuorumHash. + * @member {Uint8Array} currentQuorumHash + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0 + * @instance + */ + GetCurrentQuorumsInfoResponseV0.prototype.currentQuorumHash = $util.newBuffer([]); + + /** + * GetCurrentQuorumsInfoResponseV0 validatorSets. + * @member {Array.} validatorSets + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0 + * @instance + */ + GetCurrentQuorumsInfoResponseV0.prototype.validatorSets = $util.emptyArray; + + /** + * GetCurrentQuorumsInfoResponseV0 lastBlockProposer. + * @member {Uint8Array} lastBlockProposer + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0 + * @instance + */ + GetCurrentQuorumsInfoResponseV0.prototype.lastBlockProposer = $util.newBuffer([]); + + /** + * GetCurrentQuorumsInfoResponseV0 metadata. + * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0 + * @instance + */ + GetCurrentQuorumsInfoResponseV0.prototype.metadata = null; + + /** + * Creates a new GetCurrentQuorumsInfoResponseV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.IGetCurrentQuorumsInfoResponseV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0} GetCurrentQuorumsInfoResponseV0 instance + */ + GetCurrentQuorumsInfoResponseV0.create = function create(properties) { + return new GetCurrentQuorumsInfoResponseV0(properties); + }; + + /** + * Encodes the specified GetCurrentQuorumsInfoResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.IGetCurrentQuorumsInfoResponseV0} message GetCurrentQuorumsInfoResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetCurrentQuorumsInfoResponseV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.quorumHashes != null && message.quorumHashes.length) + for (var i = 0; i < message.quorumHashes.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.quorumHashes[i]); + if (message.currentQuorumHash != null && Object.hasOwnProperty.call(message, "currentQuorumHash")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.currentQuorumHash); + if (message.validatorSets != null && message.validatorSets.length) + for (var i = 0; i < message.validatorSets.length; ++i) + $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0.encode(message.validatorSets[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.lastBlockProposer != null && Object.hasOwnProperty.call(message, "lastBlockProposer")) + writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.lastBlockProposer); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetCurrentQuorumsInfoResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.IGetCurrentQuorumsInfoResponseV0} message GetCurrentQuorumsInfoResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetCurrentQuorumsInfoResponseV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetCurrentQuorumsInfoResponseV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0} GetCurrentQuorumsInfoResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetCurrentQuorumsInfoResponseV0.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.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.quorumHashes && message.quorumHashes.length)) + message.quorumHashes = []; + message.quorumHashes.push(reader.bytes()); + break; + case 2: + message.currentQuorumHash = reader.bytes(); + break; + case 3: + if (!(message.validatorSets && message.validatorSets.length)) + message.validatorSets = []; + message.validatorSets.push($root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0.decode(reader, reader.uint32())); + break; + case 4: + message.lastBlockProposer = reader.bytes(); + break; + case 5: + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetCurrentQuorumsInfoResponseV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0} GetCurrentQuorumsInfoResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetCurrentQuorumsInfoResponseV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetCurrentQuorumsInfoResponseV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetCurrentQuorumsInfoResponseV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.quorumHashes != null && message.hasOwnProperty("quorumHashes")) { + if (!Array.isArray(message.quorumHashes)) + return "quorumHashes: array expected"; + for (var i = 0; i < message.quorumHashes.length; ++i) + if (!(message.quorumHashes[i] && typeof message.quorumHashes[i].length === "number" || $util.isString(message.quorumHashes[i]))) + return "quorumHashes: buffer[] expected"; + } + if (message.currentQuorumHash != null && message.hasOwnProperty("currentQuorumHash")) + if (!(message.currentQuorumHash && typeof message.currentQuorumHash.length === "number" || $util.isString(message.currentQuorumHash))) + return "currentQuorumHash: buffer expected"; + if (message.validatorSets != null && message.hasOwnProperty("validatorSets")) { + if (!Array.isArray(message.validatorSets)) + return "validatorSets: array expected"; + for (var i = 0; i < message.validatorSets.length; ++i) { + var error = $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0.verify(message.validatorSets[i]); + if (error) + return "validatorSets." + error; + } + } + if (message.lastBlockProposer != null && message.hasOwnProperty("lastBlockProposer")) + if (!(message.lastBlockProposer && typeof message.lastBlockProposer.length === "number" || $util.isString(message.lastBlockProposer))) + return "lastBlockProposer: buffer expected"; + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a GetCurrentQuorumsInfoResponseV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0} GetCurrentQuorumsInfoResponseV0 + */ + GetCurrentQuorumsInfoResponseV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0(); + if (object.quorumHashes) { + if (!Array.isArray(object.quorumHashes)) + throw TypeError(".org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.quorumHashes: array expected"); + message.quorumHashes = []; + for (var i = 0; i < object.quorumHashes.length; ++i) + if (typeof object.quorumHashes[i] === "string") + $util.base64.decode(object.quorumHashes[i], message.quorumHashes[i] = $util.newBuffer($util.base64.length(object.quorumHashes[i])), 0); + else if (object.quorumHashes[i].length >= 0) + message.quorumHashes[i] = object.quorumHashes[i]; + } + if (object.currentQuorumHash != null) + if (typeof object.currentQuorumHash === "string") + $util.base64.decode(object.currentQuorumHash, message.currentQuorumHash = $util.newBuffer($util.base64.length(object.currentQuorumHash)), 0); + else if (object.currentQuorumHash.length >= 0) + message.currentQuorumHash = object.currentQuorumHash; + if (object.validatorSets) { + if (!Array.isArray(object.validatorSets)) + throw TypeError(".org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.validatorSets: array expected"); + message.validatorSets = []; + for (var i = 0; i < object.validatorSets.length; ++i) { + if (typeof object.validatorSets[i] !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.validatorSets: object expected"); + message.validatorSets[i] = $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0.fromObject(object.validatorSets[i]); + } + } + if (object.lastBlockProposer != null) + if (typeof object.lastBlockProposer === "string") + $util.base64.decode(object.lastBlockProposer, message.lastBlockProposer = $util.newBuffer($util.base64.length(object.lastBlockProposer)), 0); + else if (object.lastBlockProposer.length >= 0) + message.lastBlockProposer = object.lastBlockProposer; + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.metadata: object expected"); + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a GetCurrentQuorumsInfoResponseV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0} message GetCurrentQuorumsInfoResponseV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetCurrentQuorumsInfoResponseV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.quorumHashes = []; + object.validatorSets = []; + } + if (options.defaults) { + if (options.bytes === String) + object.currentQuorumHash = ""; + else { + object.currentQuorumHash = []; + if (options.bytes !== Array) + object.currentQuorumHash = $util.newBuffer(object.currentQuorumHash); + } + if (options.bytes === String) + object.lastBlockProposer = ""; + else { + object.lastBlockProposer = []; + if (options.bytes !== Array) + object.lastBlockProposer = $util.newBuffer(object.lastBlockProposer); + } + object.metadata = null; + } + if (message.quorumHashes && message.quorumHashes.length) { + object.quorumHashes = []; + for (var j = 0; j < message.quorumHashes.length; ++j) + object.quorumHashes[j] = options.bytes === String ? $util.base64.encode(message.quorumHashes[j], 0, message.quorumHashes[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.quorumHashes[j]) : message.quorumHashes[j]; + } + if (message.currentQuorumHash != null && message.hasOwnProperty("currentQuorumHash")) + object.currentQuorumHash = options.bytes === String ? $util.base64.encode(message.currentQuorumHash, 0, message.currentQuorumHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.currentQuorumHash) : message.currentQuorumHash; + if (message.validatorSets && message.validatorSets.length) { + object.validatorSets = []; + for (var j = 0; j < message.validatorSets.length; ++j) + object.validatorSets[j] = $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0.toObject(message.validatorSets[j], options); + } + if (message.lastBlockProposer != null && message.hasOwnProperty("lastBlockProposer")) + object.lastBlockProposer = options.bytes === String ? $util.base64.encode(message.lastBlockProposer, 0, message.lastBlockProposer.length) : options.bytes === Array ? Array.prototype.slice.call(message.lastBlockProposer) : message.lastBlockProposer; + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this GetCurrentQuorumsInfoResponseV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0 + * @instance + * @returns {Object.} JSON object + */ + GetCurrentQuorumsInfoResponseV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetCurrentQuorumsInfoResponseV0; + })(); + + return GetCurrentQuorumsInfoResponse; + })(); + + v0.GetIdentityTokenBalancesRequest = (function() { + + /** + * Properties of a GetIdentityTokenBalancesRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetIdentityTokenBalancesRequest + * @property {org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.IGetIdentityTokenBalancesRequestV0|null} [v0] GetIdentityTokenBalancesRequest v0 + */ + + /** + * Constructs a new GetIdentityTokenBalancesRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetIdentityTokenBalancesRequest. + * @implements IGetIdentityTokenBalancesRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IGetIdentityTokenBalancesRequest=} [properties] Properties to set + */ + function GetIdentityTokenBalancesRequest(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]]; + } + + /** + * GetIdentityTokenBalancesRequest v0. + * @member {org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.IGetIdentityTokenBalancesRequestV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest + * @instance + */ + GetIdentityTokenBalancesRequest.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetIdentityTokenBalancesRequest version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest + * @instance + */ + Object.defineProperty(GetIdentityTokenBalancesRequest.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetIdentityTokenBalancesRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityTokenBalancesRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest} GetIdentityTokenBalancesRequest instance + */ + GetIdentityTokenBalancesRequest.create = function create(properties) { + return new GetIdentityTokenBalancesRequest(properties); + }; + + /** + * Encodes the specified GetIdentityTokenBalancesRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityTokenBalancesRequest} message GetIdentityTokenBalancesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityTokenBalancesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetIdentityTokenBalancesRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityTokenBalancesRequest} message GetIdentityTokenBalancesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityTokenBalancesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentityTokenBalancesRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest} GetIdentityTokenBalancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityTokenBalancesRequest.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.org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentityTokenBalancesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest} GetIdentityTokenBalancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityTokenBalancesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentityTokenBalancesRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentityTokenBalancesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetIdentityTokenBalancesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest} GetIdentityTokenBalancesRequest + */ + GetIdentityTokenBalancesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetIdentityTokenBalancesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest} message GetIdentityTokenBalancesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentityTokenBalancesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetIdentityTokenBalancesRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest + * @instance + * @returns {Object.} JSON object + */ + GetIdentityTokenBalancesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0 = (function() { + + /** + * Properties of a GetIdentityTokenBalancesRequestV0. + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest + * @interface IGetIdentityTokenBalancesRequestV0 + * @property {Uint8Array|null} [identityId] GetIdentityTokenBalancesRequestV0 identityId + * @property {Array.|null} [tokenIds] GetIdentityTokenBalancesRequestV0 tokenIds + * @property {boolean|null} [prove] GetIdentityTokenBalancesRequestV0 prove + */ + + /** + * Constructs a new GetIdentityTokenBalancesRequestV0. + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest + * @classdesc Represents a GetIdentityTokenBalancesRequestV0. + * @implements IGetIdentityTokenBalancesRequestV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.IGetIdentityTokenBalancesRequestV0=} [properties] Properties to set + */ + function GetIdentityTokenBalancesRequestV0(properties) { + this.tokenIds = []; + 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]]; + } + + /** + * GetIdentityTokenBalancesRequestV0 identityId. + * @member {Uint8Array} identityId + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0 + * @instance + */ + GetIdentityTokenBalancesRequestV0.prototype.identityId = $util.newBuffer([]); + + /** + * GetIdentityTokenBalancesRequestV0 tokenIds. + * @member {Array.} tokenIds + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0 + * @instance + */ + GetIdentityTokenBalancesRequestV0.prototype.tokenIds = $util.emptyArray; + + /** + * GetIdentityTokenBalancesRequestV0 prove. + * @member {boolean} prove + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0 + * @instance + */ + GetIdentityTokenBalancesRequestV0.prototype.prove = false; + + /** + * Creates a new GetIdentityTokenBalancesRequestV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.IGetIdentityTokenBalancesRequestV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0} GetIdentityTokenBalancesRequestV0 instance + */ + GetIdentityTokenBalancesRequestV0.create = function create(properties) { + return new GetIdentityTokenBalancesRequestV0(properties); + }; + + /** + * Encodes the specified GetIdentityTokenBalancesRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.IGetIdentityTokenBalancesRequestV0} message GetIdentityTokenBalancesRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityTokenBalancesRequestV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.identityId != null && Object.hasOwnProperty.call(message, "identityId")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.identityId); + if (message.tokenIds != null && message.tokenIds.length) + for (var i = 0; i < message.tokenIds.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.tokenIds[i]); + if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.prove); + return writer; + }; + + /** + * Encodes the specified GetIdentityTokenBalancesRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.IGetIdentityTokenBalancesRequestV0} message GetIdentityTokenBalancesRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityTokenBalancesRequestV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentityTokenBalancesRequestV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0} GetIdentityTokenBalancesRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityTokenBalancesRequestV0.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.org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.identityId = reader.bytes(); + break; + case 2: + if (!(message.tokenIds && message.tokenIds.length)) + message.tokenIds = []; + message.tokenIds.push(reader.bytes()); + break; + case 3: + message.prove = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentityTokenBalancesRequestV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0} GetIdentityTokenBalancesRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityTokenBalancesRequestV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentityTokenBalancesRequestV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentityTokenBalancesRequestV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.identityId != null && message.hasOwnProperty("identityId")) + if (!(message.identityId && typeof message.identityId.length === "number" || $util.isString(message.identityId))) + return "identityId: buffer expected"; + if (message.tokenIds != null && message.hasOwnProperty("tokenIds")) { + if (!Array.isArray(message.tokenIds)) + return "tokenIds: array expected"; + for (var i = 0; i < message.tokenIds.length; ++i) + if (!(message.tokenIds[i] && typeof message.tokenIds[i].length === "number" || $util.isString(message.tokenIds[i]))) + return "tokenIds: buffer[] expected"; + } + if (message.prove != null && message.hasOwnProperty("prove")) + if (typeof message.prove !== "boolean") + return "prove: boolean expected"; + return null; + }; + + /** + * Creates a GetIdentityTokenBalancesRequestV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0} GetIdentityTokenBalancesRequestV0 + */ + GetIdentityTokenBalancesRequestV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0(); + if (object.identityId != null) + if (typeof object.identityId === "string") + $util.base64.decode(object.identityId, message.identityId = $util.newBuffer($util.base64.length(object.identityId)), 0); + else if (object.identityId.length >= 0) + message.identityId = object.identityId; + if (object.tokenIds) { + if (!Array.isArray(object.tokenIds)) + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0.tokenIds: array expected"); + message.tokenIds = []; + for (var i = 0; i < object.tokenIds.length; ++i) + if (typeof object.tokenIds[i] === "string") + $util.base64.decode(object.tokenIds[i], message.tokenIds[i] = $util.newBuffer($util.base64.length(object.tokenIds[i])), 0); + else if (object.tokenIds[i].length >= 0) + message.tokenIds[i] = object.tokenIds[i]; + } + if (object.prove != null) + message.prove = Boolean(object.prove); + return message; + }; + + /** + * Creates a plain object from a GetIdentityTokenBalancesRequestV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0} message GetIdentityTokenBalancesRequestV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentityTokenBalancesRequestV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.tokenIds = []; + if (options.defaults) { + if (options.bytes === String) + object.identityId = ""; + else { + object.identityId = []; + if (options.bytes !== Array) + object.identityId = $util.newBuffer(object.identityId); + } + object.prove = false; + } + if (message.identityId != null && message.hasOwnProperty("identityId")) + object.identityId = options.bytes === String ? $util.base64.encode(message.identityId, 0, message.identityId.length) : options.bytes === Array ? Array.prototype.slice.call(message.identityId) : message.identityId; + if (message.tokenIds && message.tokenIds.length) { + object.tokenIds = []; + for (var j = 0; j < message.tokenIds.length; ++j) + object.tokenIds[j] = options.bytes === String ? $util.base64.encode(message.tokenIds[j], 0, message.tokenIds[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.tokenIds[j]) : message.tokenIds[j]; + } + if (message.prove != null && message.hasOwnProperty("prove")) + object.prove = message.prove; + return object; + }; + + /** + * Converts this GetIdentityTokenBalancesRequestV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0 + * @instance + * @returns {Object.} JSON object + */ + GetIdentityTokenBalancesRequestV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetIdentityTokenBalancesRequestV0; + })(); + + return GetIdentityTokenBalancesRequest; + })(); + + v0.GetIdentityTokenBalancesResponse = (function() { + + /** + * Properties of a GetIdentityTokenBalancesResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetIdentityTokenBalancesResponse + * @property {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.IGetIdentityTokenBalancesResponseV0|null} [v0] GetIdentityTokenBalancesResponse v0 + */ + + /** + * Constructs a new GetIdentityTokenBalancesResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetIdentityTokenBalancesResponse. + * @implements IGetIdentityTokenBalancesResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IGetIdentityTokenBalancesResponse=} [properties] Properties to set + */ + function GetIdentityTokenBalancesResponse(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]]; + } + + /** + * GetIdentityTokenBalancesResponse v0. + * @member {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.IGetIdentityTokenBalancesResponseV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse + * @instance + */ + GetIdentityTokenBalancesResponse.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetIdentityTokenBalancesResponse version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse + * @instance + */ + Object.defineProperty(GetIdentityTokenBalancesResponse.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetIdentityTokenBalancesResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityTokenBalancesResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse} GetIdentityTokenBalancesResponse instance + */ + GetIdentityTokenBalancesResponse.create = function create(properties) { + return new GetIdentityTokenBalancesResponse(properties); + }; + + /** + * Encodes the specified GetIdentityTokenBalancesResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityTokenBalancesResponse} message GetIdentityTokenBalancesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityTokenBalancesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetIdentityTokenBalancesResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityTokenBalancesResponse} message GetIdentityTokenBalancesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityTokenBalancesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentityTokenBalancesResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse} GetIdentityTokenBalancesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityTokenBalancesResponse.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.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentityTokenBalancesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse} GetIdentityTokenBalancesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityTokenBalancesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentityTokenBalancesResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentityTokenBalancesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetIdentityTokenBalancesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse} GetIdentityTokenBalancesResponse + */ + GetIdentityTokenBalancesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetIdentityTokenBalancesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse} message GetIdentityTokenBalancesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentityTokenBalancesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetIdentityTokenBalancesResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse + * @instance + * @returns {Object.} JSON object + */ + GetIdentityTokenBalancesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0 = (function() { + + /** + * Properties of a GetIdentityTokenBalancesResponseV0. + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse + * @interface IGetIdentityTokenBalancesResponseV0 + * @property {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.ITokenBalances|null} [tokenBalances] GetIdentityTokenBalancesResponseV0 tokenBalances + * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetIdentityTokenBalancesResponseV0 proof + * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetIdentityTokenBalancesResponseV0 metadata + */ + + /** + * Constructs a new GetIdentityTokenBalancesResponseV0. + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse + * @classdesc Represents a GetIdentityTokenBalancesResponseV0. + * @implements IGetIdentityTokenBalancesResponseV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.IGetIdentityTokenBalancesResponseV0=} [properties] Properties to set + */ + function GetIdentityTokenBalancesResponseV0(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]]; + } + + /** + * GetIdentityTokenBalancesResponseV0 tokenBalances. + * @member {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.ITokenBalances|null|undefined} tokenBalances + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0 + * @instance + */ + GetIdentityTokenBalancesResponseV0.prototype.tokenBalances = null; + + /** + * GetIdentityTokenBalancesResponseV0 proof. + * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0 + * @instance + */ + GetIdentityTokenBalancesResponseV0.prototype.proof = null; + + /** + * GetIdentityTokenBalancesResponseV0 metadata. + * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0 + * @instance + */ + GetIdentityTokenBalancesResponseV0.prototype.metadata = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetIdentityTokenBalancesResponseV0 result. + * @member {"tokenBalances"|"proof"|undefined} result + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0 + * @instance + */ + Object.defineProperty(GetIdentityTokenBalancesResponseV0.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["tokenBalances", "proof"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetIdentityTokenBalancesResponseV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.IGetIdentityTokenBalancesResponseV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0} GetIdentityTokenBalancesResponseV0 instance + */ + GetIdentityTokenBalancesResponseV0.create = function create(properties) { + return new GetIdentityTokenBalancesResponseV0(properties); + }; + + /** + * Encodes the specified GetIdentityTokenBalancesResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.IGetIdentityTokenBalancesResponseV0} message GetIdentityTokenBalancesResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityTokenBalancesResponseV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tokenBalances != null && Object.hasOwnProperty.call(message, "tokenBalances")) + $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances.encode(message.tokenBalances, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetIdentityTokenBalancesResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.IGetIdentityTokenBalancesResponseV0} message GetIdentityTokenBalancesResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityTokenBalancesResponseV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentityTokenBalancesResponseV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0} GetIdentityTokenBalancesResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityTokenBalancesResponseV0.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.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tokenBalances = $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances.decode(reader, reader.uint32()); + break; + case 2: + message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); + break; + case 3: + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentityTokenBalancesResponseV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0} GetIdentityTokenBalancesResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityTokenBalancesResponseV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentityTokenBalancesResponseV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentityTokenBalancesResponseV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.tokenBalances != null && message.hasOwnProperty("tokenBalances")) { + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances.verify(message.tokenBalances); + if (error) + return "tokenBalances." + error; + } + } + if (message.proof != null && message.hasOwnProperty("proof")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); + if (error) + return "proof." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a GetIdentityTokenBalancesResponseV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0} GetIdentityTokenBalancesResponseV0 + */ + GetIdentityTokenBalancesResponseV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0(); + if (object.tokenBalances != null) { + if (typeof object.tokenBalances !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.tokenBalances: object expected"); + message.tokenBalances = $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances.fromObject(object.tokenBalances); + } + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.proof: object expected"); + message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.metadata: object expected"); + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a GetIdentityTokenBalancesResponseV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0} message GetIdentityTokenBalancesResponseV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentityTokenBalancesResponseV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.metadata = null; + if (message.tokenBalances != null && message.hasOwnProperty("tokenBalances")) { + object.tokenBalances = $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances.toObject(message.tokenBalances, options); + if (options.oneofs) + object.result = "tokenBalances"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); + if (options.oneofs) + object.result = "proof"; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this GetIdentityTokenBalancesResponseV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0 + * @instance + * @returns {Object.} JSON object + */ + GetIdentityTokenBalancesResponseV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetIdentityTokenBalancesResponseV0.TokenBalanceEntry = (function() { + + /** + * Properties of a TokenBalanceEntry. + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0 + * @interface ITokenBalanceEntry + * @property {Uint8Array|null} [tokenId] TokenBalanceEntry tokenId + * @property {number|Long|null} [balance] TokenBalanceEntry balance + */ + + /** + * Constructs a new TokenBalanceEntry. + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0 + * @classdesc Represents a TokenBalanceEntry. + * @implements ITokenBalanceEntry + * @constructor + * @param {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.ITokenBalanceEntry=} [properties] Properties to set + */ + function TokenBalanceEntry(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]]; + } + + /** + * TokenBalanceEntry tokenId. + * @member {Uint8Array} tokenId + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntry + * @instance + */ + TokenBalanceEntry.prototype.tokenId = $util.newBuffer([]); + + /** + * TokenBalanceEntry balance. + * @member {number|Long} balance + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntry + * @instance + */ + TokenBalanceEntry.prototype.balance = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new TokenBalanceEntry instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntry + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.ITokenBalanceEntry=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntry} TokenBalanceEntry instance + */ + TokenBalanceEntry.create = function create(properties) { + return new TokenBalanceEntry(properties); + }; + + /** + * Encodes the specified TokenBalanceEntry message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntry.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntry + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.ITokenBalanceEntry} message TokenBalanceEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenBalanceEntry.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tokenId != null && Object.hasOwnProperty.call(message, "tokenId")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.tokenId); + if (message.balance != null && Object.hasOwnProperty.call(message, "balance")) + writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.balance); + return writer; + }; + + /** + * Encodes the specified TokenBalanceEntry message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntry.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntry + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.ITokenBalanceEntry} message TokenBalanceEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenBalanceEntry.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TokenBalanceEntry message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntry} TokenBalanceEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenBalanceEntry.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.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntry(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tokenId = reader.bytes(); + break; + case 2: + message.balance = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TokenBalanceEntry message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntry} TokenBalanceEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenBalanceEntry.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TokenBalanceEntry message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntry + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TokenBalanceEntry.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tokenId != null && message.hasOwnProperty("tokenId")) + if (!(message.tokenId && typeof message.tokenId.length === "number" || $util.isString(message.tokenId))) + return "tokenId: buffer expected"; + if (message.balance != null && message.hasOwnProperty("balance")) + if (!$util.isInteger(message.balance) && !(message.balance && $util.isInteger(message.balance.low) && $util.isInteger(message.balance.high))) + return "balance: integer|Long expected"; + return null; + }; + + /** + * Creates a TokenBalanceEntry message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntry + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntry} TokenBalanceEntry + */ + TokenBalanceEntry.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntry) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntry(); + if (object.tokenId != null) + if (typeof object.tokenId === "string") + $util.base64.decode(object.tokenId, message.tokenId = $util.newBuffer($util.base64.length(object.tokenId)), 0); + else if (object.tokenId.length >= 0) + message.tokenId = object.tokenId; + if (object.balance != null) + if ($util.Long) + (message.balance = $util.Long.fromValue(object.balance)).unsigned = true; + else if (typeof object.balance === "string") + message.balance = parseInt(object.balance, 10); + else if (typeof object.balance === "number") + message.balance = object.balance; + else if (typeof object.balance === "object") + message.balance = new $util.LongBits(object.balance.low >>> 0, object.balance.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from a TokenBalanceEntry message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntry + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntry} message TokenBalanceEntry + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TokenBalanceEntry.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.tokenId = ""; + else { + object.tokenId = []; + if (options.bytes !== Array) + object.tokenId = $util.newBuffer(object.tokenId); + } + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.balance = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.balance = options.longs === String ? "0" : 0; + } + if (message.tokenId != null && message.hasOwnProperty("tokenId")) + object.tokenId = options.bytes === String ? $util.base64.encode(message.tokenId, 0, message.tokenId.length) : options.bytes === Array ? Array.prototype.slice.call(message.tokenId) : message.tokenId; + if (message.balance != null && message.hasOwnProperty("balance")) + if (typeof message.balance === "number") + object.balance = options.longs === String ? String(message.balance) : message.balance; + else + object.balance = options.longs === String ? $util.Long.prototype.toString.call(message.balance) : options.longs === Number ? new $util.LongBits(message.balance.low >>> 0, message.balance.high >>> 0).toNumber(true) : message.balance; + return object; + }; + + /** + * Converts this TokenBalanceEntry to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntry + * @instance + * @returns {Object.} JSON object + */ + TokenBalanceEntry.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TokenBalanceEntry; + })(); + + GetIdentityTokenBalancesResponseV0.TokenBalances = (function() { + + /** + * Properties of a TokenBalances. + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0 + * @interface ITokenBalances + * @property {Array.|null} [tokenBalances] TokenBalances tokenBalances + */ + + /** + * Constructs a new TokenBalances. + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0 + * @classdesc Represents a TokenBalances. + * @implements ITokenBalances + * @constructor + * @param {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.ITokenBalances=} [properties] Properties to set + */ + function TokenBalances(properties) { + this.tokenBalances = []; + 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]]; + } + + /** + * TokenBalances tokenBalances. + * @member {Array.} tokenBalances + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances + * @instance + */ + TokenBalances.prototype.tokenBalances = $util.emptyArray; + + /** + * Creates a new TokenBalances instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.ITokenBalances=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances} TokenBalances instance + */ + TokenBalances.create = function create(properties) { + return new TokenBalances(properties); + }; + + /** + * Encodes the specified TokenBalances message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.ITokenBalances} message TokenBalances message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenBalances.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tokenBalances != null && message.tokenBalances.length) + for (var i = 0; i < message.tokenBalances.length; ++i) + $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntry.encode(message.tokenBalances[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TokenBalances message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.ITokenBalances} message TokenBalances message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenBalances.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TokenBalances message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances} TokenBalances + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenBalances.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.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.tokenBalances && message.tokenBalances.length)) + message.tokenBalances = []; + message.tokenBalances.push($root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntry.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TokenBalances message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances} TokenBalances + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenBalances.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TokenBalances message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TokenBalances.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tokenBalances != null && message.hasOwnProperty("tokenBalances")) { + if (!Array.isArray(message.tokenBalances)) + return "tokenBalances: array expected"; + for (var i = 0; i < message.tokenBalances.length; ++i) { + var error = $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntry.verify(message.tokenBalances[i]); + if (error) + return "tokenBalances." + error; + } + } + return null; + }; + + /** + * Creates a TokenBalances message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances} TokenBalances + */ + TokenBalances.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances(); + if (object.tokenBalances) { + if (!Array.isArray(object.tokenBalances)) + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances.tokenBalances: array expected"); + message.tokenBalances = []; + for (var i = 0; i < object.tokenBalances.length; ++i) { + if (typeof object.tokenBalances[i] !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances.tokenBalances: object expected"); + message.tokenBalances[i] = $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntry.fromObject(object.tokenBalances[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a TokenBalances message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances} message TokenBalances + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TokenBalances.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.tokenBalances = []; + if (message.tokenBalances && message.tokenBalances.length) { + object.tokenBalances = []; + for (var j = 0; j < message.tokenBalances.length; ++j) + object.tokenBalances[j] = $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntry.toObject(message.tokenBalances[j], options); + } + return object; + }; + + /** + * Converts this TokenBalances to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances + * @instance + * @returns {Object.} JSON object + */ + TokenBalances.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TokenBalances; + })(); + + return GetIdentityTokenBalancesResponseV0; + })(); + + return GetIdentityTokenBalancesResponse; + })(); + + v0.GetIdentitiesTokenBalancesRequest = (function() { + + /** + * Properties of a GetIdentitiesTokenBalancesRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetIdentitiesTokenBalancesRequest + * @property {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.IGetIdentitiesTokenBalancesRequestV0|null} [v0] GetIdentitiesTokenBalancesRequest v0 + */ + + /** + * Constructs a new GetIdentitiesTokenBalancesRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetIdentitiesTokenBalancesRequest. + * @implements IGetIdentitiesTokenBalancesRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IGetIdentitiesTokenBalancesRequest=} [properties] Properties to set + */ + function GetIdentitiesTokenBalancesRequest(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]]; + } + + /** + * GetIdentitiesTokenBalancesRequest v0. + * @member {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.IGetIdentitiesTokenBalancesRequestV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest + * @instance + */ + GetIdentitiesTokenBalancesRequest.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetIdentitiesTokenBalancesRequest version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest + * @instance + */ + Object.defineProperty(GetIdentitiesTokenBalancesRequest.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetIdentitiesTokenBalancesRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentitiesTokenBalancesRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest} GetIdentitiesTokenBalancesRequest instance + */ + GetIdentitiesTokenBalancesRequest.create = function create(properties) { + return new GetIdentitiesTokenBalancesRequest(properties); + }; + + /** + * Encodes the specified GetIdentitiesTokenBalancesRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentitiesTokenBalancesRequest} message GetIdentitiesTokenBalancesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentitiesTokenBalancesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetIdentitiesTokenBalancesRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentitiesTokenBalancesRequest} message GetIdentitiesTokenBalancesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentitiesTokenBalancesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentitiesTokenBalancesRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest} GetIdentitiesTokenBalancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentitiesTokenBalancesRequest.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.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentitiesTokenBalancesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest} GetIdentitiesTokenBalancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentitiesTokenBalancesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentitiesTokenBalancesRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentitiesTokenBalancesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetIdentitiesTokenBalancesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest} GetIdentitiesTokenBalancesRequest + */ + GetIdentitiesTokenBalancesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetIdentitiesTokenBalancesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest} message GetIdentitiesTokenBalancesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentitiesTokenBalancesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetIdentitiesTokenBalancesRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest + * @instance + * @returns {Object.} JSON object + */ + GetIdentitiesTokenBalancesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0 = (function() { + + /** + * Properties of a GetIdentitiesTokenBalancesRequestV0. + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest + * @interface IGetIdentitiesTokenBalancesRequestV0 + * @property {Uint8Array|null} [tokenId] GetIdentitiesTokenBalancesRequestV0 tokenId + * @property {Array.|null} [identityIds] GetIdentitiesTokenBalancesRequestV0 identityIds + * @property {boolean|null} [prove] GetIdentitiesTokenBalancesRequestV0 prove + */ + + /** + * Constructs a new GetIdentitiesTokenBalancesRequestV0. + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest + * @classdesc Represents a GetIdentitiesTokenBalancesRequestV0. + * @implements IGetIdentitiesTokenBalancesRequestV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.IGetIdentitiesTokenBalancesRequestV0=} [properties] Properties to set + */ + function GetIdentitiesTokenBalancesRequestV0(properties) { + this.identityIds = []; + 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]]; + } + + /** + * GetIdentitiesTokenBalancesRequestV0 tokenId. + * @member {Uint8Array} tokenId + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0 + * @instance + */ + GetIdentitiesTokenBalancesRequestV0.prototype.tokenId = $util.newBuffer([]); + + /** + * GetIdentitiesTokenBalancesRequestV0 identityIds. + * @member {Array.} identityIds + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0 + * @instance + */ + GetIdentitiesTokenBalancesRequestV0.prototype.identityIds = $util.emptyArray; + + /** + * GetIdentitiesTokenBalancesRequestV0 prove. + * @member {boolean} prove + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0 + * @instance + */ + GetIdentitiesTokenBalancesRequestV0.prototype.prove = false; + + /** + * Creates a new GetIdentitiesTokenBalancesRequestV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.IGetIdentitiesTokenBalancesRequestV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0} GetIdentitiesTokenBalancesRequestV0 instance + */ + GetIdentitiesTokenBalancesRequestV0.create = function create(properties) { + return new GetIdentitiesTokenBalancesRequestV0(properties); + }; + + /** + * Encodes the specified GetIdentitiesTokenBalancesRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.IGetIdentitiesTokenBalancesRequestV0} message GetIdentitiesTokenBalancesRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentitiesTokenBalancesRequestV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tokenId != null && Object.hasOwnProperty.call(message, "tokenId")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.tokenId); + if (message.identityIds != null && message.identityIds.length) + for (var i = 0; i < message.identityIds.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.identityIds[i]); + if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.prove); + return writer; + }; + + /** + * Encodes the specified GetIdentitiesTokenBalancesRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.IGetIdentitiesTokenBalancesRequestV0} message GetIdentitiesTokenBalancesRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentitiesTokenBalancesRequestV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentitiesTokenBalancesRequestV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0} GetIdentitiesTokenBalancesRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentitiesTokenBalancesRequestV0.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.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tokenId = reader.bytes(); + break; + case 2: + if (!(message.identityIds && message.identityIds.length)) + message.identityIds = []; + message.identityIds.push(reader.bytes()); + break; + case 3: + message.prove = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentitiesTokenBalancesRequestV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0} GetIdentitiesTokenBalancesRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentitiesTokenBalancesRequestV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentitiesTokenBalancesRequestV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentitiesTokenBalancesRequestV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tokenId != null && message.hasOwnProperty("tokenId")) + if (!(message.tokenId && typeof message.tokenId.length === "number" || $util.isString(message.tokenId))) + return "tokenId: buffer expected"; + if (message.identityIds != null && message.hasOwnProperty("identityIds")) { + if (!Array.isArray(message.identityIds)) + return "identityIds: array expected"; + for (var i = 0; i < message.identityIds.length; ++i) + if (!(message.identityIds[i] && typeof message.identityIds[i].length === "number" || $util.isString(message.identityIds[i]))) + return "identityIds: buffer[] expected"; + } + if (message.prove != null && message.hasOwnProperty("prove")) + if (typeof message.prove !== "boolean") + return "prove: boolean expected"; + return null; + }; + + /** + * Creates a GetIdentitiesTokenBalancesRequestV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0} GetIdentitiesTokenBalancesRequestV0 + */ + GetIdentitiesTokenBalancesRequestV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0(); + if (object.tokenId != null) + if (typeof object.tokenId === "string") + $util.base64.decode(object.tokenId, message.tokenId = $util.newBuffer($util.base64.length(object.tokenId)), 0); + else if (object.tokenId.length >= 0) + message.tokenId = object.tokenId; + if (object.identityIds) { + if (!Array.isArray(object.identityIds)) + throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0.identityIds: array expected"); + message.identityIds = []; + for (var i = 0; i < object.identityIds.length; ++i) + if (typeof object.identityIds[i] === "string") + $util.base64.decode(object.identityIds[i], message.identityIds[i] = $util.newBuffer($util.base64.length(object.identityIds[i])), 0); + else if (object.identityIds[i].length >= 0) + message.identityIds[i] = object.identityIds[i]; + } + if (object.prove != null) + message.prove = Boolean(object.prove); + return message; + }; + + /** + * Creates a plain object from a GetIdentitiesTokenBalancesRequestV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0} message GetIdentitiesTokenBalancesRequestV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentitiesTokenBalancesRequestV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.identityIds = []; + if (options.defaults) { + if (options.bytes === String) + object.tokenId = ""; + else { + object.tokenId = []; + if (options.bytes !== Array) + object.tokenId = $util.newBuffer(object.tokenId); + } + object.prove = false; + } + if (message.tokenId != null && message.hasOwnProperty("tokenId")) + object.tokenId = options.bytes === String ? $util.base64.encode(message.tokenId, 0, message.tokenId.length) : options.bytes === Array ? Array.prototype.slice.call(message.tokenId) : message.tokenId; + if (message.identityIds && message.identityIds.length) { + object.identityIds = []; + for (var j = 0; j < message.identityIds.length; ++j) + object.identityIds[j] = options.bytes === String ? $util.base64.encode(message.identityIds[j], 0, message.identityIds[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.identityIds[j]) : message.identityIds[j]; + } + if (message.prove != null && message.hasOwnProperty("prove")) + object.prove = message.prove; + return object; + }; + + /** + * Converts this GetIdentitiesTokenBalancesRequestV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0 + * @instance + * @returns {Object.} JSON object + */ + GetIdentitiesTokenBalancesRequestV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetIdentitiesTokenBalancesRequestV0; + })(); + + return GetIdentitiesTokenBalancesRequest; + })(); + + v0.GetIdentitiesTokenBalancesResponse = (function() { + + /** + * Properties of a GetIdentitiesTokenBalancesResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetIdentitiesTokenBalancesResponse + * @property {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.IGetIdentitiesTokenBalancesResponseV0|null} [v0] GetIdentitiesTokenBalancesResponse v0 + */ + + /** + * Constructs a new GetIdentitiesTokenBalancesResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetIdentitiesTokenBalancesResponse. + * @implements IGetIdentitiesTokenBalancesResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IGetIdentitiesTokenBalancesResponse=} [properties] Properties to set + */ + function GetIdentitiesTokenBalancesResponse(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]]; + } + + /** + * GetIdentitiesTokenBalancesResponse v0. + * @member {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.IGetIdentitiesTokenBalancesResponseV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse + * @instance + */ + GetIdentitiesTokenBalancesResponse.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetIdentitiesTokenBalancesResponse version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse + * @instance + */ + Object.defineProperty(GetIdentitiesTokenBalancesResponse.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetIdentitiesTokenBalancesResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentitiesTokenBalancesResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse} GetIdentitiesTokenBalancesResponse instance + */ + GetIdentitiesTokenBalancesResponse.create = function create(properties) { + return new GetIdentitiesTokenBalancesResponse(properties); + }; + + /** + * Encodes the specified GetIdentitiesTokenBalancesResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentitiesTokenBalancesResponse} message GetIdentitiesTokenBalancesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentitiesTokenBalancesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetIdentitiesTokenBalancesResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentitiesTokenBalancesResponse} message GetIdentitiesTokenBalancesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentitiesTokenBalancesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentitiesTokenBalancesResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse} GetIdentitiesTokenBalancesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentitiesTokenBalancesResponse.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.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentitiesTokenBalancesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse} GetIdentitiesTokenBalancesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentitiesTokenBalancesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentitiesTokenBalancesResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentitiesTokenBalancesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetIdentitiesTokenBalancesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse} GetIdentitiesTokenBalancesResponse + */ + GetIdentitiesTokenBalancesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetIdentitiesTokenBalancesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse} message GetIdentitiesTokenBalancesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentitiesTokenBalancesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetIdentitiesTokenBalancesResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse + * @instance + * @returns {Object.} JSON object + */ + GetIdentitiesTokenBalancesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0 = (function() { + + /** + * Properties of a GetIdentitiesTokenBalancesResponseV0. + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse + * @interface IGetIdentitiesTokenBalancesResponseV0 + * @property {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IIdentityTokenBalances|null} [identityTokenBalances] GetIdentitiesTokenBalancesResponseV0 identityTokenBalances + * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetIdentitiesTokenBalancesResponseV0 proof + * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetIdentitiesTokenBalancesResponseV0 metadata + */ + + /** + * Constructs a new GetIdentitiesTokenBalancesResponseV0. + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse + * @classdesc Represents a GetIdentitiesTokenBalancesResponseV0. + * @implements IGetIdentitiesTokenBalancesResponseV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.IGetIdentitiesTokenBalancesResponseV0=} [properties] Properties to set + */ + function GetIdentitiesTokenBalancesResponseV0(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]]; + } + + /** + * GetIdentitiesTokenBalancesResponseV0 identityTokenBalances. + * @member {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IIdentityTokenBalances|null|undefined} identityTokenBalances + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0 + * @instance + */ + GetIdentitiesTokenBalancesResponseV0.prototype.identityTokenBalances = null; + + /** + * GetIdentitiesTokenBalancesResponseV0 proof. + * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0 + * @instance + */ + GetIdentitiesTokenBalancesResponseV0.prototype.proof = null; + + /** + * GetIdentitiesTokenBalancesResponseV0 metadata. + * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0 + * @instance + */ + GetIdentitiesTokenBalancesResponseV0.prototype.metadata = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetIdentitiesTokenBalancesResponseV0 result. + * @member {"identityTokenBalances"|"proof"|undefined} result + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0 + * @instance + */ + Object.defineProperty(GetIdentitiesTokenBalancesResponseV0.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["identityTokenBalances", "proof"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetIdentitiesTokenBalancesResponseV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.IGetIdentitiesTokenBalancesResponseV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0} GetIdentitiesTokenBalancesResponseV0 instance + */ + GetIdentitiesTokenBalancesResponseV0.create = function create(properties) { + return new GetIdentitiesTokenBalancesResponseV0(properties); + }; + + /** + * Encodes the specified GetIdentitiesTokenBalancesResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.IGetIdentitiesTokenBalancesResponseV0} message GetIdentitiesTokenBalancesResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentitiesTokenBalancesResponseV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.identityTokenBalances != null && Object.hasOwnProperty.call(message, "identityTokenBalances")) + $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances.encode(message.identityTokenBalances, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetIdentitiesTokenBalancesResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.IGetIdentitiesTokenBalancesResponseV0} message GetIdentitiesTokenBalancesResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentitiesTokenBalancesResponseV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentitiesTokenBalancesResponseV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0} GetIdentitiesTokenBalancesResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentitiesTokenBalancesResponseV0.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.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.identityTokenBalances = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances.decode(reader, reader.uint32()); + break; + case 2: + message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); + break; + case 3: + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentitiesTokenBalancesResponseV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0} GetIdentitiesTokenBalancesResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentitiesTokenBalancesResponseV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentitiesTokenBalancesResponseV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentitiesTokenBalancesResponseV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.identityTokenBalances != null && message.hasOwnProperty("identityTokenBalances")) { + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances.verify(message.identityTokenBalances); + if (error) + return "identityTokenBalances." + error; + } + } + if (message.proof != null && message.hasOwnProperty("proof")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); + if (error) + return "proof." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a GetIdentitiesTokenBalancesResponseV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0} GetIdentitiesTokenBalancesResponseV0 + */ + GetIdentitiesTokenBalancesResponseV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0(); + if (object.identityTokenBalances != null) { + if (typeof object.identityTokenBalances !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.identityTokenBalances: object expected"); + message.identityTokenBalances = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances.fromObject(object.identityTokenBalances); + } + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.proof: object expected"); + message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.metadata: object expected"); + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a GetIdentitiesTokenBalancesResponseV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0} message GetIdentitiesTokenBalancesResponseV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentitiesTokenBalancesResponseV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.metadata = null; + if (message.identityTokenBalances != null && message.hasOwnProperty("identityTokenBalances")) { + object.identityTokenBalances = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances.toObject(message.identityTokenBalances, options); + if (options.oneofs) + object.result = "identityTokenBalances"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); + if (options.oneofs) + object.result = "proof"; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this GetIdentitiesTokenBalancesResponseV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0 + * @instance + * @returns {Object.} JSON object + */ + GetIdentitiesTokenBalancesResponseV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry = (function() { + + /** + * Properties of an IdentityTokenBalanceEntry. + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0 + * @interface IIdentityTokenBalanceEntry + * @property {Uint8Array|null} [identityId] IdentityTokenBalanceEntry identityId + * @property {number|Long|null} [balance] IdentityTokenBalanceEntry balance + */ + + /** + * Constructs a new IdentityTokenBalanceEntry. + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0 + * @classdesc Represents an IdentityTokenBalanceEntry. + * @implements IIdentityTokenBalanceEntry + * @constructor + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IIdentityTokenBalanceEntry=} [properties] Properties to set + */ + function IdentityTokenBalanceEntry(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]]; + } + + /** + * IdentityTokenBalanceEntry identityId. + * @member {Uint8Array} identityId + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry + * @instance + */ + IdentityTokenBalanceEntry.prototype.identityId = $util.newBuffer([]); + + /** + * IdentityTokenBalanceEntry balance. + * @member {number|Long} balance + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry + * @instance + */ + IdentityTokenBalanceEntry.prototype.balance = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new IdentityTokenBalanceEntry instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IIdentityTokenBalanceEntry=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry} IdentityTokenBalanceEntry instance + */ + IdentityTokenBalanceEntry.create = function create(properties) { + return new IdentityTokenBalanceEntry(properties); + }; + + /** + * Encodes the specified IdentityTokenBalanceEntry message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IIdentityTokenBalanceEntry} message IdentityTokenBalanceEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IdentityTokenBalanceEntry.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.identityId != null && Object.hasOwnProperty.call(message, "identityId")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.identityId); + if (message.balance != null && Object.hasOwnProperty.call(message, "balance")) + writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.balance); + return writer; + }; + + /** + * Encodes the specified IdentityTokenBalanceEntry message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IIdentityTokenBalanceEntry} message IdentityTokenBalanceEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IdentityTokenBalanceEntry.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IdentityTokenBalanceEntry message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry} IdentityTokenBalanceEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IdentityTokenBalanceEntry.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.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.identityId = reader.bytes(); + break; + case 2: + message.balance = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IdentityTokenBalanceEntry message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry} IdentityTokenBalanceEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IdentityTokenBalanceEntry.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IdentityTokenBalanceEntry message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IdentityTokenBalanceEntry.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.identityId != null && message.hasOwnProperty("identityId")) + if (!(message.identityId && typeof message.identityId.length === "number" || $util.isString(message.identityId))) + return "identityId: buffer expected"; + if (message.balance != null && message.hasOwnProperty("balance")) + if (!$util.isInteger(message.balance) && !(message.balance && $util.isInteger(message.balance.low) && $util.isInteger(message.balance.high))) + return "balance: integer|Long expected"; + return null; + }; + + /** + * Creates an IdentityTokenBalanceEntry message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry} IdentityTokenBalanceEntry + */ + IdentityTokenBalanceEntry.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry(); + if (object.identityId != null) + if (typeof object.identityId === "string") + $util.base64.decode(object.identityId, message.identityId = $util.newBuffer($util.base64.length(object.identityId)), 0); + else if (object.identityId.length >= 0) + message.identityId = object.identityId; + if (object.balance != null) + if ($util.Long) + (message.balance = $util.Long.fromValue(object.balance)).unsigned = true; + else if (typeof object.balance === "string") + message.balance = parseInt(object.balance, 10); + else if (typeof object.balance === "number") + message.balance = object.balance; + else if (typeof object.balance === "object") + message.balance = new $util.LongBits(object.balance.low >>> 0, object.balance.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from an IdentityTokenBalanceEntry message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry} message IdentityTokenBalanceEntry + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IdentityTokenBalanceEntry.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.identityId = ""; + else { + object.identityId = []; + if (options.bytes !== Array) + object.identityId = $util.newBuffer(object.identityId); + } + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.balance = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.balance = options.longs === String ? "0" : 0; + } + if (message.identityId != null && message.hasOwnProperty("identityId")) + object.identityId = options.bytes === String ? $util.base64.encode(message.identityId, 0, message.identityId.length) : options.bytes === Array ? Array.prototype.slice.call(message.identityId) : message.identityId; + if (message.balance != null && message.hasOwnProperty("balance")) + if (typeof message.balance === "number") + object.balance = options.longs === String ? String(message.balance) : message.balance; + else + object.balance = options.longs === String ? $util.Long.prototype.toString.call(message.balance) : options.longs === Number ? new $util.LongBits(message.balance.low >>> 0, message.balance.high >>> 0).toNumber(true) : message.balance; + return object; + }; + + /** + * Converts this IdentityTokenBalanceEntry to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry + * @instance + * @returns {Object.} JSON object + */ + IdentityTokenBalanceEntry.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return IdentityTokenBalanceEntry; + })(); + + GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances = (function() { + + /** + * Properties of an IdentityTokenBalances. + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0 + * @interface IIdentityTokenBalances + * @property {Array.|null} [identityTokenBalances] IdentityTokenBalances identityTokenBalances + */ + + /** + * Constructs a new IdentityTokenBalances. + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0 + * @classdesc Represents an IdentityTokenBalances. + * @implements IIdentityTokenBalances + * @constructor + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IIdentityTokenBalances=} [properties] Properties to set + */ + function IdentityTokenBalances(properties) { + this.identityTokenBalances = []; + 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]]; + } + + /** + * IdentityTokenBalances identityTokenBalances. + * @member {Array.} identityTokenBalances + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances + * @instance + */ + IdentityTokenBalances.prototype.identityTokenBalances = $util.emptyArray; + + /** + * Creates a new IdentityTokenBalances instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IIdentityTokenBalances=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances} IdentityTokenBalances instance + */ + IdentityTokenBalances.create = function create(properties) { + return new IdentityTokenBalances(properties); + }; + + /** + * Encodes the specified IdentityTokenBalances message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IIdentityTokenBalances} message IdentityTokenBalances message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IdentityTokenBalances.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.identityTokenBalances != null && message.identityTokenBalances.length) + for (var i = 0; i < message.identityTokenBalances.length; ++i) + $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry.encode(message.identityTokenBalances[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified IdentityTokenBalances message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IIdentityTokenBalances} message IdentityTokenBalances message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IdentityTokenBalances.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IdentityTokenBalances message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances} IdentityTokenBalances + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IdentityTokenBalances.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.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.identityTokenBalances && message.identityTokenBalances.length)) + message.identityTokenBalances = []; + message.identityTokenBalances.push($root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IdentityTokenBalances message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances} IdentityTokenBalances + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IdentityTokenBalances.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IdentityTokenBalances message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IdentityTokenBalances.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.identityTokenBalances != null && message.hasOwnProperty("identityTokenBalances")) { + if (!Array.isArray(message.identityTokenBalances)) + return "identityTokenBalances: array expected"; + for (var i = 0; i < message.identityTokenBalances.length; ++i) { + var error = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry.verify(message.identityTokenBalances[i]); + if (error) + return "identityTokenBalances." + error; + } + } + return null; + }; + + /** + * Creates an IdentityTokenBalances message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances} IdentityTokenBalances + */ + IdentityTokenBalances.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances(); + if (object.identityTokenBalances) { + if (!Array.isArray(object.identityTokenBalances)) + throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances.identityTokenBalances: array expected"); + message.identityTokenBalances = []; + for (var i = 0; i < object.identityTokenBalances.length; ++i) { + if (typeof object.identityTokenBalances[i] !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances.identityTokenBalances: object expected"); + message.identityTokenBalances[i] = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry.fromObject(object.identityTokenBalances[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an IdentityTokenBalances message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances} message IdentityTokenBalances + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IdentityTokenBalances.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.identityTokenBalances = []; + if (message.identityTokenBalances && message.identityTokenBalances.length) { + object.identityTokenBalances = []; + for (var j = 0; j < message.identityTokenBalances.length; ++j) + object.identityTokenBalances[j] = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry.toObject(message.identityTokenBalances[j], options); + } + return object; + }; + + /** + * Converts this IdentityTokenBalances to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances + * @instance + * @returns {Object.} JSON object + */ + IdentityTokenBalances.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return IdentityTokenBalances; + })(); + + return GetIdentitiesTokenBalancesResponseV0; + })(); + + return GetIdentitiesTokenBalancesResponse; + })(); + + v0.GetIdentityTokenInfosRequest = (function() { + + /** + * Properties of a GetIdentityTokenInfosRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetIdentityTokenInfosRequest + * @property {org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.IGetIdentityTokenInfosRequestV0|null} [v0] GetIdentityTokenInfosRequest v0 + */ + + /** + * Constructs a new GetIdentityTokenInfosRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetIdentityTokenInfosRequest. + * @implements IGetIdentityTokenInfosRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IGetIdentityTokenInfosRequest=} [properties] Properties to set + */ + function GetIdentityTokenInfosRequest(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]]; + } + + /** + * GetIdentityTokenInfosRequest v0. + * @member {org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.IGetIdentityTokenInfosRequestV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest + * @instance + */ + GetIdentityTokenInfosRequest.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetIdentityTokenInfosRequest version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest + * @instance + */ + Object.defineProperty(GetIdentityTokenInfosRequest.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetIdentityTokenInfosRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityTokenInfosRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest} GetIdentityTokenInfosRequest instance + */ + GetIdentityTokenInfosRequest.create = function create(properties) { + return new GetIdentityTokenInfosRequest(properties); + }; + + /** + * Encodes the specified GetIdentityTokenInfosRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityTokenInfosRequest} message GetIdentityTokenInfosRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityTokenInfosRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetIdentityTokenInfosRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityTokenInfosRequest} message GetIdentityTokenInfosRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityTokenInfosRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentityTokenInfosRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest} GetIdentityTokenInfosRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityTokenInfosRequest.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.org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentityTokenInfosRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest} GetIdentityTokenInfosRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityTokenInfosRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentityTokenInfosRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentityTokenInfosRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetIdentityTokenInfosRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest} GetIdentityTokenInfosRequest + */ + GetIdentityTokenInfosRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetIdentityTokenInfosRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest} message GetIdentityTokenInfosRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentityTokenInfosRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetIdentityTokenInfosRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest + * @instance + * @returns {Object.} JSON object + */ + GetIdentityTokenInfosRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0 = (function() { + + /** + * Properties of a GetIdentityTokenInfosRequestV0. + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest + * @interface IGetIdentityTokenInfosRequestV0 + * @property {Uint8Array|null} [identityId] GetIdentityTokenInfosRequestV0 identityId + * @property {Array.|null} [tokenIds] GetIdentityTokenInfosRequestV0 tokenIds + * @property {boolean|null} [prove] GetIdentityTokenInfosRequestV0 prove + */ + + /** + * Constructs a new GetIdentityTokenInfosRequestV0. + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest + * @classdesc Represents a GetIdentityTokenInfosRequestV0. + * @implements IGetIdentityTokenInfosRequestV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.IGetIdentityTokenInfosRequestV0=} [properties] Properties to set + */ + function GetIdentityTokenInfosRequestV0(properties) { + this.tokenIds = []; + 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]]; + } + + /** + * GetIdentityTokenInfosRequestV0 identityId. + * @member {Uint8Array} identityId + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0 + * @instance + */ + GetIdentityTokenInfosRequestV0.prototype.identityId = $util.newBuffer([]); + + /** + * GetIdentityTokenInfosRequestV0 tokenIds. + * @member {Array.} tokenIds + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0 + * @instance + */ + GetIdentityTokenInfosRequestV0.prototype.tokenIds = $util.emptyArray; + + /** + * GetIdentityTokenInfosRequestV0 prove. + * @member {boolean} prove + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0 + * @instance + */ + GetIdentityTokenInfosRequestV0.prototype.prove = false; + + /** + * Creates a new GetIdentityTokenInfosRequestV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.IGetIdentityTokenInfosRequestV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0} GetIdentityTokenInfosRequestV0 instance + */ + GetIdentityTokenInfosRequestV0.create = function create(properties) { + return new GetIdentityTokenInfosRequestV0(properties); + }; + + /** + * Encodes the specified GetIdentityTokenInfosRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.IGetIdentityTokenInfosRequestV0} message GetIdentityTokenInfosRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityTokenInfosRequestV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.identityId != null && Object.hasOwnProperty.call(message, "identityId")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.identityId); + if (message.tokenIds != null && message.tokenIds.length) + for (var i = 0; i < message.tokenIds.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.tokenIds[i]); + if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.prove); + return writer; + }; + + /** + * Encodes the specified GetIdentityTokenInfosRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.IGetIdentityTokenInfosRequestV0} message GetIdentityTokenInfosRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityTokenInfosRequestV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentityTokenInfosRequestV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0} GetIdentityTokenInfosRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityTokenInfosRequestV0.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.org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.identityId = reader.bytes(); + break; + case 2: + if (!(message.tokenIds && message.tokenIds.length)) + message.tokenIds = []; + message.tokenIds.push(reader.bytes()); + break; + case 3: + message.prove = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentityTokenInfosRequestV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0} GetIdentityTokenInfosRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityTokenInfosRequestV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentityTokenInfosRequestV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentityTokenInfosRequestV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.identityId != null && message.hasOwnProperty("identityId")) + if (!(message.identityId && typeof message.identityId.length === "number" || $util.isString(message.identityId))) + return "identityId: buffer expected"; + if (message.tokenIds != null && message.hasOwnProperty("tokenIds")) { + if (!Array.isArray(message.tokenIds)) + return "tokenIds: array expected"; + for (var i = 0; i < message.tokenIds.length; ++i) + if (!(message.tokenIds[i] && typeof message.tokenIds[i].length === "number" || $util.isString(message.tokenIds[i]))) + return "tokenIds: buffer[] expected"; + } + if (message.prove != null && message.hasOwnProperty("prove")) + if (typeof message.prove !== "boolean") + return "prove: boolean expected"; + return null; + }; + + /** + * Creates a GetIdentityTokenInfosRequestV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0} GetIdentityTokenInfosRequestV0 + */ + GetIdentityTokenInfosRequestV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0(); + if (object.identityId != null) + if (typeof object.identityId === "string") + $util.base64.decode(object.identityId, message.identityId = $util.newBuffer($util.base64.length(object.identityId)), 0); + else if (object.identityId.length >= 0) + message.identityId = object.identityId; + if (object.tokenIds) { + if (!Array.isArray(object.tokenIds)) + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0.tokenIds: array expected"); + message.tokenIds = []; + for (var i = 0; i < object.tokenIds.length; ++i) + if (typeof object.tokenIds[i] === "string") + $util.base64.decode(object.tokenIds[i], message.tokenIds[i] = $util.newBuffer($util.base64.length(object.tokenIds[i])), 0); + else if (object.tokenIds[i].length >= 0) + message.tokenIds[i] = object.tokenIds[i]; + } + if (object.prove != null) + message.prove = Boolean(object.prove); + return message; + }; + + /** + * Creates a plain object from a GetIdentityTokenInfosRequestV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0} message GetIdentityTokenInfosRequestV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentityTokenInfosRequestV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.tokenIds = []; + if (options.defaults) { + if (options.bytes === String) + object.identityId = ""; + else { + object.identityId = []; + if (options.bytes !== Array) + object.identityId = $util.newBuffer(object.identityId); + } + object.prove = false; + } + if (message.identityId != null && message.hasOwnProperty("identityId")) + object.identityId = options.bytes === String ? $util.base64.encode(message.identityId, 0, message.identityId.length) : options.bytes === Array ? Array.prototype.slice.call(message.identityId) : message.identityId; + if (message.tokenIds && message.tokenIds.length) { + object.tokenIds = []; + for (var j = 0; j < message.tokenIds.length; ++j) + object.tokenIds[j] = options.bytes === String ? $util.base64.encode(message.tokenIds[j], 0, message.tokenIds[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.tokenIds[j]) : message.tokenIds[j]; + } + if (message.prove != null && message.hasOwnProperty("prove")) + object.prove = message.prove; + return object; + }; + + /** + * Converts this GetIdentityTokenInfosRequestV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0 + * @instance + * @returns {Object.} JSON object + */ + GetIdentityTokenInfosRequestV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetIdentityTokenInfosRequestV0; + })(); + + return GetIdentityTokenInfosRequest; + })(); + + v0.GetIdentityTokenInfosResponse = (function() { + + /** + * Properties of a GetIdentityTokenInfosResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetIdentityTokenInfosResponse + * @property {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.IGetIdentityTokenInfosResponseV0|null} [v0] GetIdentityTokenInfosResponse v0 + */ + + /** + * Constructs a new GetIdentityTokenInfosResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetIdentityTokenInfosResponse. + * @implements IGetIdentityTokenInfosResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IGetIdentityTokenInfosResponse=} [properties] Properties to set + */ + function GetIdentityTokenInfosResponse(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]]; + } + + /** + * GetIdentityTokenInfosResponse v0. + * @member {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.IGetIdentityTokenInfosResponseV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse + * @instance + */ + GetIdentityTokenInfosResponse.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetIdentityTokenInfosResponse version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse + * @instance + */ + Object.defineProperty(GetIdentityTokenInfosResponse.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetIdentityTokenInfosResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityTokenInfosResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse} GetIdentityTokenInfosResponse instance + */ + GetIdentityTokenInfosResponse.create = function create(properties) { + return new GetIdentityTokenInfosResponse(properties); + }; + + /** + * Encodes the specified GetIdentityTokenInfosResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityTokenInfosResponse} message GetIdentityTokenInfosResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityTokenInfosResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetIdentityTokenInfosResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityTokenInfosResponse} message GetIdentityTokenInfosResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityTokenInfosResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentityTokenInfosResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse} GetIdentityTokenInfosResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityTokenInfosResponse.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.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentityTokenInfosResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse} GetIdentityTokenInfosResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityTokenInfosResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentityTokenInfosResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentityTokenInfosResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetIdentityTokenInfosResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse} GetIdentityTokenInfosResponse + */ + GetIdentityTokenInfosResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetIdentityTokenInfosResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse} message GetIdentityTokenInfosResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentityTokenInfosResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetIdentityTokenInfosResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse + * @instance + * @returns {Object.} JSON object + */ + GetIdentityTokenInfosResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0 = (function() { + + /** + * Properties of a GetIdentityTokenInfosResponseV0. + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse + * @interface IGetIdentityTokenInfosResponseV0 + * @property {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.ITokenInfos|null} [tokenInfos] GetIdentityTokenInfosResponseV0 tokenInfos + * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetIdentityTokenInfosResponseV0 proof + * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetIdentityTokenInfosResponseV0 metadata + */ + + /** + * Constructs a new GetIdentityTokenInfosResponseV0. + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse + * @classdesc Represents a GetIdentityTokenInfosResponseV0. + * @implements IGetIdentityTokenInfosResponseV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.IGetIdentityTokenInfosResponseV0=} [properties] Properties to set + */ + function GetIdentityTokenInfosResponseV0(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]]; + } + + /** + * GetIdentityTokenInfosResponseV0 tokenInfos. + * @member {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.ITokenInfos|null|undefined} tokenInfos + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0 + * @instance + */ + GetIdentityTokenInfosResponseV0.prototype.tokenInfos = null; + + /** + * GetIdentityTokenInfosResponseV0 proof. + * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0 + * @instance + */ + GetIdentityTokenInfosResponseV0.prototype.proof = null; + + /** + * GetIdentityTokenInfosResponseV0 metadata. + * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0 + * @instance + */ + GetIdentityTokenInfosResponseV0.prototype.metadata = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetIdentityTokenInfosResponseV0 result. + * @member {"tokenInfos"|"proof"|undefined} result + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0 + * @instance + */ + Object.defineProperty(GetIdentityTokenInfosResponseV0.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["tokenInfos", "proof"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetIdentityTokenInfosResponseV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.IGetIdentityTokenInfosResponseV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0} GetIdentityTokenInfosResponseV0 instance + */ + GetIdentityTokenInfosResponseV0.create = function create(properties) { + return new GetIdentityTokenInfosResponseV0(properties); + }; + + /** + * Encodes the specified GetIdentityTokenInfosResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.IGetIdentityTokenInfosResponseV0} message GetIdentityTokenInfosResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityTokenInfosResponseV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tokenInfos != null && Object.hasOwnProperty.call(message, "tokenInfos")) + $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfos.encode(message.tokenInfos, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetIdentityTokenInfosResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.IGetIdentityTokenInfosResponseV0} message GetIdentityTokenInfosResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityTokenInfosResponseV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentityTokenInfosResponseV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0} GetIdentityTokenInfosResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityTokenInfosResponseV0.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.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tokenInfos = $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfos.decode(reader, reader.uint32()); + break; + case 2: + message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); + break; + case 3: + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentityTokenInfosResponseV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0} GetIdentityTokenInfosResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityTokenInfosResponseV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentityTokenInfosResponseV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentityTokenInfosResponseV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.tokenInfos != null && message.hasOwnProperty("tokenInfos")) { + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfos.verify(message.tokenInfos); + if (error) + return "tokenInfos." + error; + } + } + if (message.proof != null && message.hasOwnProperty("proof")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); + if (error) + return "proof." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a GetIdentityTokenInfosResponseV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0} GetIdentityTokenInfosResponseV0 + */ + GetIdentityTokenInfosResponseV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0(); + if (object.tokenInfos != null) { + if (typeof object.tokenInfos !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.tokenInfos: object expected"); + message.tokenInfos = $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfos.fromObject(object.tokenInfos); + } + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.proof: object expected"); + message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.metadata: object expected"); + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a GetIdentityTokenInfosResponseV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0} message GetIdentityTokenInfosResponseV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentityTokenInfosResponseV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.metadata = null; + if (message.tokenInfos != null && message.hasOwnProperty("tokenInfos")) { + object.tokenInfos = $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfos.toObject(message.tokenInfos, options); + if (options.oneofs) + object.result = "tokenInfos"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); + if (options.oneofs) + object.result = "proof"; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this GetIdentityTokenInfosResponseV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0 + * @instance + * @returns {Object.} JSON object + */ + GetIdentityTokenInfosResponseV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetIdentityTokenInfosResponseV0.TokenIdentityInfoEntry = (function() { + + /** + * Properties of a TokenIdentityInfoEntry. + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0 + * @interface ITokenIdentityInfoEntry + * @property {boolean|null} [frozen] TokenIdentityInfoEntry frozen + */ + + /** + * Constructs a new TokenIdentityInfoEntry. + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0 + * @classdesc Represents a TokenIdentityInfoEntry. + * @implements ITokenIdentityInfoEntry + * @constructor + * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.ITokenIdentityInfoEntry=} [properties] Properties to set + */ + function TokenIdentityInfoEntry(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]]; + } + + /** + * TokenIdentityInfoEntry frozen. + * @member {boolean} frozen + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenIdentityInfoEntry + * @instance + */ + TokenIdentityInfoEntry.prototype.frozen = false; + + /** + * Creates a new TokenIdentityInfoEntry instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenIdentityInfoEntry + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.ITokenIdentityInfoEntry=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenIdentityInfoEntry} TokenIdentityInfoEntry instance + */ + TokenIdentityInfoEntry.create = function create(properties) { + return new TokenIdentityInfoEntry(properties); + }; + + /** + * Encodes the specified TokenIdentityInfoEntry message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenIdentityInfoEntry.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenIdentityInfoEntry + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.ITokenIdentityInfoEntry} message TokenIdentityInfoEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenIdentityInfoEntry.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.frozen != null && Object.hasOwnProperty.call(message, "frozen")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.frozen); + return writer; + }; + + /** + * Encodes the specified TokenIdentityInfoEntry message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenIdentityInfoEntry.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenIdentityInfoEntry + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.ITokenIdentityInfoEntry} message TokenIdentityInfoEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenIdentityInfoEntry.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TokenIdentityInfoEntry message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenIdentityInfoEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenIdentityInfoEntry} TokenIdentityInfoEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenIdentityInfoEntry.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.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenIdentityInfoEntry(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.frozen = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TokenIdentityInfoEntry message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenIdentityInfoEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenIdentityInfoEntry} TokenIdentityInfoEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenIdentityInfoEntry.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TokenIdentityInfoEntry message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenIdentityInfoEntry + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TokenIdentityInfoEntry.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.frozen != null && message.hasOwnProperty("frozen")) + if (typeof message.frozen !== "boolean") + return "frozen: boolean expected"; + return null; + }; + + /** + * Creates a TokenIdentityInfoEntry message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenIdentityInfoEntry + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenIdentityInfoEntry} TokenIdentityInfoEntry + */ + TokenIdentityInfoEntry.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenIdentityInfoEntry) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenIdentityInfoEntry(); + if (object.frozen != null) + message.frozen = Boolean(object.frozen); + return message; + }; + + /** + * Creates a plain object from a TokenIdentityInfoEntry message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenIdentityInfoEntry + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenIdentityInfoEntry} message TokenIdentityInfoEntry + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TokenIdentityInfoEntry.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.frozen = false; + if (message.frozen != null && message.hasOwnProperty("frozen")) + object.frozen = message.frozen; + return object; + }; + + /** + * Converts this TokenIdentityInfoEntry to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenIdentityInfoEntry + * @instance + * @returns {Object.} JSON object + */ + TokenIdentityInfoEntry.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TokenIdentityInfoEntry; + })(); + + GetIdentityTokenInfosResponseV0.TokenInfoEntry = (function() { + + /** + * Properties of a TokenInfoEntry. + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0 + * @interface ITokenInfoEntry + * @property {Uint8Array|null} [tokenId] TokenInfoEntry tokenId + * @property {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.ITokenIdentityInfoEntry|null} [info] TokenInfoEntry info + */ + + /** + * Constructs a new TokenInfoEntry. + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0 + * @classdesc Represents a TokenInfoEntry. + * @implements ITokenInfoEntry + * @constructor + * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.ITokenInfoEntry=} [properties] Properties to set + */ + function TokenInfoEntry(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]]; + } + + /** + * TokenInfoEntry tokenId. + * @member {Uint8Array} tokenId + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntry + * @instance + */ + TokenInfoEntry.prototype.tokenId = $util.newBuffer([]); + + /** + * TokenInfoEntry info. + * @member {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.ITokenIdentityInfoEntry|null|undefined} info + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntry + * @instance + */ + TokenInfoEntry.prototype.info = null; + + /** + * Creates a new TokenInfoEntry instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntry + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.ITokenInfoEntry=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntry} TokenInfoEntry instance + */ + TokenInfoEntry.create = function create(properties) { + return new TokenInfoEntry(properties); + }; + + /** + * Encodes the specified TokenInfoEntry message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntry.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntry + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.ITokenInfoEntry} message TokenInfoEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenInfoEntry.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tokenId != null && Object.hasOwnProperty.call(message, "tokenId")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.tokenId); + if (message.info != null && Object.hasOwnProperty.call(message, "info")) + $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenIdentityInfoEntry.encode(message.info, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TokenInfoEntry message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntry.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntry + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.ITokenInfoEntry} message TokenInfoEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenInfoEntry.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TokenInfoEntry message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntry} TokenInfoEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenInfoEntry.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.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntry(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tokenId = reader.bytes(); + break; + case 2: + message.info = $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenIdentityInfoEntry.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TokenInfoEntry message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntry} TokenInfoEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenInfoEntry.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TokenInfoEntry message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntry + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TokenInfoEntry.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tokenId != null && message.hasOwnProperty("tokenId")) + if (!(message.tokenId && typeof message.tokenId.length === "number" || $util.isString(message.tokenId))) + return "tokenId: buffer expected"; + if (message.info != null && message.hasOwnProperty("info")) { + var error = $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenIdentityInfoEntry.verify(message.info); + if (error) + return "info." + error; + } + return null; + }; + + /** + * Creates a TokenInfoEntry message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntry + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntry} TokenInfoEntry + */ + TokenInfoEntry.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntry) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntry(); + if (object.tokenId != null) + if (typeof object.tokenId === "string") + $util.base64.decode(object.tokenId, message.tokenId = $util.newBuffer($util.base64.length(object.tokenId)), 0); + else if (object.tokenId.length >= 0) + message.tokenId = object.tokenId; + if (object.info != null) { + if (typeof object.info !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntry.info: object expected"); + message.info = $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenIdentityInfoEntry.fromObject(object.info); + } + return message; + }; + + /** + * Creates a plain object from a TokenInfoEntry message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntry + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntry} message TokenInfoEntry + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TokenInfoEntry.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.tokenId = ""; + else { + object.tokenId = []; + if (options.bytes !== Array) + object.tokenId = $util.newBuffer(object.tokenId); + } + object.info = null; + } + if (message.tokenId != null && message.hasOwnProperty("tokenId")) + object.tokenId = options.bytes === String ? $util.base64.encode(message.tokenId, 0, message.tokenId.length) : options.bytes === Array ? Array.prototype.slice.call(message.tokenId) : message.tokenId; + if (message.info != null && message.hasOwnProperty("info")) + object.info = $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenIdentityInfoEntry.toObject(message.info, options); + return object; + }; + + /** + * Converts this TokenInfoEntry to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntry + * @instance + * @returns {Object.} JSON object + */ + TokenInfoEntry.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TokenInfoEntry; + })(); + + GetIdentityTokenInfosResponseV0.TokenInfos = (function() { + + /** + * Properties of a TokenInfos. + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0 + * @interface ITokenInfos + * @property {Array.|null} [tokenInfos] TokenInfos tokenInfos + */ + + /** + * Constructs a new TokenInfos. + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0 + * @classdesc Represents a TokenInfos. + * @implements ITokenInfos + * @constructor + * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.ITokenInfos=} [properties] Properties to set + */ + function TokenInfos(properties) { + this.tokenInfos = []; + 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]]; + } + + /** + * TokenInfos tokenInfos. + * @member {Array.} tokenInfos + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfos + * @instance + */ + TokenInfos.prototype.tokenInfos = $util.emptyArray; + + /** + * Creates a new TokenInfos instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfos + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.ITokenInfos=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfos} TokenInfos instance + */ + TokenInfos.create = function create(properties) { + return new TokenInfos(properties); + }; + + /** + * Encodes the specified TokenInfos message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfos.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfos + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.ITokenInfos} message TokenInfos message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenInfos.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tokenInfos != null && message.tokenInfos.length) + for (var i = 0; i < message.tokenInfos.length; ++i) + $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntry.encode(message.tokenInfos[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TokenInfos message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfos.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfos + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.ITokenInfos} message TokenInfos message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenInfos.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TokenInfos message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfos + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfos} TokenInfos + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenInfos.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.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfos(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.tokenInfos && message.tokenInfos.length)) + message.tokenInfos = []; + message.tokenInfos.push($root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntry.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TokenInfos message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfos + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfos} TokenInfos + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenInfos.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TokenInfos message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfos + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TokenInfos.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tokenInfos != null && message.hasOwnProperty("tokenInfos")) { + if (!Array.isArray(message.tokenInfos)) + return "tokenInfos: array expected"; + for (var i = 0; i < message.tokenInfos.length; ++i) { + var error = $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntry.verify(message.tokenInfos[i]); + if (error) + return "tokenInfos." + error; + } + } + return null; + }; + + /** + * Creates a TokenInfos message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfos + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfos} TokenInfos + */ + TokenInfos.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfos) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfos(); + if (object.tokenInfos) { + if (!Array.isArray(object.tokenInfos)) + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfos.tokenInfos: array expected"); + message.tokenInfos = []; + for (var i = 0; i < object.tokenInfos.length; ++i) { + if (typeof object.tokenInfos[i] !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfos.tokenInfos: object expected"); + message.tokenInfos[i] = $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntry.fromObject(object.tokenInfos[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a TokenInfos message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfos + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfos} message TokenInfos + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TokenInfos.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.tokenInfos = []; + if (message.tokenInfos && message.tokenInfos.length) { + object.tokenInfos = []; + for (var j = 0; j < message.tokenInfos.length; ++j) + object.tokenInfos[j] = $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntry.toObject(message.tokenInfos[j], options); + } + return object; + }; + + /** + * Converts this TokenInfos to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfos + * @instance + * @returns {Object.} JSON object + */ + TokenInfos.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TokenInfos; + })(); + + return GetIdentityTokenInfosResponseV0; + })(); + + return GetIdentityTokenInfosResponse; + })(); + + v0.GetIdentitiesTokenInfosRequest = (function() { + + /** + * Properties of a GetIdentitiesTokenInfosRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetIdentitiesTokenInfosRequest + * @property {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.IGetIdentitiesTokenInfosRequestV0|null} [v0] GetIdentitiesTokenInfosRequest v0 + */ + + /** + * Constructs a new GetIdentitiesTokenInfosRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetIdentitiesTokenInfosRequest. + * @implements IGetIdentitiesTokenInfosRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IGetIdentitiesTokenInfosRequest=} [properties] Properties to set + */ + function GetIdentitiesTokenInfosRequest(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]]; + } + + /** + * GetIdentitiesTokenInfosRequest v0. + * @member {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.IGetIdentitiesTokenInfosRequestV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest + * @instance + */ + GetIdentitiesTokenInfosRequest.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetIdentitiesTokenInfosRequest version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest + * @instance + */ + Object.defineProperty(GetIdentitiesTokenInfosRequest.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetIdentitiesTokenInfosRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentitiesTokenInfosRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest} GetIdentitiesTokenInfosRequest instance + */ + GetIdentitiesTokenInfosRequest.create = function create(properties) { + return new GetIdentitiesTokenInfosRequest(properties); + }; + + /** + * Encodes the specified GetIdentitiesTokenInfosRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentitiesTokenInfosRequest} message GetIdentitiesTokenInfosRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentitiesTokenInfosRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetIdentitiesTokenInfosRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentitiesTokenInfosRequest} message GetIdentitiesTokenInfosRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentitiesTokenInfosRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentitiesTokenInfosRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest} GetIdentitiesTokenInfosRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentitiesTokenInfosRequest.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.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentitiesTokenInfosRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest} GetIdentitiesTokenInfosRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentitiesTokenInfosRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentitiesTokenInfosRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentitiesTokenInfosRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetIdentitiesTokenInfosRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest} GetIdentitiesTokenInfosRequest + */ + GetIdentitiesTokenInfosRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetIdentitiesTokenInfosRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest} message GetIdentitiesTokenInfosRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentitiesTokenInfosRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetIdentitiesTokenInfosRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest + * @instance + * @returns {Object.} JSON object + */ + GetIdentitiesTokenInfosRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0 = (function() { + + /** + * Properties of a GetIdentitiesTokenInfosRequestV0. + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest + * @interface IGetIdentitiesTokenInfosRequestV0 + * @property {Uint8Array|null} [tokenId] GetIdentitiesTokenInfosRequestV0 tokenId + * @property {Array.|null} [identityIds] GetIdentitiesTokenInfosRequestV0 identityIds + * @property {boolean|null} [prove] GetIdentitiesTokenInfosRequestV0 prove + */ + + /** + * Constructs a new GetIdentitiesTokenInfosRequestV0. + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest + * @classdesc Represents a GetIdentitiesTokenInfosRequestV0. + * @implements IGetIdentitiesTokenInfosRequestV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.IGetIdentitiesTokenInfosRequestV0=} [properties] Properties to set + */ + function GetIdentitiesTokenInfosRequestV0(properties) { + this.identityIds = []; + 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]]; + } + + /** + * GetIdentitiesTokenInfosRequestV0 tokenId. + * @member {Uint8Array} tokenId + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0 + * @instance + */ + GetIdentitiesTokenInfosRequestV0.prototype.tokenId = $util.newBuffer([]); + + /** + * GetIdentitiesTokenInfosRequestV0 identityIds. + * @member {Array.} identityIds + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0 + * @instance + */ + GetIdentitiesTokenInfosRequestV0.prototype.identityIds = $util.emptyArray; + + /** + * GetIdentitiesTokenInfosRequestV0 prove. + * @member {boolean} prove + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0 + * @instance + */ + GetIdentitiesTokenInfosRequestV0.prototype.prove = false; + + /** + * Creates a new GetIdentitiesTokenInfosRequestV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.IGetIdentitiesTokenInfosRequestV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0} GetIdentitiesTokenInfosRequestV0 instance + */ + GetIdentitiesTokenInfosRequestV0.create = function create(properties) { + return new GetIdentitiesTokenInfosRequestV0(properties); + }; + + /** + * Encodes the specified GetIdentitiesTokenInfosRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.IGetIdentitiesTokenInfosRequestV0} message GetIdentitiesTokenInfosRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentitiesTokenInfosRequestV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tokenId != null && Object.hasOwnProperty.call(message, "tokenId")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.tokenId); + if (message.identityIds != null && message.identityIds.length) + for (var i = 0; i < message.identityIds.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.identityIds[i]); + if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.prove); + return writer; + }; + + /** + * Encodes the specified GetIdentitiesTokenInfosRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.IGetIdentitiesTokenInfosRequestV0} message GetIdentitiesTokenInfosRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentitiesTokenInfosRequestV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentitiesTokenInfosRequestV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0} GetIdentitiesTokenInfosRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentitiesTokenInfosRequestV0.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.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tokenId = reader.bytes(); + break; + case 2: + if (!(message.identityIds && message.identityIds.length)) + message.identityIds = []; + message.identityIds.push(reader.bytes()); + break; + case 3: + message.prove = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentitiesTokenInfosRequestV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0} GetIdentitiesTokenInfosRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentitiesTokenInfosRequestV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentitiesTokenInfosRequestV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentitiesTokenInfosRequestV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tokenId != null && message.hasOwnProperty("tokenId")) + if (!(message.tokenId && typeof message.tokenId.length === "number" || $util.isString(message.tokenId))) + return "tokenId: buffer expected"; + if (message.identityIds != null && message.hasOwnProperty("identityIds")) { + if (!Array.isArray(message.identityIds)) + return "identityIds: array expected"; + for (var i = 0; i < message.identityIds.length; ++i) + if (!(message.identityIds[i] && typeof message.identityIds[i].length === "number" || $util.isString(message.identityIds[i]))) + return "identityIds: buffer[] expected"; + } + if (message.prove != null && message.hasOwnProperty("prove")) + if (typeof message.prove !== "boolean") + return "prove: boolean expected"; + return null; + }; + + /** + * Creates a GetIdentitiesTokenInfosRequestV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0} GetIdentitiesTokenInfosRequestV0 + */ + GetIdentitiesTokenInfosRequestV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0(); + if (object.tokenId != null) + if (typeof object.tokenId === "string") + $util.base64.decode(object.tokenId, message.tokenId = $util.newBuffer($util.base64.length(object.tokenId)), 0); + else if (object.tokenId.length >= 0) + message.tokenId = object.tokenId; + if (object.identityIds) { + if (!Array.isArray(object.identityIds)) + throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0.identityIds: array expected"); + message.identityIds = []; + for (var i = 0; i < object.identityIds.length; ++i) + if (typeof object.identityIds[i] === "string") + $util.base64.decode(object.identityIds[i], message.identityIds[i] = $util.newBuffer($util.base64.length(object.identityIds[i])), 0); + else if (object.identityIds[i].length >= 0) + message.identityIds[i] = object.identityIds[i]; + } + if (object.prove != null) + message.prove = Boolean(object.prove); + return message; + }; + + /** + * Creates a plain object from a GetIdentitiesTokenInfosRequestV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0} message GetIdentitiesTokenInfosRequestV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentitiesTokenInfosRequestV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.identityIds = []; + if (options.defaults) { + if (options.bytes === String) + object.tokenId = ""; + else { + object.tokenId = []; + if (options.bytes !== Array) + object.tokenId = $util.newBuffer(object.tokenId); + } + object.prove = false; + } + if (message.tokenId != null && message.hasOwnProperty("tokenId")) + object.tokenId = options.bytes === String ? $util.base64.encode(message.tokenId, 0, message.tokenId.length) : options.bytes === Array ? Array.prototype.slice.call(message.tokenId) : message.tokenId; + if (message.identityIds && message.identityIds.length) { + object.identityIds = []; + for (var j = 0; j < message.identityIds.length; ++j) + object.identityIds[j] = options.bytes === String ? $util.base64.encode(message.identityIds[j], 0, message.identityIds[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.identityIds[j]) : message.identityIds[j]; + } + if (message.prove != null && message.hasOwnProperty("prove")) + object.prove = message.prove; + return object; + }; + + /** + * Converts this GetIdentitiesTokenInfosRequestV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0 + * @instance + * @returns {Object.} JSON object + */ + GetIdentitiesTokenInfosRequestV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetIdentitiesTokenInfosRequestV0; + })(); + + return GetIdentitiesTokenInfosRequest; + })(); + + v0.GetIdentitiesTokenInfosResponse = (function() { + + /** + * Properties of a GetIdentitiesTokenInfosResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetIdentitiesTokenInfosResponse + * @property {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.IGetIdentitiesTokenInfosResponseV0|null} [v0] GetIdentitiesTokenInfosResponse v0 + */ + + /** + * Constructs a new GetIdentitiesTokenInfosResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetIdentitiesTokenInfosResponse. + * @implements IGetIdentitiesTokenInfosResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IGetIdentitiesTokenInfosResponse=} [properties] Properties to set + */ + function GetIdentitiesTokenInfosResponse(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]]; + } + + /** + * GetIdentitiesTokenInfosResponse v0. + * @member {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.IGetIdentitiesTokenInfosResponseV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse + * @instance + */ + GetIdentitiesTokenInfosResponse.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetIdentitiesTokenInfosResponse version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse + * @instance + */ + Object.defineProperty(GetIdentitiesTokenInfosResponse.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetIdentitiesTokenInfosResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentitiesTokenInfosResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse} GetIdentitiesTokenInfosResponse instance + */ + GetIdentitiesTokenInfosResponse.create = function create(properties) { + return new GetIdentitiesTokenInfosResponse(properties); + }; + + /** + * Encodes the specified GetIdentitiesTokenInfosResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentitiesTokenInfosResponse} message GetIdentitiesTokenInfosResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentitiesTokenInfosResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetIdentitiesTokenInfosResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentitiesTokenInfosResponse} message GetIdentitiesTokenInfosResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentitiesTokenInfosResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentitiesTokenInfosResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse} GetIdentitiesTokenInfosResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentitiesTokenInfosResponse.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.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentitiesTokenInfosResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse} GetIdentitiesTokenInfosResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentitiesTokenInfosResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentitiesTokenInfosResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentitiesTokenInfosResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetIdentitiesTokenInfosResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse} GetIdentitiesTokenInfosResponse + */ + GetIdentitiesTokenInfosResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetIdentitiesTokenInfosResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse} message GetIdentitiesTokenInfosResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentitiesTokenInfosResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetIdentitiesTokenInfosResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse + * @instance + * @returns {Object.} JSON object + */ + GetIdentitiesTokenInfosResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0 = (function() { + + /** + * Properties of a GetIdentitiesTokenInfosResponseV0. + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse + * @interface IGetIdentitiesTokenInfosResponseV0 + * @property {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IIdentityTokenInfos|null} [identityTokenInfos] GetIdentitiesTokenInfosResponseV0 identityTokenInfos + * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetIdentitiesTokenInfosResponseV0 proof + * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetIdentitiesTokenInfosResponseV0 metadata + */ + + /** + * Constructs a new GetIdentitiesTokenInfosResponseV0. + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse + * @classdesc Represents a GetIdentitiesTokenInfosResponseV0. + * @implements IGetIdentitiesTokenInfosResponseV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.IGetIdentitiesTokenInfosResponseV0=} [properties] Properties to set + */ + function GetIdentitiesTokenInfosResponseV0(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]]; + } + + /** + * GetIdentitiesTokenInfosResponseV0 identityTokenInfos. + * @member {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IIdentityTokenInfos|null|undefined} identityTokenInfos + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0 + * @instance + */ + GetIdentitiesTokenInfosResponseV0.prototype.identityTokenInfos = null; + + /** + * GetIdentitiesTokenInfosResponseV0 proof. + * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0 + * @instance + */ + GetIdentitiesTokenInfosResponseV0.prototype.proof = null; + + /** + * GetIdentitiesTokenInfosResponseV0 metadata. + * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0 + * @instance + */ + GetIdentitiesTokenInfosResponseV0.prototype.metadata = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetIdentitiesTokenInfosResponseV0 result. + * @member {"identityTokenInfos"|"proof"|undefined} result + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0 + * @instance + */ + Object.defineProperty(GetIdentitiesTokenInfosResponseV0.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["identityTokenInfos", "proof"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetIdentitiesTokenInfosResponseV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.IGetIdentitiesTokenInfosResponseV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0} GetIdentitiesTokenInfosResponseV0 instance + */ + GetIdentitiesTokenInfosResponseV0.create = function create(properties) { + return new GetIdentitiesTokenInfosResponseV0(properties); + }; + + /** + * Encodes the specified GetIdentitiesTokenInfosResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.IGetIdentitiesTokenInfosResponseV0} message GetIdentitiesTokenInfosResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentitiesTokenInfosResponseV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.identityTokenInfos != null && Object.hasOwnProperty.call(message, "identityTokenInfos")) + $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos.encode(message.identityTokenInfos, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetIdentitiesTokenInfosResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.IGetIdentitiesTokenInfosResponseV0} message GetIdentitiesTokenInfosResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentitiesTokenInfosResponseV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentitiesTokenInfosResponseV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0} GetIdentitiesTokenInfosResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentitiesTokenInfosResponseV0.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.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.identityTokenInfos = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos.decode(reader, reader.uint32()); + break; + case 2: + message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); + break; + case 3: + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentitiesTokenInfosResponseV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0} GetIdentitiesTokenInfosResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentitiesTokenInfosResponseV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentitiesTokenInfosResponseV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentitiesTokenInfosResponseV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.identityTokenInfos != null && message.hasOwnProperty("identityTokenInfos")) { + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos.verify(message.identityTokenInfos); + if (error) + return "identityTokenInfos." + error; + } + } + if (message.proof != null && message.hasOwnProperty("proof")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); + if (error) + return "proof." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a GetIdentitiesTokenInfosResponseV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0} GetIdentitiesTokenInfosResponseV0 + */ + GetIdentitiesTokenInfosResponseV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0(); + if (object.identityTokenInfos != null) { + if (typeof object.identityTokenInfos !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.identityTokenInfos: object expected"); + message.identityTokenInfos = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos.fromObject(object.identityTokenInfos); + } + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.proof: object expected"); + message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.metadata: object expected"); + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a GetIdentitiesTokenInfosResponseV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0} message GetIdentitiesTokenInfosResponseV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentitiesTokenInfosResponseV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.metadata = null; + if (message.identityTokenInfos != null && message.hasOwnProperty("identityTokenInfos")) { + object.identityTokenInfos = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos.toObject(message.identityTokenInfos, options); + if (options.oneofs) + object.result = "identityTokenInfos"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); + if (options.oneofs) + object.result = "proof"; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this GetIdentitiesTokenInfosResponseV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0 + * @instance + * @returns {Object.} JSON object + */ + GetIdentitiesTokenInfosResponseV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetIdentitiesTokenInfosResponseV0.TokenIdentityInfoEntry = (function() { + + /** + * Properties of a TokenIdentityInfoEntry. + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0 + * @interface ITokenIdentityInfoEntry + * @property {boolean|null} [frozen] TokenIdentityInfoEntry frozen + */ + + /** + * Constructs a new TokenIdentityInfoEntry. + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0 + * @classdesc Represents a TokenIdentityInfoEntry. + * @implements ITokenIdentityInfoEntry + * @constructor + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.ITokenIdentityInfoEntry=} [properties] Properties to set + */ + function TokenIdentityInfoEntry(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]]; + } + + /** + * TokenIdentityInfoEntry frozen. + * @member {boolean} frozen + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenIdentityInfoEntry + * @instance + */ + TokenIdentityInfoEntry.prototype.frozen = false; + + /** + * Creates a new TokenIdentityInfoEntry instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenIdentityInfoEntry + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.ITokenIdentityInfoEntry=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenIdentityInfoEntry} TokenIdentityInfoEntry instance + */ + TokenIdentityInfoEntry.create = function create(properties) { + return new TokenIdentityInfoEntry(properties); + }; + + /** + * Encodes the specified TokenIdentityInfoEntry message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenIdentityInfoEntry.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenIdentityInfoEntry + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.ITokenIdentityInfoEntry} message TokenIdentityInfoEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenIdentityInfoEntry.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.frozen != null && Object.hasOwnProperty.call(message, "frozen")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.frozen); + return writer; + }; + + /** + * Encodes the specified TokenIdentityInfoEntry message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenIdentityInfoEntry.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenIdentityInfoEntry + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.ITokenIdentityInfoEntry} message TokenIdentityInfoEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenIdentityInfoEntry.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TokenIdentityInfoEntry message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenIdentityInfoEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenIdentityInfoEntry} TokenIdentityInfoEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenIdentityInfoEntry.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.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenIdentityInfoEntry(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.frozen = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TokenIdentityInfoEntry message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenIdentityInfoEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenIdentityInfoEntry} TokenIdentityInfoEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenIdentityInfoEntry.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TokenIdentityInfoEntry message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenIdentityInfoEntry + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TokenIdentityInfoEntry.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.frozen != null && message.hasOwnProperty("frozen")) + if (typeof message.frozen !== "boolean") + return "frozen: boolean expected"; + return null; + }; + + /** + * Creates a TokenIdentityInfoEntry message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenIdentityInfoEntry + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenIdentityInfoEntry} TokenIdentityInfoEntry + */ + TokenIdentityInfoEntry.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenIdentityInfoEntry) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenIdentityInfoEntry(); + if (object.frozen != null) + message.frozen = Boolean(object.frozen); + return message; + }; + + /** + * Creates a plain object from a TokenIdentityInfoEntry message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenIdentityInfoEntry + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenIdentityInfoEntry} message TokenIdentityInfoEntry + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TokenIdentityInfoEntry.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.frozen = false; + if (message.frozen != null && message.hasOwnProperty("frozen")) + object.frozen = message.frozen; + return object; + }; + + /** + * Converts this TokenIdentityInfoEntry to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenIdentityInfoEntry + * @instance + * @returns {Object.} JSON object + */ + TokenIdentityInfoEntry.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TokenIdentityInfoEntry; + })(); + + GetIdentitiesTokenInfosResponseV0.TokenInfoEntry = (function() { + + /** + * Properties of a TokenInfoEntry. + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0 + * @interface ITokenInfoEntry + * @property {Uint8Array|null} [identityId] TokenInfoEntry identityId + * @property {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.ITokenIdentityInfoEntry|null} [info] TokenInfoEntry info + */ + + /** + * Constructs a new TokenInfoEntry. + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0 + * @classdesc Represents a TokenInfoEntry. + * @implements ITokenInfoEntry + * @constructor + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.ITokenInfoEntry=} [properties] Properties to set + */ + function TokenInfoEntry(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]]; + } + + /** + * TokenInfoEntry identityId. + * @member {Uint8Array} identityId + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntry + * @instance + */ + TokenInfoEntry.prototype.identityId = $util.newBuffer([]); + + /** + * TokenInfoEntry info. + * @member {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.ITokenIdentityInfoEntry|null|undefined} info + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntry + * @instance + */ + TokenInfoEntry.prototype.info = null; + + /** + * Creates a new TokenInfoEntry instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntry + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.ITokenInfoEntry=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntry} TokenInfoEntry instance + */ + TokenInfoEntry.create = function create(properties) { + return new TokenInfoEntry(properties); + }; + + /** + * Encodes the specified TokenInfoEntry message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntry.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntry + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.ITokenInfoEntry} message TokenInfoEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenInfoEntry.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.identityId != null && Object.hasOwnProperty.call(message, "identityId")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.identityId); + if (message.info != null && Object.hasOwnProperty.call(message, "info")) + $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenIdentityInfoEntry.encode(message.info, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TokenInfoEntry message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntry.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntry + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.ITokenInfoEntry} message TokenInfoEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenInfoEntry.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TokenInfoEntry message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntry} TokenInfoEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenInfoEntry.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.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntry(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.identityId = reader.bytes(); + break; + case 2: + message.info = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenIdentityInfoEntry.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TokenInfoEntry message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntry} TokenInfoEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenInfoEntry.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TokenInfoEntry message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntry + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TokenInfoEntry.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.identityId != null && message.hasOwnProperty("identityId")) + if (!(message.identityId && typeof message.identityId.length === "number" || $util.isString(message.identityId))) + return "identityId: buffer expected"; + if (message.info != null && message.hasOwnProperty("info")) { + var error = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenIdentityInfoEntry.verify(message.info); + if (error) + return "info." + error; + } + return null; + }; + + /** + * Creates a TokenInfoEntry message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntry + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntry} TokenInfoEntry + */ + TokenInfoEntry.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntry) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntry(); + if (object.identityId != null) + if (typeof object.identityId === "string") + $util.base64.decode(object.identityId, message.identityId = $util.newBuffer($util.base64.length(object.identityId)), 0); + else if (object.identityId.length >= 0) + message.identityId = object.identityId; + if (object.info != null) { + if (typeof object.info !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntry.info: object expected"); + message.info = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenIdentityInfoEntry.fromObject(object.info); + } + return message; + }; + + /** + * Creates a plain object from a TokenInfoEntry message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntry + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntry} message TokenInfoEntry + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TokenInfoEntry.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.identityId = ""; + else { + object.identityId = []; + if (options.bytes !== Array) + object.identityId = $util.newBuffer(object.identityId); + } + object.info = null; + } + if (message.identityId != null && message.hasOwnProperty("identityId")) + object.identityId = options.bytes === String ? $util.base64.encode(message.identityId, 0, message.identityId.length) : options.bytes === Array ? Array.prototype.slice.call(message.identityId) : message.identityId; + if (message.info != null && message.hasOwnProperty("info")) + object.info = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenIdentityInfoEntry.toObject(message.info, options); + return object; + }; + + /** + * Converts this TokenInfoEntry to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntry + * @instance + * @returns {Object.} JSON object + */ + TokenInfoEntry.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TokenInfoEntry; + })(); + + GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos = (function() { + + /** + * Properties of an IdentityTokenInfos. + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0 + * @interface IIdentityTokenInfos + * @property {Array.|null} [tokenInfos] IdentityTokenInfos tokenInfos + */ + + /** + * Constructs a new IdentityTokenInfos. + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0 + * @classdesc Represents an IdentityTokenInfos. + * @implements IIdentityTokenInfos + * @constructor + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IIdentityTokenInfos=} [properties] Properties to set + */ + function IdentityTokenInfos(properties) { + this.tokenInfos = []; + 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]]; + } + + /** + * IdentityTokenInfos tokenInfos. + * @member {Array.} tokenInfos + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos + * @instance + */ + IdentityTokenInfos.prototype.tokenInfos = $util.emptyArray; + + /** + * Creates a new IdentityTokenInfos instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IIdentityTokenInfos=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos} IdentityTokenInfos instance + */ + IdentityTokenInfos.create = function create(properties) { + return new IdentityTokenInfos(properties); + }; + + /** + * Encodes the specified IdentityTokenInfos message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IIdentityTokenInfos} message IdentityTokenInfos message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IdentityTokenInfos.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tokenInfos != null && message.tokenInfos.length) + for (var i = 0; i < message.tokenInfos.length; ++i) + $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntry.encode(message.tokenInfos[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified IdentityTokenInfos message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IIdentityTokenInfos} message IdentityTokenInfos message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IdentityTokenInfos.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IdentityTokenInfos message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos} IdentityTokenInfos + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IdentityTokenInfos.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.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.tokenInfos && message.tokenInfos.length)) + message.tokenInfos = []; + message.tokenInfos.push($root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntry.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IdentityTokenInfos message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos} IdentityTokenInfos + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IdentityTokenInfos.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IdentityTokenInfos message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IdentityTokenInfos.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tokenInfos != null && message.hasOwnProperty("tokenInfos")) { + if (!Array.isArray(message.tokenInfos)) + return "tokenInfos: array expected"; + for (var i = 0; i < message.tokenInfos.length; ++i) { + var error = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntry.verify(message.tokenInfos[i]); + if (error) + return "tokenInfos." + error; + } + } + return null; + }; + + /** + * Creates an IdentityTokenInfos message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos} IdentityTokenInfos + */ + IdentityTokenInfos.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos(); + if (object.tokenInfos) { + if (!Array.isArray(object.tokenInfos)) + throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos.tokenInfos: array expected"); + message.tokenInfos = []; + for (var i = 0; i < object.tokenInfos.length; ++i) { + if (typeof object.tokenInfos[i] !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos.tokenInfos: object expected"); + message.tokenInfos[i] = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntry.fromObject(object.tokenInfos[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an IdentityTokenInfos message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos} message IdentityTokenInfos + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IdentityTokenInfos.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.tokenInfos = []; + if (message.tokenInfos && message.tokenInfos.length) { + object.tokenInfos = []; + for (var j = 0; j < message.tokenInfos.length; ++j) + object.tokenInfos[j] = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntry.toObject(message.tokenInfos[j], options); + } + return object; + }; + + /** + * Converts this IdentityTokenInfos to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos + * @instance + * @returns {Object.} JSON object + */ + IdentityTokenInfos.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return IdentityTokenInfos; + })(); + + return GetIdentitiesTokenInfosResponseV0; + })(); + + return GetIdentitiesTokenInfosResponse; + })(); + + v0.GetTokenStatusesRequest = (function() { + + /** + * Properties of a GetTokenStatusesRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetTokenStatusesRequest + * @property {org.dash.platform.dapi.v0.GetTokenStatusesRequest.IGetTokenStatusesRequestV0|null} [v0] GetTokenStatusesRequest v0 + */ + + /** + * Constructs a new GetTokenStatusesRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetTokenStatusesRequest. + * @implements IGetTokenStatusesRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IGetTokenStatusesRequest=} [properties] Properties to set + */ + function GetTokenStatusesRequest(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]]; + } + + /** + * GetTokenStatusesRequest v0. + * @member {org.dash.platform.dapi.v0.GetTokenStatusesRequest.IGetTokenStatusesRequestV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesRequest + * @instance + */ + GetTokenStatusesRequest.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetTokenStatusesRequest version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesRequest + * @instance + */ + Object.defineProperty(GetTokenStatusesRequest.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetTokenStatusesRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetTokenStatusesRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetTokenStatusesRequest} GetTokenStatusesRequest instance + */ + GetTokenStatusesRequest.create = function create(properties) { + return new GetTokenStatusesRequest(properties); + }; + + /** + * Encodes the specified GetTokenStatusesRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenStatusesRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetTokenStatusesRequest} message GetTokenStatusesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTokenStatusesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetTokenStatusesRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenStatusesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetTokenStatusesRequest} message GetTokenStatusesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTokenStatusesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetTokenStatusesRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetTokenStatusesRequest} GetTokenStatusesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTokenStatusesRequest.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.org.dash.platform.dapi.v0.GetTokenStatusesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetTokenStatusesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetTokenStatusesRequest} GetTokenStatusesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTokenStatusesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetTokenStatusesRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetTokenStatusesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetTokenStatusesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetTokenStatusesRequest} GetTokenStatusesRequest + */ + GetTokenStatusesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetTokenStatusesRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetTokenStatusesRequest(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetTokenStatusesRequest.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetTokenStatusesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesRequest + * @static + * @param {org.dash.platform.dapi.v0.GetTokenStatusesRequest} message GetTokenStatusesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetTokenStatusesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetTokenStatusesRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesRequest + * @instance + * @returns {Object.} JSON object + */ + GetTokenStatusesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetTokenStatusesRequest.GetTokenStatusesRequestV0 = (function() { + + /** + * Properties of a GetTokenStatusesRequestV0. + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesRequest + * @interface IGetTokenStatusesRequestV0 + * @property {Array.|null} [tokenIds] GetTokenStatusesRequestV0 tokenIds + * @property {boolean|null} [prove] GetTokenStatusesRequestV0 prove + */ + + /** + * Constructs a new GetTokenStatusesRequestV0. + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesRequest + * @classdesc Represents a GetTokenStatusesRequestV0. + * @implements IGetTokenStatusesRequestV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetTokenStatusesRequest.IGetTokenStatusesRequestV0=} [properties] Properties to set + */ + function GetTokenStatusesRequestV0(properties) { + this.tokenIds = []; + 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]]; + } + + /** + * GetTokenStatusesRequestV0 tokenIds. + * @member {Array.} tokenIds + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0 + * @instance + */ + GetTokenStatusesRequestV0.prototype.tokenIds = $util.emptyArray; + + /** + * GetTokenStatusesRequestV0 prove. + * @member {boolean} prove + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0 + * @instance + */ + GetTokenStatusesRequestV0.prototype.prove = false; + + /** + * Creates a new GetTokenStatusesRequestV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetTokenStatusesRequest.IGetTokenStatusesRequestV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0} GetTokenStatusesRequestV0 instance + */ + GetTokenStatusesRequestV0.create = function create(properties) { + return new GetTokenStatusesRequestV0(properties); + }; + + /** + * Encodes the specified GetTokenStatusesRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetTokenStatusesRequest.IGetTokenStatusesRequestV0} message GetTokenStatusesRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTokenStatusesRequestV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tokenIds != null && message.tokenIds.length) + for (var i = 0; i < message.tokenIds.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.tokenIds[i]); + if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.prove); + return writer; + }; + + /** + * Encodes the specified GetTokenStatusesRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetTokenStatusesRequest.IGetTokenStatusesRequestV0} message GetTokenStatusesRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTokenStatusesRequestV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetTokenStatusesRequestV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0} GetTokenStatusesRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTokenStatusesRequestV0.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.org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.tokenIds && message.tokenIds.length)) + message.tokenIds = []; + message.tokenIds.push(reader.bytes()); + break; + case 2: + message.prove = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetTokenStatusesRequestV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0} GetTokenStatusesRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTokenStatusesRequestV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetTokenStatusesRequestV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetTokenStatusesRequestV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tokenIds != null && message.hasOwnProperty("tokenIds")) { + if (!Array.isArray(message.tokenIds)) + return "tokenIds: array expected"; + for (var i = 0; i < message.tokenIds.length; ++i) + if (!(message.tokenIds[i] && typeof message.tokenIds[i].length === "number" || $util.isString(message.tokenIds[i]))) + return "tokenIds: buffer[] expected"; + } + if (message.prove != null && message.hasOwnProperty("prove")) + if (typeof message.prove !== "boolean") + return "prove: boolean expected"; + return null; + }; + + /** + * Creates a GetTokenStatusesRequestV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0} GetTokenStatusesRequestV0 + */ + GetTokenStatusesRequestV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0(); + if (object.tokenIds) { + if (!Array.isArray(object.tokenIds)) + throw TypeError(".org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0.tokenIds: array expected"); + message.tokenIds = []; + for (var i = 0; i < object.tokenIds.length; ++i) + if (typeof object.tokenIds[i] === "string") + $util.base64.decode(object.tokenIds[i], message.tokenIds[i] = $util.newBuffer($util.base64.length(object.tokenIds[i])), 0); + else if (object.tokenIds[i].length >= 0) + message.tokenIds[i] = object.tokenIds[i]; + } + if (object.prove != null) + message.prove = Boolean(object.prove); + return message; + }; + + /** + * Creates a plain object from a GetTokenStatusesRequestV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0} message GetTokenStatusesRequestV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetTokenStatusesRequestV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.tokenIds = []; + if (options.defaults) + object.prove = false; + if (message.tokenIds && message.tokenIds.length) { + object.tokenIds = []; + for (var j = 0; j < message.tokenIds.length; ++j) + object.tokenIds[j] = options.bytes === String ? $util.base64.encode(message.tokenIds[j], 0, message.tokenIds[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.tokenIds[j]) : message.tokenIds[j]; + } + if (message.prove != null && message.hasOwnProperty("prove")) + object.prove = message.prove; + return object; + }; + + /** + * Converts this GetTokenStatusesRequestV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0 + * @instance + * @returns {Object.} JSON object + */ + GetTokenStatusesRequestV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetTokenStatusesRequestV0; + })(); + + return GetTokenStatusesRequest; + })(); + + v0.GetTokenStatusesResponse = (function() { + + /** + * Properties of a GetTokenStatusesResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetTokenStatusesResponse + * @property {org.dash.platform.dapi.v0.GetTokenStatusesResponse.IGetTokenStatusesResponseV0|null} [v0] GetTokenStatusesResponse v0 + */ + + /** + * Constructs a new GetTokenStatusesResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetTokenStatusesResponse. + * @implements IGetTokenStatusesResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IGetTokenStatusesResponse=} [properties] Properties to set + */ + function GetTokenStatusesResponse(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]]; + } + + /** + * GetTokenStatusesResponse v0. + * @member {org.dash.platform.dapi.v0.GetTokenStatusesResponse.IGetTokenStatusesResponseV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse + * @instance + */ + GetTokenStatusesResponse.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetTokenStatusesResponse version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse + * @instance + */ + Object.defineProperty(GetTokenStatusesResponse.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetTokenStatusesResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetTokenStatusesResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetTokenStatusesResponse} GetTokenStatusesResponse instance + */ + GetTokenStatusesResponse.create = function create(properties) { + return new GetTokenStatusesResponse(properties); + }; + + /** + * Encodes the specified GetTokenStatusesResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenStatusesResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetTokenStatusesResponse} message GetTokenStatusesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTokenStatusesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetTokenStatusesResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenStatusesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetTokenStatusesResponse} message GetTokenStatusesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTokenStatusesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetTokenStatusesResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetTokenStatusesResponse} GetTokenStatusesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTokenStatusesResponse.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.org.dash.platform.dapi.v0.GetTokenStatusesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetTokenStatusesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetTokenStatusesResponse} GetTokenStatusesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTokenStatusesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetTokenStatusesResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetTokenStatusesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetTokenStatusesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetTokenStatusesResponse} GetTokenStatusesResponse + */ + GetTokenStatusesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetTokenStatusesResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetTokenStatusesResponse(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetTokenStatusesResponse.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetTokenStatusesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse + * @static + * @param {org.dash.platform.dapi.v0.GetTokenStatusesResponse} message GetTokenStatusesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetTokenStatusesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetTokenStatusesResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse + * @instance + * @returns {Object.} JSON object + */ + GetTokenStatusesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetTokenStatusesResponse.GetTokenStatusesResponseV0 = (function() { + + /** + * Properties of a GetTokenStatusesResponseV0. + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse + * @interface IGetTokenStatusesResponseV0 + * @property {org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.ITokenStatuses|null} [tokenStatuses] GetTokenStatusesResponseV0 tokenStatuses + * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetTokenStatusesResponseV0 proof + * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetTokenStatusesResponseV0 metadata + */ + + /** + * Constructs a new GetTokenStatusesResponseV0. + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse + * @classdesc Represents a GetTokenStatusesResponseV0. + * @implements IGetTokenStatusesResponseV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetTokenStatusesResponse.IGetTokenStatusesResponseV0=} [properties] Properties to set + */ + function GetTokenStatusesResponseV0(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]]; + } + + /** + * GetTokenStatusesResponseV0 tokenStatuses. + * @member {org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.ITokenStatuses|null|undefined} tokenStatuses + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0 + * @instance + */ + GetTokenStatusesResponseV0.prototype.tokenStatuses = null; + + /** + * GetTokenStatusesResponseV0 proof. + * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0 + * @instance + */ + GetTokenStatusesResponseV0.prototype.proof = null; + + /** + * GetTokenStatusesResponseV0 metadata. + * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0 + * @instance + */ + GetTokenStatusesResponseV0.prototype.metadata = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetTokenStatusesResponseV0 result. + * @member {"tokenStatuses"|"proof"|undefined} result + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0 + * @instance + */ + Object.defineProperty(GetTokenStatusesResponseV0.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["tokenStatuses", "proof"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetTokenStatusesResponseV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetTokenStatusesResponse.IGetTokenStatusesResponseV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0} GetTokenStatusesResponseV0 instance + */ + GetTokenStatusesResponseV0.create = function create(properties) { + return new GetTokenStatusesResponseV0(properties); + }; + + /** + * Encodes the specified GetTokenStatusesResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetTokenStatusesResponse.IGetTokenStatusesResponseV0} message GetTokenStatusesResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTokenStatusesResponseV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tokenStatuses != null && Object.hasOwnProperty.call(message, "tokenStatuses")) + $root.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses.encode(message.tokenStatuses, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetTokenStatusesResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetTokenStatusesResponse.IGetTokenStatusesResponseV0} message GetTokenStatusesResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTokenStatusesResponseV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetTokenStatusesResponseV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0} GetTokenStatusesResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTokenStatusesResponseV0.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.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tokenStatuses = $root.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses.decode(reader, reader.uint32()); + break; + case 2: + message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); + break; + case 3: + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetTokenStatusesResponseV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0} GetTokenStatusesResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTokenStatusesResponseV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetTokenStatusesResponseV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetTokenStatusesResponseV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.tokenStatuses != null && message.hasOwnProperty("tokenStatuses")) { + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses.verify(message.tokenStatuses); + if (error) + return "tokenStatuses." + error; + } + } + if (message.proof != null && message.hasOwnProperty("proof")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); + if (error) + return "proof." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a GetTokenStatusesResponseV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0} GetTokenStatusesResponseV0 + */ + GetTokenStatusesResponseV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0(); + if (object.tokenStatuses != null) { + if (typeof object.tokenStatuses !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.tokenStatuses: object expected"); + message.tokenStatuses = $root.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses.fromObject(object.tokenStatuses); + } + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.proof: object expected"); + message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.metadata: object expected"); + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a GetTokenStatusesResponseV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0} message GetTokenStatusesResponseV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetTokenStatusesResponseV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.metadata = null; + if (message.tokenStatuses != null && message.hasOwnProperty("tokenStatuses")) { + object.tokenStatuses = $root.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses.toObject(message.tokenStatuses, options); + if (options.oneofs) + object.result = "tokenStatuses"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); + if (options.oneofs) + object.result = "proof"; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this GetTokenStatusesResponseV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0 + * @instance + * @returns {Object.} JSON object + */ + GetTokenStatusesResponseV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetTokenStatusesResponseV0.TokenStatusEntry = (function() { + + /** + * Properties of a TokenStatusEntry. + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0 + * @interface ITokenStatusEntry + * @property {Uint8Array|null} [tokenId] TokenStatusEntry tokenId + * @property {boolean|null} [paused] TokenStatusEntry paused + */ + + /** + * Constructs a new TokenStatusEntry. + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0 + * @classdesc Represents a TokenStatusEntry. + * @implements ITokenStatusEntry + * @constructor + * @param {org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.ITokenStatusEntry=} [properties] Properties to set + */ + function TokenStatusEntry(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]]; + } + + /** + * TokenStatusEntry tokenId. + * @member {Uint8Array} tokenId + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntry + * @instance + */ + TokenStatusEntry.prototype.tokenId = $util.newBuffer([]); + + /** + * TokenStatusEntry paused. + * @member {boolean} paused + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntry + * @instance + */ + TokenStatusEntry.prototype.paused = false; + + /** + * Creates a new TokenStatusEntry instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntry + * @static + * @param {org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.ITokenStatusEntry=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntry} TokenStatusEntry instance + */ + TokenStatusEntry.create = function create(properties) { + return new TokenStatusEntry(properties); + }; + + /** + * Encodes the specified TokenStatusEntry message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntry.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntry + * @static + * @param {org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.ITokenStatusEntry} message TokenStatusEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenStatusEntry.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tokenId != null && Object.hasOwnProperty.call(message, "tokenId")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.tokenId); + if (message.paused != null && Object.hasOwnProperty.call(message, "paused")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.paused); + return writer; + }; + + /** + * Encodes the specified TokenStatusEntry message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntry.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntry + * @static + * @param {org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.ITokenStatusEntry} message TokenStatusEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenStatusEntry.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TokenStatusEntry message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntry} TokenStatusEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenStatusEntry.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.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntry(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tokenId = reader.bytes(); + break; + case 2: + message.paused = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TokenStatusEntry message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntry} TokenStatusEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenStatusEntry.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TokenStatusEntry message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntry + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TokenStatusEntry.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tokenId != null && message.hasOwnProperty("tokenId")) + if (!(message.tokenId && typeof message.tokenId.length === "number" || $util.isString(message.tokenId))) + return "tokenId: buffer expected"; + if (message.paused != null && message.hasOwnProperty("paused")) + if (typeof message.paused !== "boolean") + return "paused: boolean expected"; + return null; + }; + + /** + * Creates a TokenStatusEntry message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntry + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntry} TokenStatusEntry + */ + TokenStatusEntry.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntry) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntry(); + if (object.tokenId != null) + if (typeof object.tokenId === "string") + $util.base64.decode(object.tokenId, message.tokenId = $util.newBuffer($util.base64.length(object.tokenId)), 0); + else if (object.tokenId.length >= 0) + message.tokenId = object.tokenId; + if (object.paused != null) + message.paused = Boolean(object.paused); + return message; + }; + + /** + * Creates a plain object from a TokenStatusEntry message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntry + * @static + * @param {org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntry} message TokenStatusEntry + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TokenStatusEntry.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.tokenId = ""; + else { + object.tokenId = []; + if (options.bytes !== Array) + object.tokenId = $util.newBuffer(object.tokenId); + } + object.paused = false; + } + if (message.tokenId != null && message.hasOwnProperty("tokenId")) + object.tokenId = options.bytes === String ? $util.base64.encode(message.tokenId, 0, message.tokenId.length) : options.bytes === Array ? Array.prototype.slice.call(message.tokenId) : message.tokenId; + if (message.paused != null && message.hasOwnProperty("paused")) + object.paused = message.paused; + return object; + }; + + /** + * Converts this TokenStatusEntry to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntry + * @instance + * @returns {Object.} JSON object + */ + TokenStatusEntry.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TokenStatusEntry; + })(); + + GetTokenStatusesResponseV0.TokenStatuses = (function() { + + /** + * Properties of a TokenStatuses. + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0 + * @interface ITokenStatuses + * @property {Array.|null} [tokenStatuses] TokenStatuses tokenStatuses + */ + + /** + * Constructs a new TokenStatuses. + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0 + * @classdesc Represents a TokenStatuses. + * @implements ITokenStatuses + * @constructor + * @param {org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.ITokenStatuses=} [properties] Properties to set + */ + function TokenStatuses(properties) { + this.tokenStatuses = []; + 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]]; + } + + /** + * TokenStatuses tokenStatuses. + * @member {Array.} tokenStatuses + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses + * @instance + */ + TokenStatuses.prototype.tokenStatuses = $util.emptyArray; + + /** + * Creates a new TokenStatuses instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses + * @static + * @param {org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.ITokenStatuses=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses} TokenStatuses instance + */ + TokenStatuses.create = function create(properties) { + return new TokenStatuses(properties); + }; + + /** + * Encodes the specified TokenStatuses message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses + * @static + * @param {org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.ITokenStatuses} message TokenStatuses message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenStatuses.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tokenStatuses != null && message.tokenStatuses.length) + for (var i = 0; i < message.tokenStatuses.length; ++i) + $root.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntry.encode(message.tokenStatuses[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TokenStatuses message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses + * @static + * @param {org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.ITokenStatuses} message TokenStatuses message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenStatuses.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TokenStatuses message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses} TokenStatuses + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenStatuses.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.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.tokenStatuses && message.tokenStatuses.length)) + message.tokenStatuses = []; + message.tokenStatuses.push($root.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntry.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TokenStatuses message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses} TokenStatuses + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenStatuses.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TokenStatuses message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TokenStatuses.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tokenStatuses != null && message.hasOwnProperty("tokenStatuses")) { + if (!Array.isArray(message.tokenStatuses)) + return "tokenStatuses: array expected"; + for (var i = 0; i < message.tokenStatuses.length; ++i) { + var error = $root.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntry.verify(message.tokenStatuses[i]); + if (error) + return "tokenStatuses." + error; + } + } + return null; + }; + + /** + * Creates a TokenStatuses message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses} TokenStatuses + */ + TokenStatuses.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses(); + if (object.tokenStatuses) { + if (!Array.isArray(object.tokenStatuses)) + throw TypeError(".org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses.tokenStatuses: array expected"); + message.tokenStatuses = []; + for (var i = 0; i < object.tokenStatuses.length; ++i) { + if (typeof object.tokenStatuses[i] !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses.tokenStatuses: object expected"); + message.tokenStatuses[i] = $root.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntry.fromObject(object.tokenStatuses[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a TokenStatuses message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses + * @static + * @param {org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses} message TokenStatuses + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TokenStatuses.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.tokenStatuses = []; + if (message.tokenStatuses && message.tokenStatuses.length) { + object.tokenStatuses = []; + for (var j = 0; j < message.tokenStatuses.length; ++j) + object.tokenStatuses[j] = $root.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntry.toObject(message.tokenStatuses[j], options); + } + return object; + }; + + /** + * Converts this TokenStatuses to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses + * @instance + * @returns {Object.} JSON object + */ + TokenStatuses.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TokenStatuses; + })(); + + return GetTokenStatusesResponseV0; + })(); + + return GetTokenStatusesResponse; + })(); + + v0.GetTokenPreProgrammedDistributionsRequest = (function() { + + /** + * Properties of a GetTokenPreProgrammedDistributionsRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetTokenPreProgrammedDistributionsRequest + * @property {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.IGetTokenPreProgrammedDistributionsRequestV0|null} [v0] GetTokenPreProgrammedDistributionsRequest v0 + */ + + /** + * Constructs a new GetTokenPreProgrammedDistributionsRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetTokenPreProgrammedDistributionsRequest. + * @implements IGetTokenPreProgrammedDistributionsRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IGetTokenPreProgrammedDistributionsRequest=} [properties] Properties to set + */ + function GetTokenPreProgrammedDistributionsRequest(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]]; + } + + /** + * GetTokenPreProgrammedDistributionsRequest v0. + * @member {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.IGetTokenPreProgrammedDistributionsRequestV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest + * @instance + */ + GetTokenPreProgrammedDistributionsRequest.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetTokenPreProgrammedDistributionsRequest version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest + * @instance + */ + Object.defineProperty(GetTokenPreProgrammedDistributionsRequest.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetTokenPreProgrammedDistributionsRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetTokenPreProgrammedDistributionsRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest} GetTokenPreProgrammedDistributionsRequest instance + */ + GetTokenPreProgrammedDistributionsRequest.create = function create(properties) { + return new GetTokenPreProgrammedDistributionsRequest(properties); + }; + + /** + * Encodes the specified GetTokenPreProgrammedDistributionsRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetTokenPreProgrammedDistributionsRequest} message GetTokenPreProgrammedDistributionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTokenPreProgrammedDistributionsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetTokenPreProgrammedDistributionsRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetTokenPreProgrammedDistributionsRequest} message GetTokenPreProgrammedDistributionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTokenPreProgrammedDistributionsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetTokenPreProgrammedDistributionsRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest} GetTokenPreProgrammedDistributionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTokenPreProgrammedDistributionsRequest.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.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetTokenPreProgrammedDistributionsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest} GetTokenPreProgrammedDistributionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTokenPreProgrammedDistributionsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetTokenPreProgrammedDistributionsRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetTokenPreProgrammedDistributionsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetTokenPreProgrammedDistributionsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest} GetTokenPreProgrammedDistributionsRequest + */ + GetTokenPreProgrammedDistributionsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetTokenPreProgrammedDistributionsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest + * @static + * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest} message GetTokenPreProgrammedDistributionsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetTokenPreProgrammedDistributionsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetTokenPreProgrammedDistributionsRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest + * @instance + * @returns {Object.} JSON object + */ + GetTokenPreProgrammedDistributionsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0 = (function() { + + /** + * Properties of a GetTokenPreProgrammedDistributionsRequestV0. + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest + * @interface IGetTokenPreProgrammedDistributionsRequestV0 + * @property {Uint8Array|null} [tokenId] GetTokenPreProgrammedDistributionsRequestV0 tokenId + * @property {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.IStartAtInfo|null} [startAtInfo] GetTokenPreProgrammedDistributionsRequestV0 startAtInfo + * @property {number|null} [limit] GetTokenPreProgrammedDistributionsRequestV0 limit + * @property {boolean|null} [prove] GetTokenPreProgrammedDistributionsRequestV0 prove + */ + + /** + * Constructs a new GetTokenPreProgrammedDistributionsRequestV0. + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest + * @classdesc Represents a GetTokenPreProgrammedDistributionsRequestV0. + * @implements IGetTokenPreProgrammedDistributionsRequestV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.IGetTokenPreProgrammedDistributionsRequestV0=} [properties] Properties to set + */ + function GetTokenPreProgrammedDistributionsRequestV0(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]]; + } + + /** + * GetTokenPreProgrammedDistributionsRequestV0 tokenId. + * @member {Uint8Array} tokenId + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0 + * @instance + */ + GetTokenPreProgrammedDistributionsRequestV0.prototype.tokenId = $util.newBuffer([]); + + /** + * GetTokenPreProgrammedDistributionsRequestV0 startAtInfo. + * @member {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.IStartAtInfo|null|undefined} startAtInfo + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0 + * @instance + */ + GetTokenPreProgrammedDistributionsRequestV0.prototype.startAtInfo = null; + + /** + * GetTokenPreProgrammedDistributionsRequestV0 limit. + * @member {number} limit + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0 + * @instance + */ + GetTokenPreProgrammedDistributionsRequestV0.prototype.limit = 0; + + /** + * GetTokenPreProgrammedDistributionsRequestV0 prove. + * @member {boolean} prove + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0 + * @instance + */ + GetTokenPreProgrammedDistributionsRequestV0.prototype.prove = false; + + /** + * Creates a new GetTokenPreProgrammedDistributionsRequestV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.IGetTokenPreProgrammedDistributionsRequestV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0} GetTokenPreProgrammedDistributionsRequestV0 instance + */ + GetTokenPreProgrammedDistributionsRequestV0.create = function create(properties) { + return new GetTokenPreProgrammedDistributionsRequestV0(properties); + }; + + /** + * Encodes the specified GetTokenPreProgrammedDistributionsRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.IGetTokenPreProgrammedDistributionsRequestV0} message GetTokenPreProgrammedDistributionsRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTokenPreProgrammedDistributionsRequestV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tokenId != null && Object.hasOwnProperty.call(message, "tokenId")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.tokenId); + if (message.startAtInfo != null && Object.hasOwnProperty.call(message, "startAtInfo")) + $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo.encode(message.startAtInfo, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.limit != null && Object.hasOwnProperty.call(message, "limit")) + writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.limit); + if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.prove); + return writer; + }; + + /** + * Encodes the specified GetTokenPreProgrammedDistributionsRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.IGetTokenPreProgrammedDistributionsRequestV0} message GetTokenPreProgrammedDistributionsRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTokenPreProgrammedDistributionsRequestV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetTokenPreProgrammedDistributionsRequestV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0} GetTokenPreProgrammedDistributionsRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTokenPreProgrammedDistributionsRequestV0.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.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tokenId = reader.bytes(); + break; + case 2: + message.startAtInfo = $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo.decode(reader, reader.uint32()); + break; + case 3: + message.limit = reader.uint32(); + break; + case 4: + message.prove = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetTokenPreProgrammedDistributionsRequestV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0} GetTokenPreProgrammedDistributionsRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTokenPreProgrammedDistributionsRequestV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetTokenPreProgrammedDistributionsRequestV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetTokenPreProgrammedDistributionsRequestV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tokenId != null && message.hasOwnProperty("tokenId")) + if (!(message.tokenId && typeof message.tokenId.length === "number" || $util.isString(message.tokenId))) + return "tokenId: buffer expected"; + if (message.startAtInfo != null && message.hasOwnProperty("startAtInfo")) { + var error = $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo.verify(message.startAtInfo); + if (error) + return "startAtInfo." + error; + } + if (message.limit != null && message.hasOwnProperty("limit")) + if (!$util.isInteger(message.limit)) + return "limit: integer expected"; + if (message.prove != null && message.hasOwnProperty("prove")) + if (typeof message.prove !== "boolean") + return "prove: boolean expected"; + return null; + }; + + /** + * Creates a GetTokenPreProgrammedDistributionsRequestV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0} GetTokenPreProgrammedDistributionsRequestV0 + */ + GetTokenPreProgrammedDistributionsRequestV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0(); + if (object.tokenId != null) + if (typeof object.tokenId === "string") + $util.base64.decode(object.tokenId, message.tokenId = $util.newBuffer($util.base64.length(object.tokenId)), 0); + else if (object.tokenId.length >= 0) + message.tokenId = object.tokenId; + if (object.startAtInfo != null) { + if (typeof object.startAtInfo !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.startAtInfo: object expected"); + message.startAtInfo = $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo.fromObject(object.startAtInfo); + } + if (object.limit != null) + message.limit = object.limit >>> 0; + if (object.prove != null) + message.prove = Boolean(object.prove); + return message; + }; + + /** + * Creates a plain object from a GetTokenPreProgrammedDistributionsRequestV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0} message GetTokenPreProgrammedDistributionsRequestV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetTokenPreProgrammedDistributionsRequestV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.tokenId = ""; + else { + object.tokenId = []; + if (options.bytes !== Array) + object.tokenId = $util.newBuffer(object.tokenId); + } + object.startAtInfo = null; + object.limit = 0; + object.prove = false; + } + if (message.tokenId != null && message.hasOwnProperty("tokenId")) + object.tokenId = options.bytes === String ? $util.base64.encode(message.tokenId, 0, message.tokenId.length) : options.bytes === Array ? Array.prototype.slice.call(message.tokenId) : message.tokenId; + if (message.startAtInfo != null && message.hasOwnProperty("startAtInfo")) + object.startAtInfo = $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo.toObject(message.startAtInfo, options); + if (message.limit != null && message.hasOwnProperty("limit")) + object.limit = message.limit; + if (message.prove != null && message.hasOwnProperty("prove")) + object.prove = message.prove; + return object; + }; + + /** + * Converts this GetTokenPreProgrammedDistributionsRequestV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0 + * @instance + * @returns {Object.} JSON object + */ + GetTokenPreProgrammedDistributionsRequestV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo = (function() { + + /** + * Properties of a StartAtInfo. + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0 + * @interface IStartAtInfo + * @property {number|Long|null} [startTimeMs] StartAtInfo startTimeMs + * @property {Uint8Array|null} [startRecipient] StartAtInfo startRecipient + * @property {boolean|null} [startRecipientIncluded] StartAtInfo startRecipientIncluded + */ + + /** + * Constructs a new StartAtInfo. + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0 + * @classdesc Represents a StartAtInfo. + * @implements IStartAtInfo + * @constructor + * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.IStartAtInfo=} [properties] Properties to set + */ + function StartAtInfo(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]]; + } + + /** + * StartAtInfo startTimeMs. + * @member {number|Long} startTimeMs + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo + * @instance + */ + StartAtInfo.prototype.startTimeMs = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * StartAtInfo startRecipient. + * @member {Uint8Array} startRecipient + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo + * @instance + */ + StartAtInfo.prototype.startRecipient = $util.newBuffer([]); + + /** + * StartAtInfo startRecipientIncluded. + * @member {boolean} startRecipientIncluded + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo + * @instance + */ + StartAtInfo.prototype.startRecipientIncluded = false; + + /** + * Creates a new StartAtInfo instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo + * @static + * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.IStartAtInfo=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo} StartAtInfo instance + */ + StartAtInfo.create = function create(properties) { + return new StartAtInfo(properties); + }; + + /** + * Encodes the specified StartAtInfo message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo + * @static + * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.IStartAtInfo} message StartAtInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StartAtInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.startTimeMs != null && Object.hasOwnProperty.call(message, "startTimeMs")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.startTimeMs); + if (message.startRecipient != null && Object.hasOwnProperty.call(message, "startRecipient")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.startRecipient); + if (message.startRecipientIncluded != null && Object.hasOwnProperty.call(message, "startRecipientIncluded")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.startRecipientIncluded); + return writer; + }; + + /** + * Encodes the specified StartAtInfo message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo + * @static + * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.IStartAtInfo} message StartAtInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StartAtInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StartAtInfo message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo} StartAtInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StartAtInfo.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.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.startTimeMs = reader.uint64(); + break; + case 2: + message.startRecipient = reader.bytes(); + break; + case 3: + message.startRecipientIncluded = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StartAtInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo} StartAtInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StartAtInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StartAtInfo message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StartAtInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.startTimeMs != null && message.hasOwnProperty("startTimeMs")) + if (!$util.isInteger(message.startTimeMs) && !(message.startTimeMs && $util.isInteger(message.startTimeMs.low) && $util.isInteger(message.startTimeMs.high))) + return "startTimeMs: integer|Long expected"; + if (message.startRecipient != null && message.hasOwnProperty("startRecipient")) + if (!(message.startRecipient && typeof message.startRecipient.length === "number" || $util.isString(message.startRecipient))) + return "startRecipient: buffer expected"; + if (message.startRecipientIncluded != null && message.hasOwnProperty("startRecipientIncluded")) + if (typeof message.startRecipientIncluded !== "boolean") + return "startRecipientIncluded: boolean expected"; + return null; + }; + + /** + * Creates a StartAtInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo} StartAtInfo + */ + StartAtInfo.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo(); + if (object.startTimeMs != null) + if ($util.Long) + (message.startTimeMs = $util.Long.fromValue(object.startTimeMs)).unsigned = true; + else if (typeof object.startTimeMs === "string") + message.startTimeMs = parseInt(object.startTimeMs, 10); + else if (typeof object.startTimeMs === "number") + message.startTimeMs = object.startTimeMs; + else if (typeof object.startTimeMs === "object") + message.startTimeMs = new $util.LongBits(object.startTimeMs.low >>> 0, object.startTimeMs.high >>> 0).toNumber(true); + if (object.startRecipient != null) + if (typeof object.startRecipient === "string") + $util.base64.decode(object.startRecipient, message.startRecipient = $util.newBuffer($util.base64.length(object.startRecipient)), 0); + else if (object.startRecipient.length >= 0) + message.startRecipient = object.startRecipient; + if (object.startRecipientIncluded != null) + message.startRecipientIncluded = Boolean(object.startRecipientIncluded); + return message; + }; + + /** + * Creates a plain object from a StartAtInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo + * @static + * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo} message StartAtInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StartAtInfo.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.startTimeMs = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.startTimeMs = options.longs === String ? "0" : 0; + if (options.bytes === String) + object.startRecipient = ""; + else { + object.startRecipient = []; + if (options.bytes !== Array) + object.startRecipient = $util.newBuffer(object.startRecipient); + } + object.startRecipientIncluded = false; + } + if (message.startTimeMs != null && message.hasOwnProperty("startTimeMs")) + if (typeof message.startTimeMs === "number") + object.startTimeMs = options.longs === String ? String(message.startTimeMs) : message.startTimeMs; + else + object.startTimeMs = options.longs === String ? $util.Long.prototype.toString.call(message.startTimeMs) : options.longs === Number ? new $util.LongBits(message.startTimeMs.low >>> 0, message.startTimeMs.high >>> 0).toNumber(true) : message.startTimeMs; + if (message.startRecipient != null && message.hasOwnProperty("startRecipient")) + object.startRecipient = options.bytes === String ? $util.base64.encode(message.startRecipient, 0, message.startRecipient.length) : options.bytes === Array ? Array.prototype.slice.call(message.startRecipient) : message.startRecipient; + if (message.startRecipientIncluded != null && message.hasOwnProperty("startRecipientIncluded")) + object.startRecipientIncluded = message.startRecipientIncluded; + return object; + }; + + /** + * Converts this StartAtInfo to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo + * @instance + * @returns {Object.} JSON object + */ + StartAtInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return StartAtInfo; + })(); + + return GetTokenPreProgrammedDistributionsRequestV0; + })(); + + return GetTokenPreProgrammedDistributionsRequest; + })(); + + v0.GetTokenPreProgrammedDistributionsResponse = (function() { + + /** + * Properties of a GetTokenPreProgrammedDistributionsResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetTokenPreProgrammedDistributionsResponse + * @property {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.IGetTokenPreProgrammedDistributionsResponseV0|null} [v0] GetTokenPreProgrammedDistributionsResponse v0 + */ + + /** + * Constructs a new GetTokenPreProgrammedDistributionsResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetTokenPreProgrammedDistributionsResponse. + * @implements IGetTokenPreProgrammedDistributionsResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IGetTokenPreProgrammedDistributionsResponse=} [properties] Properties to set + */ + function GetTokenPreProgrammedDistributionsResponse(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]]; + } + + /** + * GetTokenPreProgrammedDistributionsResponse v0. + * @member {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.IGetTokenPreProgrammedDistributionsResponseV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse + * @instance + */ + GetTokenPreProgrammedDistributionsResponse.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetTokenPreProgrammedDistributionsResponse version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse + * @instance + */ + Object.defineProperty(GetTokenPreProgrammedDistributionsResponse.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetTokenPreProgrammedDistributionsResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetTokenPreProgrammedDistributionsResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse} GetTokenPreProgrammedDistributionsResponse instance + */ + GetTokenPreProgrammedDistributionsResponse.create = function create(properties) { + return new GetTokenPreProgrammedDistributionsResponse(properties); + }; + + /** + * Encodes the specified GetTokenPreProgrammedDistributionsResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetTokenPreProgrammedDistributionsResponse} message GetTokenPreProgrammedDistributionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTokenPreProgrammedDistributionsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetTokenPreProgrammedDistributionsResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetTokenPreProgrammedDistributionsResponse} message GetTokenPreProgrammedDistributionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTokenPreProgrammedDistributionsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetTokenPreProgrammedDistributionsResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse} GetTokenPreProgrammedDistributionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTokenPreProgrammedDistributionsResponse.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.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetTokenPreProgrammedDistributionsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse} GetTokenPreProgrammedDistributionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTokenPreProgrammedDistributionsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetTokenPreProgrammedDistributionsResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetTokenPreProgrammedDistributionsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetTokenPreProgrammedDistributionsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse} GetTokenPreProgrammedDistributionsResponse + */ + GetTokenPreProgrammedDistributionsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetTokenPreProgrammedDistributionsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse + * @static + * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse} message GetTokenPreProgrammedDistributionsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetTokenPreProgrammedDistributionsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetTokenPreProgrammedDistributionsResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse + * @instance + * @returns {Object.} JSON object + */ + GetTokenPreProgrammedDistributionsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0 = (function() { + + /** + * Properties of a GetTokenPreProgrammedDistributionsResponseV0. + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse + * @interface IGetTokenPreProgrammedDistributionsResponseV0 + * @property {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.ITokenDistributions|null} [tokenDistributions] GetTokenPreProgrammedDistributionsResponseV0 tokenDistributions + * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetTokenPreProgrammedDistributionsResponseV0 proof + * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetTokenPreProgrammedDistributionsResponseV0 metadata + */ + + /** + * Constructs a new GetTokenPreProgrammedDistributionsResponseV0. + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse + * @classdesc Represents a GetTokenPreProgrammedDistributionsResponseV0. + * @implements IGetTokenPreProgrammedDistributionsResponseV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.IGetTokenPreProgrammedDistributionsResponseV0=} [properties] Properties to set + */ + function GetTokenPreProgrammedDistributionsResponseV0(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]]; + } + + /** + * GetTokenPreProgrammedDistributionsResponseV0 tokenDistributions. + * @member {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.ITokenDistributions|null|undefined} tokenDistributions + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0 + * @instance + */ + GetTokenPreProgrammedDistributionsResponseV0.prototype.tokenDistributions = null; + + /** + * GetTokenPreProgrammedDistributionsResponseV0 proof. + * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0 + * @instance + */ + GetTokenPreProgrammedDistributionsResponseV0.prototype.proof = null; + + /** + * GetTokenPreProgrammedDistributionsResponseV0 metadata. + * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0 + * @instance + */ + GetTokenPreProgrammedDistributionsResponseV0.prototype.metadata = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetTokenPreProgrammedDistributionsResponseV0 result. + * @member {"tokenDistributions"|"proof"|undefined} result + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0 + * @instance + */ + Object.defineProperty(GetTokenPreProgrammedDistributionsResponseV0.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["tokenDistributions", "proof"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetTokenPreProgrammedDistributionsResponseV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.IGetTokenPreProgrammedDistributionsResponseV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0} GetTokenPreProgrammedDistributionsResponseV0 instance + */ + GetTokenPreProgrammedDistributionsResponseV0.create = function create(properties) { + return new GetTokenPreProgrammedDistributionsResponseV0(properties); + }; + + /** + * Encodes the specified GetTokenPreProgrammedDistributionsResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.IGetTokenPreProgrammedDistributionsResponseV0} message GetTokenPreProgrammedDistributionsResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTokenPreProgrammedDistributionsResponseV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tokenDistributions != null && Object.hasOwnProperty.call(message, "tokenDistributions")) + $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions.encode(message.tokenDistributions, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetTokenPreProgrammedDistributionsResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.IGetTokenPreProgrammedDistributionsResponseV0} message GetTokenPreProgrammedDistributionsResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTokenPreProgrammedDistributionsResponseV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetTokenPreProgrammedDistributionsResponseV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0} GetTokenPreProgrammedDistributionsResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTokenPreProgrammedDistributionsResponseV0.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.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tokenDistributions = $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions.decode(reader, reader.uint32()); + break; + case 2: + message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); + break; + case 3: + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetTokenPreProgrammedDistributionsResponseV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0} GetTokenPreProgrammedDistributionsResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTokenPreProgrammedDistributionsResponseV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetTokenPreProgrammedDistributionsResponseV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetTokenPreProgrammedDistributionsResponseV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.tokenDistributions != null && message.hasOwnProperty("tokenDistributions")) { + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions.verify(message.tokenDistributions); + if (error) + return "tokenDistributions." + error; + } + } + if (message.proof != null && message.hasOwnProperty("proof")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); + if (error) + return "proof." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a GetTokenPreProgrammedDistributionsResponseV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0} GetTokenPreProgrammedDistributionsResponseV0 + */ + GetTokenPreProgrammedDistributionsResponseV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0(); + if (object.tokenDistributions != null) { + if (typeof object.tokenDistributions !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.tokenDistributions: object expected"); + message.tokenDistributions = $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions.fromObject(object.tokenDistributions); + } + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.proof: object expected"); + message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.metadata: object expected"); + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a GetTokenPreProgrammedDistributionsResponseV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0} message GetTokenPreProgrammedDistributionsResponseV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetTokenPreProgrammedDistributionsResponseV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.metadata = null; + if (message.tokenDistributions != null && message.hasOwnProperty("tokenDistributions")) { + object.tokenDistributions = $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions.toObject(message.tokenDistributions, options); + if (options.oneofs) + object.result = "tokenDistributions"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); + if (options.oneofs) + object.result = "proof"; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this GetTokenPreProgrammedDistributionsResponseV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0 + * @instance + * @returns {Object.} JSON object + */ + GetTokenPreProgrammedDistributionsResponseV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry = (function() { + + /** + * Properties of a TokenDistributionEntry. + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0 + * @interface ITokenDistributionEntry + * @property {Uint8Array|null} [recipientId] TokenDistributionEntry recipientId + * @property {number|Long|null} [amount] TokenDistributionEntry amount + */ + + /** + * Constructs a new TokenDistributionEntry. + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0 + * @classdesc Represents a TokenDistributionEntry. + * @implements ITokenDistributionEntry + * @constructor + * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.ITokenDistributionEntry=} [properties] Properties to set + */ + function TokenDistributionEntry(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]]; + } + + /** + * TokenDistributionEntry recipientId. + * @member {Uint8Array} recipientId + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry + * @instance + */ + TokenDistributionEntry.prototype.recipientId = $util.newBuffer([]); + + /** + * TokenDistributionEntry amount. + * @member {number|Long} amount + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry + * @instance + */ + TokenDistributionEntry.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new TokenDistributionEntry instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry + * @static + * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.ITokenDistributionEntry=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry} TokenDistributionEntry instance + */ + TokenDistributionEntry.create = function create(properties) { + return new TokenDistributionEntry(properties); + }; + + /** + * Encodes the specified TokenDistributionEntry message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry + * @static + * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.ITokenDistributionEntry} message TokenDistributionEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenDistributionEntry.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.recipientId != null && Object.hasOwnProperty.call(message, "recipientId")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.recipientId); + if (message.amount != null && Object.hasOwnProperty.call(message, "amount")) + writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.amount); + return writer; + }; + + /** + * Encodes the specified TokenDistributionEntry message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry + * @static + * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.ITokenDistributionEntry} message TokenDistributionEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenDistributionEntry.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TokenDistributionEntry message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry} TokenDistributionEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenDistributionEntry.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.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.recipientId = reader.bytes(); + break; + case 2: + message.amount = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TokenDistributionEntry message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry} TokenDistributionEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenDistributionEntry.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TokenDistributionEntry message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TokenDistributionEntry.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.recipientId != null && message.hasOwnProperty("recipientId")) + if (!(message.recipientId && typeof message.recipientId.length === "number" || $util.isString(message.recipientId))) + return "recipientId: buffer 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"; + return null; + }; + + /** + * Creates a TokenDistributionEntry message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry} TokenDistributionEntry + */ + TokenDistributionEntry.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry(); + if (object.recipientId != null) + if (typeof object.recipientId === "string") + $util.base64.decode(object.recipientId, message.recipientId = $util.newBuffer($util.base64.length(object.recipientId)), 0); + else if (object.recipientId.length >= 0) + message.recipientId = object.recipientId; + 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); + return message; + }; + + /** + * Creates a plain object from a TokenDistributionEntry message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry + * @static + * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry} message TokenDistributionEntry + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TokenDistributionEntry.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.recipientId = ""; + else { + object.recipientId = []; + if (options.bytes !== Array) + object.recipientId = $util.newBuffer(object.recipientId); + } + 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; + } + if (message.recipientId != null && message.hasOwnProperty("recipientId")) + object.recipientId = options.bytes === String ? $util.base64.encode(message.recipientId, 0, message.recipientId.length) : options.bytes === Array ? Array.prototype.slice.call(message.recipientId) : message.recipientId; + 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; + return object; + }; + + /** + * Converts this TokenDistributionEntry to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry + * @instance + * @returns {Object.} JSON object + */ + TokenDistributionEntry.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TokenDistributionEntry; + })(); + + GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry = (function() { + + /** + * Properties of a TokenTimedDistributionEntry. + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0 + * @interface ITokenTimedDistributionEntry + * @property {number|Long|null} [timestamp] TokenTimedDistributionEntry timestamp + * @property {Array.|null} [distributions] TokenTimedDistributionEntry distributions + */ + + /** + * Constructs a new TokenTimedDistributionEntry. + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0 + * @classdesc Represents a TokenTimedDistributionEntry. + * @implements ITokenTimedDistributionEntry + * @constructor + * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.ITokenTimedDistributionEntry=} [properties] Properties to set + */ + function TokenTimedDistributionEntry(properties) { + this.distributions = []; + 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]]; + } + + /** + * TokenTimedDistributionEntry timestamp. + * @member {number|Long} timestamp + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry + * @instance + */ + TokenTimedDistributionEntry.prototype.timestamp = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * TokenTimedDistributionEntry distributions. + * @member {Array.} distributions + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry + * @instance + */ + TokenTimedDistributionEntry.prototype.distributions = $util.emptyArray; + + /** + * Creates a new TokenTimedDistributionEntry instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry + * @static + * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.ITokenTimedDistributionEntry=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry} TokenTimedDistributionEntry instance + */ + TokenTimedDistributionEntry.create = function create(properties) { + return new TokenTimedDistributionEntry(properties); + }; + + /** + * Encodes the specified TokenTimedDistributionEntry message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry + * @static + * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.ITokenTimedDistributionEntry} message TokenTimedDistributionEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenTimedDistributionEntry.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.timestamp != null && Object.hasOwnProperty.call(message, "timestamp")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.timestamp); + if (message.distributions != null && message.distributions.length) + for (var i = 0; i < message.distributions.length; ++i) + $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry.encode(message.distributions[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TokenTimedDistributionEntry message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry + * @static + * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.ITokenTimedDistributionEntry} message TokenTimedDistributionEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenTimedDistributionEntry.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TokenTimedDistributionEntry message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry} TokenTimedDistributionEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenTimedDistributionEntry.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.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.timestamp = reader.uint64(); + break; + case 2: + if (!(message.distributions && message.distributions.length)) + message.distributions = []; + message.distributions.push($root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TokenTimedDistributionEntry message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry} TokenTimedDistributionEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenTimedDistributionEntry.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TokenTimedDistributionEntry message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TokenTimedDistributionEntry.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.timestamp != null && message.hasOwnProperty("timestamp")) + if (!$util.isInteger(message.timestamp) && !(message.timestamp && $util.isInteger(message.timestamp.low) && $util.isInteger(message.timestamp.high))) + return "timestamp: integer|Long expected"; + if (message.distributions != null && message.hasOwnProperty("distributions")) { + if (!Array.isArray(message.distributions)) + return "distributions: array expected"; + for (var i = 0; i < message.distributions.length; ++i) { + var error = $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry.verify(message.distributions[i]); + if (error) + return "distributions." + error; + } + } + return null; + }; + + /** + * Creates a TokenTimedDistributionEntry message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry} TokenTimedDistributionEntry + */ + TokenTimedDistributionEntry.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry(); + if (object.timestamp != null) + if ($util.Long) + (message.timestamp = $util.Long.fromValue(object.timestamp)).unsigned = true; + else if (typeof object.timestamp === "string") + message.timestamp = parseInt(object.timestamp, 10); + else if (typeof object.timestamp === "number") + message.timestamp = object.timestamp; + else if (typeof object.timestamp === "object") + message.timestamp = new $util.LongBits(object.timestamp.low >>> 0, object.timestamp.high >>> 0).toNumber(true); + if (object.distributions) { + if (!Array.isArray(object.distributions)) + throw TypeError(".org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry.distributions: array expected"); + message.distributions = []; + for (var i = 0; i < object.distributions.length; ++i) { + if (typeof object.distributions[i] !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry.distributions: object expected"); + message.distributions[i] = $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry.fromObject(object.distributions[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a TokenTimedDistributionEntry message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry + * @static + * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry} message TokenTimedDistributionEntry + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TokenTimedDistributionEntry.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.distributions = []; + if (options.defaults) + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.timestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.timestamp = options.longs === String ? "0" : 0; + if (message.timestamp != null && message.hasOwnProperty("timestamp")) + if (typeof message.timestamp === "number") + object.timestamp = options.longs === String ? String(message.timestamp) : message.timestamp; + else + object.timestamp = options.longs === String ? $util.Long.prototype.toString.call(message.timestamp) : options.longs === Number ? new $util.LongBits(message.timestamp.low >>> 0, message.timestamp.high >>> 0).toNumber(true) : message.timestamp; + if (message.distributions && message.distributions.length) { + object.distributions = []; + for (var j = 0; j < message.distributions.length; ++j) + object.distributions[j] = $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry.toObject(message.distributions[j], options); + } + return object; + }; + + /** + * Converts this TokenTimedDistributionEntry to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry + * @instance + * @returns {Object.} JSON object + */ + TokenTimedDistributionEntry.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TokenTimedDistributionEntry; + })(); + + GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions = (function() { + + /** + * Properties of a TokenDistributions. + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0 + * @interface ITokenDistributions + * @property {Array.|null} [tokenDistributions] TokenDistributions tokenDistributions + */ + + /** + * Constructs a new TokenDistributions. + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0 + * @classdesc Represents a TokenDistributions. + * @implements ITokenDistributions + * @constructor + * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.ITokenDistributions=} [properties] Properties to set + */ + function TokenDistributions(properties) { + this.tokenDistributions = []; + 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]]; + } + + /** + * TokenDistributions tokenDistributions. + * @member {Array.} tokenDistributions + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions + * @instance + */ + TokenDistributions.prototype.tokenDistributions = $util.emptyArray; + + /** + * Creates a new TokenDistributions instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions + * @static + * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.ITokenDistributions=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions} TokenDistributions instance + */ + TokenDistributions.create = function create(properties) { + return new TokenDistributions(properties); + }; + + /** + * Encodes the specified TokenDistributions message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions + * @static + * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.ITokenDistributions} message TokenDistributions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenDistributions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tokenDistributions != null && message.tokenDistributions.length) + for (var i = 0; i < message.tokenDistributions.length; ++i) + $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry.encode(message.tokenDistributions[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TokenDistributions message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions + * @static + * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.ITokenDistributions} message TokenDistributions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenDistributions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TokenDistributions message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions} TokenDistributions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenDistributions.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.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.tokenDistributions && message.tokenDistributions.length)) + message.tokenDistributions = []; + message.tokenDistributions.push($root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TokenDistributions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions} TokenDistributions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenDistributions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TokenDistributions message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TokenDistributions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tokenDistributions != null && message.hasOwnProperty("tokenDistributions")) { + if (!Array.isArray(message.tokenDistributions)) + return "tokenDistributions: array expected"; + for (var i = 0; i < message.tokenDistributions.length; ++i) { + var error = $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry.verify(message.tokenDistributions[i]); + if (error) + return "tokenDistributions." + error; + } + } + return null; + }; + + /** + * Creates a TokenDistributions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions} TokenDistributions + */ + TokenDistributions.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions(); + if (object.tokenDistributions) { + if (!Array.isArray(object.tokenDistributions)) + throw TypeError(".org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions.tokenDistributions: array expected"); + message.tokenDistributions = []; + for (var i = 0; i < object.tokenDistributions.length; ++i) { + if (typeof object.tokenDistributions[i] !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions.tokenDistributions: object expected"); + message.tokenDistributions[i] = $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry.fromObject(object.tokenDistributions[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a TokenDistributions message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions + * @static + * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions} message TokenDistributions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TokenDistributions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.tokenDistributions = []; + if (message.tokenDistributions && message.tokenDistributions.length) { + object.tokenDistributions = []; + for (var j = 0; j < message.tokenDistributions.length; ++j) + object.tokenDistributions[j] = $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry.toObject(message.tokenDistributions[j], options); + } + return object; + }; + + /** + * Converts this TokenDistributions to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions + * @instance + * @returns {Object.} JSON object + */ + TokenDistributions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TokenDistributions; + })(); + + return GetTokenPreProgrammedDistributionsResponseV0; + })(); + + return GetTokenPreProgrammedDistributionsResponse; + })(); + + v0.GetTokenTotalSupplyRequest = (function() { + + /** + * Properties of a GetTokenTotalSupplyRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetTokenTotalSupplyRequest + * @property {org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.IGetTokenTotalSupplyRequestV0|null} [v0] GetTokenTotalSupplyRequest v0 + */ + + /** + * Constructs a new GetTokenTotalSupplyRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetTokenTotalSupplyRequest. + * @implements IGetTokenTotalSupplyRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IGetTokenTotalSupplyRequest=} [properties] Properties to set + */ + function GetTokenTotalSupplyRequest(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]]; + } + + /** + * GetTokenTotalSupplyRequest v0. + * @member {org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.IGetTokenTotalSupplyRequestV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest + * @instance + */ + GetTokenTotalSupplyRequest.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetTokenTotalSupplyRequest version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest + * @instance + */ + Object.defineProperty(GetTokenTotalSupplyRequest.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetTokenTotalSupplyRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetTokenTotalSupplyRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest} GetTokenTotalSupplyRequest instance + */ + GetTokenTotalSupplyRequest.create = function create(properties) { + return new GetTokenTotalSupplyRequest(properties); + }; + + /** + * Encodes the specified GetTokenTotalSupplyRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetTokenTotalSupplyRequest} message GetTokenTotalSupplyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTokenTotalSupplyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetTokenTotalSupplyRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetTokenTotalSupplyRequest} message GetTokenTotalSupplyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTokenTotalSupplyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetTokenTotalSupplyRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest} GetTokenTotalSupplyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTokenTotalSupplyRequest.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.org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetTokenTotalSupplyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest} GetTokenTotalSupplyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTokenTotalSupplyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetTokenTotalSupplyRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetTokenTotalSupplyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetTokenTotalSupplyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest} GetTokenTotalSupplyRequest + */ + GetTokenTotalSupplyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetTokenTotalSupplyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest + * @static + * @param {org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest} message GetTokenTotalSupplyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetTokenTotalSupplyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetTokenTotalSupplyRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest + * @instance + * @returns {Object.} JSON object + */ + GetTokenTotalSupplyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0 = (function() { + + /** + * Properties of a GetTokenTotalSupplyRequestV0. + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest + * @interface IGetTokenTotalSupplyRequestV0 + * @property {Uint8Array|null} [tokenId] GetTokenTotalSupplyRequestV0 tokenId + * @property {boolean|null} [prove] GetTokenTotalSupplyRequestV0 prove + */ + + /** + * Constructs a new GetTokenTotalSupplyRequestV0. + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest + * @classdesc Represents a GetTokenTotalSupplyRequestV0. + * @implements IGetTokenTotalSupplyRequestV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.IGetTokenTotalSupplyRequestV0=} [properties] Properties to set + */ + function GetTokenTotalSupplyRequestV0(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]]; + } + + /** + * GetTokenTotalSupplyRequestV0 tokenId. + * @member {Uint8Array} tokenId + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0 + * @instance + */ + GetTokenTotalSupplyRequestV0.prototype.tokenId = $util.newBuffer([]); + + /** + * GetTokenTotalSupplyRequestV0 prove. + * @member {boolean} prove + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0 + * @instance + */ + GetTokenTotalSupplyRequestV0.prototype.prove = false; + + /** + * Creates a new GetTokenTotalSupplyRequestV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.IGetTokenTotalSupplyRequestV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0} GetTokenTotalSupplyRequestV0 instance + */ + GetTokenTotalSupplyRequestV0.create = function create(properties) { + return new GetTokenTotalSupplyRequestV0(properties); + }; + + /** + * Encodes the specified GetTokenTotalSupplyRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.IGetTokenTotalSupplyRequestV0} message GetTokenTotalSupplyRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTokenTotalSupplyRequestV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tokenId != null && Object.hasOwnProperty.call(message, "tokenId")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.tokenId); + if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.prove); + return writer; + }; + + /** + * Encodes the specified GetTokenTotalSupplyRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.IGetTokenTotalSupplyRequestV0} message GetTokenTotalSupplyRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTokenTotalSupplyRequestV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetTokenTotalSupplyRequestV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0} GetTokenTotalSupplyRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTokenTotalSupplyRequestV0.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.org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tokenId = reader.bytes(); + break; + case 2: + message.prove = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetTokenTotalSupplyRequestV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0} GetTokenTotalSupplyRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTokenTotalSupplyRequestV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetTokenTotalSupplyRequestV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetTokenTotalSupplyRequestV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tokenId != null && message.hasOwnProperty("tokenId")) + if (!(message.tokenId && typeof message.tokenId.length === "number" || $util.isString(message.tokenId))) + return "tokenId: buffer expected"; + if (message.prove != null && message.hasOwnProperty("prove")) + if (typeof message.prove !== "boolean") + return "prove: boolean expected"; + return null; + }; + + /** + * Creates a GetTokenTotalSupplyRequestV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0} GetTokenTotalSupplyRequestV0 + */ + GetTokenTotalSupplyRequestV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0(); + if (object.tokenId != null) + if (typeof object.tokenId === "string") + $util.base64.decode(object.tokenId, message.tokenId = $util.newBuffer($util.base64.length(object.tokenId)), 0); + else if (object.tokenId.length >= 0) + message.tokenId = object.tokenId; + if (object.prove != null) + message.prove = Boolean(object.prove); + return message; + }; + + /** + * Creates a plain object from a GetTokenTotalSupplyRequestV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0} message GetTokenTotalSupplyRequestV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetTokenTotalSupplyRequestV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.tokenId = ""; + else { + object.tokenId = []; + if (options.bytes !== Array) + object.tokenId = $util.newBuffer(object.tokenId); + } + object.prove = false; + } + if (message.tokenId != null && message.hasOwnProperty("tokenId")) + object.tokenId = options.bytes === String ? $util.base64.encode(message.tokenId, 0, message.tokenId.length) : options.bytes === Array ? Array.prototype.slice.call(message.tokenId) : message.tokenId; + if (message.prove != null && message.hasOwnProperty("prove")) + object.prove = message.prove; + return object; + }; + + /** + * Converts this GetTokenTotalSupplyRequestV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0 + * @instance + * @returns {Object.} JSON object + */ + GetTokenTotalSupplyRequestV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetTokenTotalSupplyRequestV0; + })(); + + return GetTokenTotalSupplyRequest; + })(); + + v0.GetTokenTotalSupplyResponse = (function() { + + /** + * Properties of a GetTokenTotalSupplyResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetTokenTotalSupplyResponse + * @property {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.IGetTokenTotalSupplyResponseV0|null} [v0] GetTokenTotalSupplyResponse v0 + */ + + /** + * Constructs a new GetTokenTotalSupplyResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetTokenTotalSupplyResponse. + * @implements IGetTokenTotalSupplyResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IGetTokenTotalSupplyResponse=} [properties] Properties to set + */ + function GetTokenTotalSupplyResponse(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]]; + } + + /** + * GetTokenTotalSupplyResponse v0. + * @member {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.IGetTokenTotalSupplyResponseV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse + * @instance + */ + GetTokenTotalSupplyResponse.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetTokenTotalSupplyResponse version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse + * @instance + */ + Object.defineProperty(GetTokenTotalSupplyResponse.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetTokenTotalSupplyResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetTokenTotalSupplyResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse} GetTokenTotalSupplyResponse instance + */ + GetTokenTotalSupplyResponse.create = function create(properties) { + return new GetTokenTotalSupplyResponse(properties); + }; + + /** + * Encodes the specified GetTokenTotalSupplyResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetTokenTotalSupplyResponse} message GetTokenTotalSupplyResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTokenTotalSupplyResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetTokenTotalSupplyResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetTokenTotalSupplyResponse} message GetTokenTotalSupplyResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTokenTotalSupplyResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetTokenTotalSupplyResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse} GetTokenTotalSupplyResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTokenTotalSupplyResponse.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.org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetTokenTotalSupplyResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse} GetTokenTotalSupplyResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTokenTotalSupplyResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetTokenTotalSupplyResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetTokenTotalSupplyResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetTokenTotalSupplyResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse} GetTokenTotalSupplyResponse + */ + GetTokenTotalSupplyResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetTokenTotalSupplyResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse + * @static + * @param {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse} message GetTokenTotalSupplyResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetTokenTotalSupplyResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetTokenTotalSupplyResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse + * @instance + * @returns {Object.} JSON object + */ + GetTokenTotalSupplyResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0 = (function() { + + /** + * Properties of a GetTokenTotalSupplyResponseV0. + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse + * @interface IGetTokenTotalSupplyResponseV0 + * @property {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.ITokenTotalSupplyEntry|null} [tokenTotalSupply] GetTokenTotalSupplyResponseV0 tokenTotalSupply + * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetTokenTotalSupplyResponseV0 proof + * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetTokenTotalSupplyResponseV0 metadata + */ + + /** + * Constructs a new GetTokenTotalSupplyResponseV0. + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse + * @classdesc Represents a GetTokenTotalSupplyResponseV0. + * @implements IGetTokenTotalSupplyResponseV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.IGetTokenTotalSupplyResponseV0=} [properties] Properties to set + */ + function GetTokenTotalSupplyResponseV0(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]]; + } + + /** + * GetTokenTotalSupplyResponseV0 tokenTotalSupply. + * @member {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.ITokenTotalSupplyEntry|null|undefined} tokenTotalSupply + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0 + * @instance + */ + GetTokenTotalSupplyResponseV0.prototype.tokenTotalSupply = null; + + /** + * GetTokenTotalSupplyResponseV0 proof. + * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0 + * @instance + */ + GetTokenTotalSupplyResponseV0.prototype.proof = null; + + /** + * GetTokenTotalSupplyResponseV0 metadata. + * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0 + * @instance + */ + GetTokenTotalSupplyResponseV0.prototype.metadata = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetTokenTotalSupplyResponseV0 result. + * @member {"tokenTotalSupply"|"proof"|undefined} result + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0 + * @instance + */ + Object.defineProperty(GetTokenTotalSupplyResponseV0.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["tokenTotalSupply", "proof"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetTokenTotalSupplyResponseV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.IGetTokenTotalSupplyResponseV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0} GetTokenTotalSupplyResponseV0 instance + */ + GetTokenTotalSupplyResponseV0.create = function create(properties) { + return new GetTokenTotalSupplyResponseV0(properties); + }; + + /** + * Encodes the specified GetTokenTotalSupplyResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.IGetTokenTotalSupplyResponseV0} message GetTokenTotalSupplyResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTokenTotalSupplyResponseV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tokenTotalSupply != null && Object.hasOwnProperty.call(message, "tokenTotalSupply")) + $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry.encode(message.tokenTotalSupply, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetTokenTotalSupplyResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.IGetTokenTotalSupplyResponseV0} message GetTokenTotalSupplyResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTokenTotalSupplyResponseV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetTokenTotalSupplyResponseV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0} GetTokenTotalSupplyResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTokenTotalSupplyResponseV0.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.org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tokenTotalSupply = $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry.decode(reader, reader.uint32()); + break; + case 2: + message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); + break; + case 3: + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetTokenTotalSupplyResponseV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0} GetTokenTotalSupplyResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTokenTotalSupplyResponseV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetTokenTotalSupplyResponseV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetTokenTotalSupplyResponseV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.tokenTotalSupply != null && message.hasOwnProperty("tokenTotalSupply")) { + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry.verify(message.tokenTotalSupply); + if (error) + return "tokenTotalSupply." + error; + } + } + if (message.proof != null && message.hasOwnProperty("proof")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); + if (error) + return "proof." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a GetTokenTotalSupplyResponseV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0} GetTokenTotalSupplyResponseV0 + */ + GetTokenTotalSupplyResponseV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0(); + if (object.tokenTotalSupply != null) { + if (typeof object.tokenTotalSupply !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.tokenTotalSupply: object expected"); + message.tokenTotalSupply = $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry.fromObject(object.tokenTotalSupply); + } + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.proof: object expected"); + message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.metadata: object expected"); + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a GetTokenTotalSupplyResponseV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0} message GetTokenTotalSupplyResponseV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetTokenTotalSupplyResponseV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.metadata = null; + if (message.tokenTotalSupply != null && message.hasOwnProperty("tokenTotalSupply")) { + object.tokenTotalSupply = $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry.toObject(message.tokenTotalSupply, options); + if (options.oneofs) + object.result = "tokenTotalSupply"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); + if (options.oneofs) + object.result = "proof"; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this GetTokenTotalSupplyResponseV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0 + * @instance + * @returns {Object.} JSON object + */ + GetTokenTotalSupplyResponseV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry = (function() { + + /** + * Properties of a TokenTotalSupplyEntry. + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0 + * @interface ITokenTotalSupplyEntry + * @property {Uint8Array|null} [tokenId] TokenTotalSupplyEntry tokenId + * @property {number|Long|null} [totalAggregatedAmountInUserAccounts] TokenTotalSupplyEntry totalAggregatedAmountInUserAccounts + * @property {number|Long|null} [totalSystemAmount] TokenTotalSupplyEntry totalSystemAmount + */ + + /** + * Constructs a new TokenTotalSupplyEntry. + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0 + * @classdesc Represents a TokenTotalSupplyEntry. + * @implements ITokenTotalSupplyEntry + * @constructor + * @param {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.ITokenTotalSupplyEntry=} [properties] Properties to set + */ + function TokenTotalSupplyEntry(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]]; + } + + /** + * TokenTotalSupplyEntry tokenId. + * @member {Uint8Array} tokenId + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry + * @instance + */ + TokenTotalSupplyEntry.prototype.tokenId = $util.newBuffer([]); + + /** + * TokenTotalSupplyEntry totalAggregatedAmountInUserAccounts. + * @member {number|Long} totalAggregatedAmountInUserAccounts + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry + * @instance + */ + TokenTotalSupplyEntry.prototype.totalAggregatedAmountInUserAccounts = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * TokenTotalSupplyEntry totalSystemAmount. + * @member {number|Long} totalSystemAmount + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry + * @instance + */ + TokenTotalSupplyEntry.prototype.totalSystemAmount = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new TokenTotalSupplyEntry instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry + * @static + * @param {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.ITokenTotalSupplyEntry=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry} TokenTotalSupplyEntry instance + */ + TokenTotalSupplyEntry.create = function create(properties) { + return new TokenTotalSupplyEntry(properties); + }; + + /** + * Encodes the specified TokenTotalSupplyEntry message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry + * @static + * @param {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.ITokenTotalSupplyEntry} message TokenTotalSupplyEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenTotalSupplyEntry.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tokenId != null && Object.hasOwnProperty.call(message, "tokenId")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.tokenId); + if (message.totalAggregatedAmountInUserAccounts != null && Object.hasOwnProperty.call(message, "totalAggregatedAmountInUserAccounts")) + writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.totalAggregatedAmountInUserAccounts); + if (message.totalSystemAmount != null && Object.hasOwnProperty.call(message, "totalSystemAmount")) + writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.totalSystemAmount); + return writer; + }; + + /** + * Encodes the specified TokenTotalSupplyEntry message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry + * @static + * @param {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.ITokenTotalSupplyEntry} message TokenTotalSupplyEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenTotalSupplyEntry.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TokenTotalSupplyEntry message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry} TokenTotalSupplyEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenTotalSupplyEntry.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.org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tokenId = reader.bytes(); + break; + case 2: + message.totalAggregatedAmountInUserAccounts = reader.uint64(); + break; + case 3: + message.totalSystemAmount = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TokenTotalSupplyEntry message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry} TokenTotalSupplyEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenTotalSupplyEntry.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TokenTotalSupplyEntry message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TokenTotalSupplyEntry.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tokenId != null && message.hasOwnProperty("tokenId")) + if (!(message.tokenId && typeof message.tokenId.length === "number" || $util.isString(message.tokenId))) + return "tokenId: buffer expected"; + if (message.totalAggregatedAmountInUserAccounts != null && message.hasOwnProperty("totalAggregatedAmountInUserAccounts")) + if (!$util.isInteger(message.totalAggregatedAmountInUserAccounts) && !(message.totalAggregatedAmountInUserAccounts && $util.isInteger(message.totalAggregatedAmountInUserAccounts.low) && $util.isInteger(message.totalAggregatedAmountInUserAccounts.high))) + return "totalAggregatedAmountInUserAccounts: integer|Long expected"; + if (message.totalSystemAmount != null && message.hasOwnProperty("totalSystemAmount")) + if (!$util.isInteger(message.totalSystemAmount) && !(message.totalSystemAmount && $util.isInteger(message.totalSystemAmount.low) && $util.isInteger(message.totalSystemAmount.high))) + return "totalSystemAmount: integer|Long expected"; + return null; + }; + + /** + * Creates a TokenTotalSupplyEntry message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry} TokenTotalSupplyEntry + */ + TokenTotalSupplyEntry.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry(); + if (object.tokenId != null) + if (typeof object.tokenId === "string") + $util.base64.decode(object.tokenId, message.tokenId = $util.newBuffer($util.base64.length(object.tokenId)), 0); + else if (object.tokenId.length >= 0) + message.tokenId = object.tokenId; + if (object.totalAggregatedAmountInUserAccounts != null) + if ($util.Long) + (message.totalAggregatedAmountInUserAccounts = $util.Long.fromValue(object.totalAggregatedAmountInUserAccounts)).unsigned = true; + else if (typeof object.totalAggregatedAmountInUserAccounts === "string") + message.totalAggregatedAmountInUserAccounts = parseInt(object.totalAggregatedAmountInUserAccounts, 10); + else if (typeof object.totalAggregatedAmountInUserAccounts === "number") + message.totalAggregatedAmountInUserAccounts = object.totalAggregatedAmountInUserAccounts; + else if (typeof object.totalAggregatedAmountInUserAccounts === "object") + message.totalAggregatedAmountInUserAccounts = new $util.LongBits(object.totalAggregatedAmountInUserAccounts.low >>> 0, object.totalAggregatedAmountInUserAccounts.high >>> 0).toNumber(true); + if (object.totalSystemAmount != null) + if ($util.Long) + (message.totalSystemAmount = $util.Long.fromValue(object.totalSystemAmount)).unsigned = true; + else if (typeof object.totalSystemAmount === "string") + message.totalSystemAmount = parseInt(object.totalSystemAmount, 10); + else if (typeof object.totalSystemAmount === "number") + message.totalSystemAmount = object.totalSystemAmount; + else if (typeof object.totalSystemAmount === "object") + message.totalSystemAmount = new $util.LongBits(object.totalSystemAmount.low >>> 0, object.totalSystemAmount.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from a TokenTotalSupplyEntry message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry + * @static + * @param {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry} message TokenTotalSupplyEntry + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TokenTotalSupplyEntry.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.tokenId = ""; + else { + object.tokenId = []; + if (options.bytes !== Array) + object.tokenId = $util.newBuffer(object.tokenId); + } + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.totalAggregatedAmountInUserAccounts = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.totalAggregatedAmountInUserAccounts = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.totalSystemAmount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.totalSystemAmount = options.longs === String ? "0" : 0; + } + if (message.tokenId != null && message.hasOwnProperty("tokenId")) + object.tokenId = options.bytes === String ? $util.base64.encode(message.tokenId, 0, message.tokenId.length) : options.bytes === Array ? Array.prototype.slice.call(message.tokenId) : message.tokenId; + if (message.totalAggregatedAmountInUserAccounts != null && message.hasOwnProperty("totalAggregatedAmountInUserAccounts")) + if (typeof message.totalAggregatedAmountInUserAccounts === "number") + object.totalAggregatedAmountInUserAccounts = options.longs === String ? String(message.totalAggregatedAmountInUserAccounts) : message.totalAggregatedAmountInUserAccounts; + else + object.totalAggregatedAmountInUserAccounts = options.longs === String ? $util.Long.prototype.toString.call(message.totalAggregatedAmountInUserAccounts) : options.longs === Number ? new $util.LongBits(message.totalAggregatedAmountInUserAccounts.low >>> 0, message.totalAggregatedAmountInUserAccounts.high >>> 0).toNumber(true) : message.totalAggregatedAmountInUserAccounts; + if (message.totalSystemAmount != null && message.hasOwnProperty("totalSystemAmount")) + if (typeof message.totalSystemAmount === "number") + object.totalSystemAmount = options.longs === String ? String(message.totalSystemAmount) : message.totalSystemAmount; + else + object.totalSystemAmount = options.longs === String ? $util.Long.prototype.toString.call(message.totalSystemAmount) : options.longs === Number ? new $util.LongBits(message.totalSystemAmount.low >>> 0, message.totalSystemAmount.high >>> 0).toNumber(true) : message.totalSystemAmount; + return object; + }; + + /** + * Converts this TokenTotalSupplyEntry to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry + * @instance + * @returns {Object.} JSON object + */ + TokenTotalSupplyEntry.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TokenTotalSupplyEntry; + })(); + + return GetTokenTotalSupplyResponseV0; + })(); + + return GetTokenTotalSupplyResponse; + })(); + + v0.GetGroupInfoRequest = (function() { + + /** + * Properties of a GetGroupInfoRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetGroupInfoRequest + * @property {org.dash.platform.dapi.v0.GetGroupInfoRequest.IGetGroupInfoRequestV0|null} [v0] GetGroupInfoRequest v0 + */ + + /** + * Constructs a new GetGroupInfoRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetGroupInfoRequest. + * @implements IGetGroupInfoRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IGetGroupInfoRequest=} [properties] Properties to set + */ + function GetGroupInfoRequest(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]]; + } + + /** + * GetGroupInfoRequest v0. + * @member {org.dash.platform.dapi.v0.GetGroupInfoRequest.IGetGroupInfoRequestV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetGroupInfoRequest + * @instance + */ + GetGroupInfoRequest.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetGroupInfoRequest version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetGroupInfoRequest + * @instance + */ + Object.defineProperty(GetGroupInfoRequest.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetGroupInfoRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetGroupInfoRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetGroupInfoRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetGroupInfoRequest} GetGroupInfoRequest instance + */ + GetGroupInfoRequest.create = function create(properties) { + return new GetGroupInfoRequest(properties); + }; + + /** + * Encodes the specified GetGroupInfoRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfoRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetGroupInfoRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetGroupInfoRequest} message GetGroupInfoRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGroupInfoRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetGroupInfoRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfoRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupInfoRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetGroupInfoRequest} message GetGroupInfoRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGroupInfoRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetGroupInfoRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetGroupInfoRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetGroupInfoRequest} GetGroupInfoRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGroupInfoRequest.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.org.dash.platform.dapi.v0.GetGroupInfoRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetGroupInfoRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupInfoRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetGroupInfoRequest} GetGroupInfoRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGroupInfoRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetGroupInfoRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetGroupInfoRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetGroupInfoRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetGroupInfoRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetGroupInfoRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetGroupInfoRequest} GetGroupInfoRequest + */ + GetGroupInfoRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupInfoRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetGroupInfoRequest(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetGroupInfoRequest.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetGroupInfoRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetGroupInfoRequest + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfoRequest} message GetGroupInfoRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetGroupInfoRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetGroupInfoRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetGroupInfoRequest + * @instance + * @returns {Object.} JSON object + */ + GetGroupInfoRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetGroupInfoRequest.GetGroupInfoRequestV0 = (function() { + + /** + * Properties of a GetGroupInfoRequestV0. + * @memberof org.dash.platform.dapi.v0.GetGroupInfoRequest + * @interface IGetGroupInfoRequestV0 + * @property {Uint8Array|null} [contractId] GetGroupInfoRequestV0 contractId + * @property {number|null} [groupContractPosition] GetGroupInfoRequestV0 groupContractPosition + * @property {boolean|null} [prove] GetGroupInfoRequestV0 prove + */ + + /** + * Constructs a new GetGroupInfoRequestV0. + * @memberof org.dash.platform.dapi.v0.GetGroupInfoRequest + * @classdesc Represents a GetGroupInfoRequestV0. + * @implements IGetGroupInfoRequestV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetGroupInfoRequest.IGetGroupInfoRequestV0=} [properties] Properties to set + */ + function GetGroupInfoRequestV0(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]]; + } + + /** + * GetGroupInfoRequestV0 contractId. + * @member {Uint8Array} contractId + * @memberof org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0 + * @instance + */ + GetGroupInfoRequestV0.prototype.contractId = $util.newBuffer([]); + + /** + * GetGroupInfoRequestV0 groupContractPosition. + * @member {number} groupContractPosition + * @memberof org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0 + * @instance + */ + GetGroupInfoRequestV0.prototype.groupContractPosition = 0; + + /** + * GetGroupInfoRequestV0 prove. + * @member {boolean} prove + * @memberof org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0 + * @instance + */ + GetGroupInfoRequestV0.prototype.prove = false; + + /** + * Creates a new GetGroupInfoRequestV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfoRequest.IGetGroupInfoRequestV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0} GetGroupInfoRequestV0 instance + */ + GetGroupInfoRequestV0.create = function create(properties) { + return new GetGroupInfoRequestV0(properties); + }; + + /** + * Encodes the specified GetGroupInfoRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfoRequest.IGetGroupInfoRequestV0} message GetGroupInfoRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGroupInfoRequestV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.contractId != null && Object.hasOwnProperty.call(message, "contractId")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.contractId); + if (message.groupContractPosition != null && Object.hasOwnProperty.call(message, "groupContractPosition")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.groupContractPosition); + if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.prove); + return writer; + }; + + /** + * Encodes the specified GetGroupInfoRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfoRequest.IGetGroupInfoRequestV0} message GetGroupInfoRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGroupInfoRequestV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetGroupInfoRequestV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0} GetGroupInfoRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGroupInfoRequestV0.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.org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.contractId = reader.bytes(); + break; + case 2: + message.groupContractPosition = reader.uint32(); + break; + case 3: + message.prove = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetGroupInfoRequestV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0} GetGroupInfoRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGroupInfoRequestV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetGroupInfoRequestV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetGroupInfoRequestV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.contractId != null && message.hasOwnProperty("contractId")) + if (!(message.contractId && typeof message.contractId.length === "number" || $util.isString(message.contractId))) + return "contractId: buffer expected"; + if (message.groupContractPosition != null && message.hasOwnProperty("groupContractPosition")) + if (!$util.isInteger(message.groupContractPosition)) + return "groupContractPosition: integer expected"; + if (message.prove != null && message.hasOwnProperty("prove")) + if (typeof message.prove !== "boolean") + return "prove: boolean expected"; + return null; + }; + + /** + * Creates a GetGroupInfoRequestV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0} GetGroupInfoRequestV0 + */ + GetGroupInfoRequestV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0(); + if (object.contractId != null) + if (typeof object.contractId === "string") + $util.base64.decode(object.contractId, message.contractId = $util.newBuffer($util.base64.length(object.contractId)), 0); + else if (object.contractId.length >= 0) + message.contractId = object.contractId; + if (object.groupContractPosition != null) + message.groupContractPosition = object.groupContractPosition >>> 0; + if (object.prove != null) + message.prove = Boolean(object.prove); + return message; + }; + + /** + * Creates a plain object from a GetGroupInfoRequestV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0} message GetGroupInfoRequestV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetGroupInfoRequestV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.contractId = ""; + else { + object.contractId = []; + if (options.bytes !== Array) + object.contractId = $util.newBuffer(object.contractId); + } + object.groupContractPosition = 0; + object.prove = false; + } + if (message.contractId != null && message.hasOwnProperty("contractId")) + object.contractId = options.bytes === String ? $util.base64.encode(message.contractId, 0, message.contractId.length) : options.bytes === Array ? Array.prototype.slice.call(message.contractId) : message.contractId; + if (message.groupContractPosition != null && message.hasOwnProperty("groupContractPosition")) + object.groupContractPosition = message.groupContractPosition; + if (message.prove != null && message.hasOwnProperty("prove")) + object.prove = message.prove; + return object; + }; + + /** + * Converts this GetGroupInfoRequestV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0 + * @instance + * @returns {Object.} JSON object + */ + GetGroupInfoRequestV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetGroupInfoRequestV0; + })(); + + return GetGroupInfoRequest; + })(); + + v0.GetGroupInfoResponse = (function() { + + /** + * Properties of a GetGroupInfoResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetGroupInfoResponse + * @property {org.dash.platform.dapi.v0.GetGroupInfoResponse.IGetGroupInfoResponseV0|null} [v0] GetGroupInfoResponse v0 + */ + + /** + * Constructs a new GetGroupInfoResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetGroupInfoResponse. + * @implements IGetGroupInfoResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IGetGroupInfoResponse=} [properties] Properties to set + */ + function GetGroupInfoResponse(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]]; + } + + /** + * GetGroupInfoResponse v0. + * @member {org.dash.platform.dapi.v0.GetGroupInfoResponse.IGetGroupInfoResponseV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse + * @instance + */ + GetGroupInfoResponse.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetGroupInfoResponse version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse + * @instance + */ + Object.defineProperty(GetGroupInfoResponse.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetGroupInfoResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetGroupInfoResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetGroupInfoResponse} GetGroupInfoResponse instance + */ + GetGroupInfoResponse.create = function create(properties) { + return new GetGroupInfoResponse(properties); + }; + + /** + * Encodes the specified GetGroupInfoResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfoResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetGroupInfoResponse} message GetGroupInfoResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGroupInfoResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetGroupInfoResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfoResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetGroupInfoResponse} message GetGroupInfoResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGroupInfoResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetGroupInfoResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetGroupInfoResponse} GetGroupInfoResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGroupInfoResponse.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.org.dash.platform.dapi.v0.GetGroupInfoResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetGroupInfoResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetGroupInfoResponse} GetGroupInfoResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGroupInfoResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetGroupInfoResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetGroupInfoResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetGroupInfoResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetGroupInfoResponse} GetGroupInfoResponse + */ + GetGroupInfoResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupInfoResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetGroupInfoResponse(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetGroupInfoResponse.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetGroupInfoResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfoResponse} message GetGroupInfoResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetGroupInfoResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetGroupInfoResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse + * @instance + * @returns {Object.} JSON object + */ + GetGroupInfoResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetGroupInfoResponse.GetGroupInfoResponseV0 = (function() { + + /** + * Properties of a GetGroupInfoResponseV0. + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse + * @interface IGetGroupInfoResponseV0 + * @property {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.IGroupInfo|null} [groupInfo] GetGroupInfoResponseV0 groupInfo + * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetGroupInfoResponseV0 proof + * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetGroupInfoResponseV0 metadata + */ + + /** + * Constructs a new GetGroupInfoResponseV0. + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse + * @classdesc Represents a GetGroupInfoResponseV0. + * @implements IGetGroupInfoResponseV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetGroupInfoResponse.IGetGroupInfoResponseV0=} [properties] Properties to set + */ + function GetGroupInfoResponseV0(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]]; + } + + /** + * GetGroupInfoResponseV0 groupInfo. + * @member {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.IGroupInfo|null|undefined} groupInfo + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0 + * @instance + */ + GetGroupInfoResponseV0.prototype.groupInfo = null; + + /** + * GetGroupInfoResponseV0 proof. + * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0 + * @instance + */ + GetGroupInfoResponseV0.prototype.proof = null; + + /** + * GetGroupInfoResponseV0 metadata. + * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0 + * @instance + */ + GetGroupInfoResponseV0.prototype.metadata = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetGroupInfoResponseV0 result. + * @member {"groupInfo"|"proof"|undefined} result + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0 + * @instance + */ + Object.defineProperty(GetGroupInfoResponseV0.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["groupInfo", "proof"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetGroupInfoResponseV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfoResponse.IGetGroupInfoResponseV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0} GetGroupInfoResponseV0 instance + */ + GetGroupInfoResponseV0.create = function create(properties) { + return new GetGroupInfoResponseV0(properties); + }; + + /** + * Encodes the specified GetGroupInfoResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfoResponse.IGetGroupInfoResponseV0} message GetGroupInfoResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGroupInfoResponseV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.groupInfo != null && Object.hasOwnProperty.call(message, "groupInfo")) + $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfo.encode(message.groupInfo, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetGroupInfoResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfoResponse.IGetGroupInfoResponseV0} message GetGroupInfoResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGroupInfoResponseV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetGroupInfoResponseV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0} GetGroupInfoResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGroupInfoResponseV0.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.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.groupInfo = $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfo.decode(reader, reader.uint32()); + break; + case 2: + message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); + break; + case 4: + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetGroupInfoResponseV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0} GetGroupInfoResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGroupInfoResponseV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetGroupInfoResponseV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetGroupInfoResponseV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.groupInfo != null && message.hasOwnProperty("groupInfo")) { + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfo.verify(message.groupInfo); + if (error) + return "groupInfo." + error; + } + } + if (message.proof != null && message.hasOwnProperty("proof")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); + if (error) + return "proof." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a GetGroupInfoResponseV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0} GetGroupInfoResponseV0 + */ + GetGroupInfoResponseV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0(); + if (object.groupInfo != null) { + if (typeof object.groupInfo !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.groupInfo: object expected"); + message.groupInfo = $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfo.fromObject(object.groupInfo); + } + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.proof: object expected"); + message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.metadata: object expected"); + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a GetGroupInfoResponseV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0} message GetGroupInfoResponseV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetGroupInfoResponseV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.metadata = null; + if (message.groupInfo != null && message.hasOwnProperty("groupInfo")) { + object.groupInfo = $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfo.toObject(message.groupInfo, options); + if (options.oneofs) + object.result = "groupInfo"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); + if (options.oneofs) + object.result = "proof"; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this GetGroupInfoResponseV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0 + * @instance + * @returns {Object.} JSON object + */ + GetGroupInfoResponseV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetGroupInfoResponseV0.GroupMemberEntry = (function() { + + /** + * Properties of a GroupMemberEntry. + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0 + * @interface IGroupMemberEntry + * @property {Uint8Array|null} [memberId] GroupMemberEntry memberId + * @property {number|null} [power] GroupMemberEntry power + */ + + /** + * Constructs a new GroupMemberEntry. + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0 + * @classdesc Represents a GroupMemberEntry. + * @implements IGroupMemberEntry + * @constructor + * @param {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.IGroupMemberEntry=} [properties] Properties to set + */ + function GroupMemberEntry(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]]; + } + + /** + * GroupMemberEntry memberId. + * @member {Uint8Array} memberId + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupMemberEntry + * @instance + */ + GroupMemberEntry.prototype.memberId = $util.newBuffer([]); + + /** + * GroupMemberEntry power. + * @member {number} power + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupMemberEntry + * @instance + */ + GroupMemberEntry.prototype.power = 0; + + /** + * Creates a new GroupMemberEntry instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupMemberEntry + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.IGroupMemberEntry=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupMemberEntry} GroupMemberEntry instance + */ + GroupMemberEntry.create = function create(properties) { + return new GroupMemberEntry(properties); + }; + + /** + * Encodes the specified GroupMemberEntry message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupMemberEntry.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupMemberEntry + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.IGroupMemberEntry} message GroupMemberEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupMemberEntry.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.memberId != null && Object.hasOwnProperty.call(message, "memberId")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.memberId); + if (message.power != null && Object.hasOwnProperty.call(message, "power")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.power); + return writer; + }; + + /** + * Encodes the specified GroupMemberEntry message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupMemberEntry.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupMemberEntry + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.IGroupMemberEntry} message GroupMemberEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupMemberEntry.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GroupMemberEntry message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupMemberEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupMemberEntry} GroupMemberEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupMemberEntry.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.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupMemberEntry(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.memberId = reader.bytes(); + break; + case 2: + message.power = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GroupMemberEntry message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupMemberEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupMemberEntry} GroupMemberEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupMemberEntry.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GroupMemberEntry message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupMemberEntry + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GroupMemberEntry.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.memberId != null && message.hasOwnProperty("memberId")) + if (!(message.memberId && typeof message.memberId.length === "number" || $util.isString(message.memberId))) + return "memberId: buffer expected"; + if (message.power != null && message.hasOwnProperty("power")) + if (!$util.isInteger(message.power)) + return "power: integer expected"; + return null; + }; + + /** + * Creates a GroupMemberEntry message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupMemberEntry + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupMemberEntry} GroupMemberEntry + */ + GroupMemberEntry.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupMemberEntry) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupMemberEntry(); + if (object.memberId != null) + if (typeof object.memberId === "string") + $util.base64.decode(object.memberId, message.memberId = $util.newBuffer($util.base64.length(object.memberId)), 0); + else if (object.memberId.length >= 0) + message.memberId = object.memberId; + if (object.power != null) + message.power = object.power >>> 0; + return message; + }; + + /** + * Creates a plain object from a GroupMemberEntry message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupMemberEntry + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupMemberEntry} message GroupMemberEntry + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GroupMemberEntry.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.memberId = ""; + else { + object.memberId = []; + if (options.bytes !== Array) + object.memberId = $util.newBuffer(object.memberId); + } + object.power = 0; + } + if (message.memberId != null && message.hasOwnProperty("memberId")) + object.memberId = options.bytes === String ? $util.base64.encode(message.memberId, 0, message.memberId.length) : options.bytes === Array ? Array.prototype.slice.call(message.memberId) : message.memberId; + if (message.power != null && message.hasOwnProperty("power")) + object.power = message.power; + return object; + }; + + /** + * Converts this GroupMemberEntry to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupMemberEntry + * @instance + * @returns {Object.} JSON object + */ + GroupMemberEntry.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GroupMemberEntry; + })(); + + GetGroupInfoResponseV0.GroupInfoEntry = (function() { + + /** + * Properties of a GroupInfoEntry. + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0 + * @interface IGroupInfoEntry + * @property {Array.|null} [members] GroupInfoEntry members + * @property {number|null} [groupRequiredPower] GroupInfoEntry groupRequiredPower + */ + + /** + * Constructs a new GroupInfoEntry. + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0 + * @classdesc Represents a GroupInfoEntry. + * @implements IGroupInfoEntry + * @constructor + * @param {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.IGroupInfoEntry=} [properties] Properties to set + */ + function GroupInfoEntry(properties) { + this.members = []; + 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]]; + } + + /** + * GroupInfoEntry members. + * @member {Array.} members + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry + * @instance + */ + GroupInfoEntry.prototype.members = $util.emptyArray; + + /** + * GroupInfoEntry groupRequiredPower. + * @member {number} groupRequiredPower + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry + * @instance + */ + GroupInfoEntry.prototype.groupRequiredPower = 0; + + /** + * Creates a new GroupInfoEntry instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.IGroupInfoEntry=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry} GroupInfoEntry instance + */ + GroupInfoEntry.create = function create(properties) { + return new GroupInfoEntry(properties); + }; + + /** + * Encodes the specified GroupInfoEntry message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.IGroupInfoEntry} message GroupInfoEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupInfoEntry.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.members != null && message.members.length) + for (var i = 0; i < message.members.length; ++i) + $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupMemberEntry.encode(message.members[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.groupRequiredPower != null && Object.hasOwnProperty.call(message, "groupRequiredPower")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.groupRequiredPower); + return writer; + }; + + /** + * Encodes the specified GroupInfoEntry message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.IGroupInfoEntry} message GroupInfoEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupInfoEntry.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GroupInfoEntry message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry} GroupInfoEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupInfoEntry.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.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.members && message.members.length)) + message.members = []; + message.members.push($root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupMemberEntry.decode(reader, reader.uint32())); + break; + case 2: + message.groupRequiredPower = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GroupInfoEntry message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry} GroupInfoEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupInfoEntry.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GroupInfoEntry message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GroupInfoEntry.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.members != null && message.hasOwnProperty("members")) { + if (!Array.isArray(message.members)) + return "members: array expected"; + for (var i = 0; i < message.members.length; ++i) { + var error = $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupMemberEntry.verify(message.members[i]); + if (error) + return "members." + error; + } + } + if (message.groupRequiredPower != null && message.hasOwnProperty("groupRequiredPower")) + if (!$util.isInteger(message.groupRequiredPower)) + return "groupRequiredPower: integer expected"; + return null; + }; + + /** + * Creates a GroupInfoEntry message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry} GroupInfoEntry + */ + GroupInfoEntry.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry(); + if (object.members) { + if (!Array.isArray(object.members)) + throw TypeError(".org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry.members: array expected"); + message.members = []; + for (var i = 0; i < object.members.length; ++i) { + if (typeof object.members[i] !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry.members: object expected"); + message.members[i] = $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupMemberEntry.fromObject(object.members[i]); + } + } + if (object.groupRequiredPower != null) + message.groupRequiredPower = object.groupRequiredPower >>> 0; + return message; + }; + + /** + * Creates a plain object from a GroupInfoEntry message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry} message GroupInfoEntry + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GroupInfoEntry.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.members = []; + if (options.defaults) + object.groupRequiredPower = 0; + if (message.members && message.members.length) { + object.members = []; + for (var j = 0; j < message.members.length; ++j) + object.members[j] = $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupMemberEntry.toObject(message.members[j], options); + } + if (message.groupRequiredPower != null && message.hasOwnProperty("groupRequiredPower")) + object.groupRequiredPower = message.groupRequiredPower; + return object; + }; + + /** + * Converts this GroupInfoEntry to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry + * @instance + * @returns {Object.} JSON object + */ + GroupInfoEntry.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GroupInfoEntry; + })(); + + GetGroupInfoResponseV0.GroupInfo = (function() { + + /** + * Properties of a GroupInfo. + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0 + * @interface IGroupInfo + * @property {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.IGroupInfoEntry|null} [groupInfo] GroupInfo groupInfo + */ + + /** + * Constructs a new GroupInfo. + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0 + * @classdesc Represents a GroupInfo. + * @implements IGroupInfo + * @constructor + * @param {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.IGroupInfo=} [properties] Properties to set + */ + function GroupInfo(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]]; + } + + /** + * GroupInfo groupInfo. + * @member {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.IGroupInfoEntry|null|undefined} groupInfo + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfo + * @instance + */ + GroupInfo.prototype.groupInfo = null; + + /** + * Creates a new GroupInfo instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfo + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.IGroupInfo=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfo} GroupInfo instance + */ + GroupInfo.create = function create(properties) { + return new GroupInfo(properties); + }; + + /** + * Encodes the specified GroupInfo message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfo.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfo + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.IGroupInfo} message GroupInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.groupInfo != null && Object.hasOwnProperty.call(message, "groupInfo")) + $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry.encode(message.groupInfo, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GroupInfo message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfo + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.IGroupInfo} message GroupInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GroupInfo message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfo} GroupInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupInfo.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.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.groupInfo = $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GroupInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfo} GroupInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GroupInfo message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GroupInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.groupInfo != null && message.hasOwnProperty("groupInfo")) { + var error = $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry.verify(message.groupInfo); + if (error) + return "groupInfo." + error; + } + return null; + }; + + /** + * Creates a GroupInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfo + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfo} GroupInfo + */ + GroupInfo.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfo) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfo(); + if (object.groupInfo != null) { + if (typeof object.groupInfo !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfo.groupInfo: object expected"); + message.groupInfo = $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry.fromObject(object.groupInfo); + } + return message; + }; + + /** + * Creates a plain object from a GroupInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfo + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfo} message GroupInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GroupInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.groupInfo = null; + if (message.groupInfo != null && message.hasOwnProperty("groupInfo")) + object.groupInfo = $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry.toObject(message.groupInfo, options); + return object; + }; + + /** + * Converts this GroupInfo to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfo + * @instance + * @returns {Object.} JSON object + */ + GroupInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GroupInfo; + })(); + + return GetGroupInfoResponseV0; + })(); + + return GetGroupInfoResponse; + })(); + + v0.GetGroupInfosRequest = (function() { + + /** + * Properties of a GetGroupInfosRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetGroupInfosRequest + * @property {org.dash.platform.dapi.v0.GetGroupInfosRequest.IGetGroupInfosRequestV0|null} [v0] GetGroupInfosRequest v0 + */ + + /** + * Constructs a new GetGroupInfosRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetGroupInfosRequest. + * @implements IGetGroupInfosRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IGetGroupInfosRequest=} [properties] Properties to set + */ + function GetGroupInfosRequest(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]]; + } + + /** + * GetGroupInfosRequest v0. + * @member {org.dash.platform.dapi.v0.GetGroupInfosRequest.IGetGroupInfosRequestV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest + * @instance + */ + GetGroupInfosRequest.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetGroupInfosRequest version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest + * @instance + */ + Object.defineProperty(GetGroupInfosRequest.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetGroupInfosRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetGroupInfosRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetGroupInfosRequest} GetGroupInfosRequest instance + */ + GetGroupInfosRequest.create = function create(properties) { + return new GetGroupInfosRequest(properties); + }; + + /** + * Encodes the specified GetGroupInfosRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfosRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetGroupInfosRequest} message GetGroupInfosRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGroupInfosRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetGroupInfosRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfosRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetGroupInfosRequest} message GetGroupInfosRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGroupInfosRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetGroupInfosRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetGroupInfosRequest} GetGroupInfosRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGroupInfosRequest.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.org.dash.platform.dapi.v0.GetGroupInfosRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetGroupInfosRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetGroupInfosRequest} GetGroupInfosRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGroupInfosRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetGroupInfosRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetGroupInfosRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetGroupInfosRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetGroupInfosRequest} GetGroupInfosRequest + */ + GetGroupInfosRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupInfosRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetGroupInfosRequest(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetGroupInfosRequest.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetGroupInfosRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfosRequest} message GetGroupInfosRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetGroupInfosRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetGroupInfosRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest + * @instance + * @returns {Object.} JSON object + */ + GetGroupInfosRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetGroupInfosRequest.StartAtGroupContractPosition = (function() { + + /** + * Properties of a StartAtGroupContractPosition. + * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest + * @interface IStartAtGroupContractPosition + * @property {number|null} [startGroupContractPosition] StartAtGroupContractPosition startGroupContractPosition + * @property {boolean|null} [startGroupContractPositionIncluded] StartAtGroupContractPosition startGroupContractPositionIncluded + */ + + /** + * Constructs a new StartAtGroupContractPosition. + * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest + * @classdesc Represents a StartAtGroupContractPosition. + * @implements IStartAtGroupContractPosition + * @constructor + * @param {org.dash.platform.dapi.v0.GetGroupInfosRequest.IStartAtGroupContractPosition=} [properties] Properties to set + */ + function StartAtGroupContractPosition(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]]; + } + + /** + * StartAtGroupContractPosition startGroupContractPosition. + * @member {number} startGroupContractPosition + * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest.StartAtGroupContractPosition + * @instance + */ + StartAtGroupContractPosition.prototype.startGroupContractPosition = 0; + + /** + * StartAtGroupContractPosition startGroupContractPositionIncluded. + * @member {boolean} startGroupContractPositionIncluded + * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest.StartAtGroupContractPosition + * @instance + */ + StartAtGroupContractPosition.prototype.startGroupContractPositionIncluded = false; + + /** + * Creates a new StartAtGroupContractPosition instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest.StartAtGroupContractPosition + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfosRequest.IStartAtGroupContractPosition=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetGroupInfosRequest.StartAtGroupContractPosition} StartAtGroupContractPosition instance + */ + StartAtGroupContractPosition.create = function create(properties) { + return new StartAtGroupContractPosition(properties); + }; + + /** + * Encodes the specified StartAtGroupContractPosition message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfosRequest.StartAtGroupContractPosition.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest.StartAtGroupContractPosition + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfosRequest.IStartAtGroupContractPosition} message StartAtGroupContractPosition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StartAtGroupContractPosition.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.startGroupContractPosition != null && Object.hasOwnProperty.call(message, "startGroupContractPosition")) + writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.startGroupContractPosition); + if (message.startGroupContractPositionIncluded != null && Object.hasOwnProperty.call(message, "startGroupContractPositionIncluded")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.startGroupContractPositionIncluded); + return writer; + }; + + /** + * Encodes the specified StartAtGroupContractPosition message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfosRequest.StartAtGroupContractPosition.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest.StartAtGroupContractPosition + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfosRequest.IStartAtGroupContractPosition} message StartAtGroupContractPosition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StartAtGroupContractPosition.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StartAtGroupContractPosition message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest.StartAtGroupContractPosition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetGroupInfosRequest.StartAtGroupContractPosition} StartAtGroupContractPosition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StartAtGroupContractPosition.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.org.dash.platform.dapi.v0.GetGroupInfosRequest.StartAtGroupContractPosition(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.startGroupContractPosition = reader.uint32(); + break; + case 2: + message.startGroupContractPositionIncluded = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StartAtGroupContractPosition message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest.StartAtGroupContractPosition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetGroupInfosRequest.StartAtGroupContractPosition} StartAtGroupContractPosition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StartAtGroupContractPosition.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StartAtGroupContractPosition message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest.StartAtGroupContractPosition + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StartAtGroupContractPosition.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.startGroupContractPosition != null && message.hasOwnProperty("startGroupContractPosition")) + if (!$util.isInteger(message.startGroupContractPosition)) + return "startGroupContractPosition: integer expected"; + if (message.startGroupContractPositionIncluded != null && message.hasOwnProperty("startGroupContractPositionIncluded")) + if (typeof message.startGroupContractPositionIncluded !== "boolean") + return "startGroupContractPositionIncluded: boolean expected"; + return null; + }; + + /** + * Creates a StartAtGroupContractPosition message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest.StartAtGroupContractPosition + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetGroupInfosRequest.StartAtGroupContractPosition} StartAtGroupContractPosition + */ + StartAtGroupContractPosition.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupInfosRequest.StartAtGroupContractPosition) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetGroupInfosRequest.StartAtGroupContractPosition(); + if (object.startGroupContractPosition != null) + message.startGroupContractPosition = object.startGroupContractPosition >>> 0; + if (object.startGroupContractPositionIncluded != null) + message.startGroupContractPositionIncluded = Boolean(object.startGroupContractPositionIncluded); + return message; + }; + + /** + * Creates a plain object from a StartAtGroupContractPosition message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest.StartAtGroupContractPosition + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfosRequest.StartAtGroupContractPosition} message StartAtGroupContractPosition + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StartAtGroupContractPosition.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.startGroupContractPosition = 0; + object.startGroupContractPositionIncluded = false; + } + if (message.startGroupContractPosition != null && message.hasOwnProperty("startGroupContractPosition")) + object.startGroupContractPosition = message.startGroupContractPosition; + if (message.startGroupContractPositionIncluded != null && message.hasOwnProperty("startGroupContractPositionIncluded")) + object.startGroupContractPositionIncluded = message.startGroupContractPositionIncluded; + return object; + }; + + /** + * Converts this StartAtGroupContractPosition to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest.StartAtGroupContractPosition + * @instance + * @returns {Object.} JSON object + */ + StartAtGroupContractPosition.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return StartAtGroupContractPosition; + })(); + + GetGroupInfosRequest.GetGroupInfosRequestV0 = (function() { + + /** + * Properties of a GetGroupInfosRequestV0. + * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest + * @interface IGetGroupInfosRequestV0 + * @property {Uint8Array|null} [contractId] GetGroupInfosRequestV0 contractId + * @property {org.dash.platform.dapi.v0.GetGroupInfosRequest.IStartAtGroupContractPosition|null} [startAtGroupContractPosition] GetGroupInfosRequestV0 startAtGroupContractPosition + * @property {number|null} [count] GetGroupInfosRequestV0 count + * @property {boolean|null} [prove] GetGroupInfosRequestV0 prove + */ + + /** + * Constructs a new GetGroupInfosRequestV0. + * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest + * @classdesc Represents a GetGroupInfosRequestV0. + * @implements IGetGroupInfosRequestV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetGroupInfosRequest.IGetGroupInfosRequestV0=} [properties] Properties to set + */ + function GetGroupInfosRequestV0(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]]; + } + + /** + * GetGroupInfosRequestV0 contractId. + * @member {Uint8Array} contractId + * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0 + * @instance + */ + GetGroupInfosRequestV0.prototype.contractId = $util.newBuffer([]); + + /** + * GetGroupInfosRequestV0 startAtGroupContractPosition. + * @member {org.dash.platform.dapi.v0.GetGroupInfosRequest.IStartAtGroupContractPosition|null|undefined} startAtGroupContractPosition + * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0 + * @instance + */ + GetGroupInfosRequestV0.prototype.startAtGroupContractPosition = null; + + /** + * GetGroupInfosRequestV0 count. + * @member {number} count + * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0 + * @instance + */ + GetGroupInfosRequestV0.prototype.count = 0; + + /** + * GetGroupInfosRequestV0 prove. + * @member {boolean} prove + * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0 + * @instance + */ + GetGroupInfosRequestV0.prototype.prove = false; + + /** + * Creates a new GetGroupInfosRequestV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfosRequest.IGetGroupInfosRequestV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0} GetGroupInfosRequestV0 instance + */ + GetGroupInfosRequestV0.create = function create(properties) { + return new GetGroupInfosRequestV0(properties); + }; + + /** + * Encodes the specified GetGroupInfosRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfosRequest.IGetGroupInfosRequestV0} message GetGroupInfosRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGroupInfosRequestV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.contractId != null && Object.hasOwnProperty.call(message, "contractId")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.contractId); + if (message.startAtGroupContractPosition != null && Object.hasOwnProperty.call(message, "startAtGroupContractPosition")) + $root.org.dash.platform.dapi.v0.GetGroupInfosRequest.StartAtGroupContractPosition.encode(message.startAtGroupContractPosition, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.count != null && Object.hasOwnProperty.call(message, "count")) + writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.count); + if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.prove); + return writer; + }; + + /** + * Encodes the specified GetGroupInfosRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfosRequest.IGetGroupInfosRequestV0} message GetGroupInfosRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGroupInfosRequestV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetGroupInfosRequestV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0} GetGroupInfosRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGroupInfosRequestV0.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.org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.contractId = reader.bytes(); + break; + case 2: + message.startAtGroupContractPosition = $root.org.dash.platform.dapi.v0.GetGroupInfosRequest.StartAtGroupContractPosition.decode(reader, reader.uint32()); + break; + case 3: + message.count = reader.uint32(); + break; + case 4: + message.prove = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetGroupInfosRequestV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0} GetGroupInfosRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGroupInfosRequestV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetGroupInfosRequestV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetGroupInfosRequestV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.contractId != null && message.hasOwnProperty("contractId")) + if (!(message.contractId && typeof message.contractId.length === "number" || $util.isString(message.contractId))) + return "contractId: buffer expected"; + if (message.startAtGroupContractPosition != null && message.hasOwnProperty("startAtGroupContractPosition")) { + var error = $root.org.dash.platform.dapi.v0.GetGroupInfosRequest.StartAtGroupContractPosition.verify(message.startAtGroupContractPosition); + if (error) + return "startAtGroupContractPosition." + error; + } + if (message.count != null && message.hasOwnProperty("count")) + if (!$util.isInteger(message.count)) + return "count: integer expected"; + if (message.prove != null && message.hasOwnProperty("prove")) + if (typeof message.prove !== "boolean") + return "prove: boolean expected"; + return null; + }; + + /** + * Creates a GetGroupInfosRequestV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0} GetGroupInfosRequestV0 + */ + GetGroupInfosRequestV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0(); + if (object.contractId != null) + if (typeof object.contractId === "string") + $util.base64.decode(object.contractId, message.contractId = $util.newBuffer($util.base64.length(object.contractId)), 0); + else if (object.contractId.length >= 0) + message.contractId = object.contractId; + if (object.startAtGroupContractPosition != null) { + if (typeof object.startAtGroupContractPosition !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0.startAtGroupContractPosition: object expected"); + message.startAtGroupContractPosition = $root.org.dash.platform.dapi.v0.GetGroupInfosRequest.StartAtGroupContractPosition.fromObject(object.startAtGroupContractPosition); + } + if (object.count != null) + message.count = object.count >>> 0; + if (object.prove != null) + message.prove = Boolean(object.prove); + return message; + }; + + /** + * Creates a plain object from a GetGroupInfosRequestV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0} message GetGroupInfosRequestV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetGroupInfosRequestV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.contractId = ""; + else { + object.contractId = []; + if (options.bytes !== Array) + object.contractId = $util.newBuffer(object.contractId); + } + object.startAtGroupContractPosition = null; + object.count = 0; + object.prove = false; + } + if (message.contractId != null && message.hasOwnProperty("contractId")) + object.contractId = options.bytes === String ? $util.base64.encode(message.contractId, 0, message.contractId.length) : options.bytes === Array ? Array.prototype.slice.call(message.contractId) : message.contractId; + if (message.startAtGroupContractPosition != null && message.hasOwnProperty("startAtGroupContractPosition")) + object.startAtGroupContractPosition = $root.org.dash.platform.dapi.v0.GetGroupInfosRequest.StartAtGroupContractPosition.toObject(message.startAtGroupContractPosition, options); + if (message.count != null && message.hasOwnProperty("count")) + object.count = message.count; + if (message.prove != null && message.hasOwnProperty("prove")) + object.prove = message.prove; + return object; + }; + + /** + * Converts this GetGroupInfosRequestV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0 + * @instance + * @returns {Object.} JSON object + */ + GetGroupInfosRequestV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetGroupInfosRequestV0; + })(); + + return GetGroupInfosRequest; + })(); + + v0.GetGroupInfosResponse = (function() { + + /** + * Properties of a GetGroupInfosResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetGroupInfosResponse + * @property {org.dash.platform.dapi.v0.GetGroupInfosResponse.IGetGroupInfosResponseV0|null} [v0] GetGroupInfosResponse v0 + */ + + /** + * Constructs a new GetGroupInfosResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetGroupInfosResponse. + * @implements IGetGroupInfosResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IGetGroupInfosResponse=} [properties] Properties to set + */ + function GetGroupInfosResponse(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]]; + } + + /** + * GetGroupInfosResponse v0. + * @member {org.dash.platform.dapi.v0.GetGroupInfosResponse.IGetGroupInfosResponseV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse + * @instance + */ + GetGroupInfosResponse.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetGroupInfosResponse version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse + * @instance + */ + Object.defineProperty(GetGroupInfosResponse.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetGroupInfosResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetGroupInfosResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetGroupInfosResponse} GetGroupInfosResponse instance + */ + GetGroupInfosResponse.create = function create(properties) { + return new GetGroupInfosResponse(properties); + }; + + /** + * Encodes the specified GetGroupInfosResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfosResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetGroupInfosResponse} message GetGroupInfosResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGroupInfosResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetGroupInfosResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfosResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetGroupInfosResponse} message GetGroupInfosResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGroupInfosResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetGroupInfosResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetGroupInfosResponse} GetGroupInfosResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGroupInfosResponse.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.org.dash.platform.dapi.v0.GetGroupInfosResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetGroupInfosResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetGroupInfosResponse} GetGroupInfosResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGroupInfosResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetGroupInfosResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetGroupInfosResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetGroupInfosResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetGroupInfosResponse} GetGroupInfosResponse + */ + GetGroupInfosResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupInfosResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetGroupInfosResponse(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetGroupInfosResponse.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetGroupInfosResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfosResponse} message GetGroupInfosResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetGroupInfosResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetGroupInfosResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse + * @instance + * @returns {Object.} JSON object + */ + GetGroupInfosResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetGroupInfosResponse.GetGroupInfosResponseV0 = (function() { + + /** + * Properties of a GetGroupInfosResponseV0. + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse + * @interface IGetGroupInfosResponseV0 + * @property {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.IGroupInfos|null} [groupInfos] GetGroupInfosResponseV0 groupInfos + * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetGroupInfosResponseV0 proof + * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetGroupInfosResponseV0 metadata + */ + + /** + * Constructs a new GetGroupInfosResponseV0. + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse + * @classdesc Represents a GetGroupInfosResponseV0. + * @implements IGetGroupInfosResponseV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetGroupInfosResponse.IGetGroupInfosResponseV0=} [properties] Properties to set + */ + function GetGroupInfosResponseV0(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]]; + } + + /** + * GetGroupInfosResponseV0 groupInfos. + * @member {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.IGroupInfos|null|undefined} groupInfos + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0 + * @instance + */ + GetGroupInfosResponseV0.prototype.groupInfos = null; + + /** + * GetGroupInfosResponseV0 proof. + * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0 + * @instance + */ + GetGroupInfosResponseV0.prototype.proof = null; + + /** + * GetGroupInfosResponseV0 metadata. + * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0 + * @instance + */ + GetGroupInfosResponseV0.prototype.metadata = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetGroupInfosResponseV0 result. + * @member {"groupInfos"|"proof"|undefined} result + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0 + * @instance + */ + Object.defineProperty(GetGroupInfosResponseV0.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["groupInfos", "proof"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetGroupInfosResponseV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfosResponse.IGetGroupInfosResponseV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0} GetGroupInfosResponseV0 instance + */ + GetGroupInfosResponseV0.create = function create(properties) { + return new GetGroupInfosResponseV0(properties); + }; + + /** + * Encodes the specified GetGroupInfosResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfosResponse.IGetGroupInfosResponseV0} message GetGroupInfosResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGroupInfosResponseV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.groupInfos != null && Object.hasOwnProperty.call(message, "groupInfos")) + $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfos.encode(message.groupInfos, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetGroupInfosResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfosResponse.IGetGroupInfosResponseV0} message GetGroupInfosResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGroupInfosResponseV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetGroupInfosResponseV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0} GetGroupInfosResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGroupInfosResponseV0.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.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.groupInfos = $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfos.decode(reader, reader.uint32()); + break; + case 2: + message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); + break; + case 4: + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetGroupInfosResponseV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0} GetGroupInfosResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGroupInfosResponseV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetGroupInfosResponseV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetGroupInfosResponseV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.groupInfos != null && message.hasOwnProperty("groupInfos")) { + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfos.verify(message.groupInfos); + if (error) + return "groupInfos." + error; + } + } + if (message.proof != null && message.hasOwnProperty("proof")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); + if (error) + return "proof." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a GetGroupInfosResponseV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0} GetGroupInfosResponseV0 + */ + GetGroupInfosResponseV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0(); + if (object.groupInfos != null) { + if (typeof object.groupInfos !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.groupInfos: object expected"); + message.groupInfos = $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfos.fromObject(object.groupInfos); + } + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.proof: object expected"); + message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.metadata: object expected"); + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a GetGroupInfosResponseV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0} message GetGroupInfosResponseV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetGroupInfosResponseV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.metadata = null; + if (message.groupInfos != null && message.hasOwnProperty("groupInfos")) { + object.groupInfos = $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfos.toObject(message.groupInfos, options); + if (options.oneofs) + object.result = "groupInfos"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); + if (options.oneofs) + object.result = "proof"; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this GetGroupInfosResponseV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0 + * @instance + * @returns {Object.} JSON object + */ + GetGroupInfosResponseV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetGroupInfosResponseV0.GroupMemberEntry = (function() { + + /** + * Properties of a GroupMemberEntry. + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0 + * @interface IGroupMemberEntry + * @property {Uint8Array|null} [memberId] GroupMemberEntry memberId + * @property {number|null} [power] GroupMemberEntry power + */ + + /** + * Constructs a new GroupMemberEntry. + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0 + * @classdesc Represents a GroupMemberEntry. + * @implements IGroupMemberEntry + * @constructor + * @param {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.IGroupMemberEntry=} [properties] Properties to set + */ + function GroupMemberEntry(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]]; + } + + /** + * GroupMemberEntry memberId. + * @member {Uint8Array} memberId + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupMemberEntry + * @instance + */ + GroupMemberEntry.prototype.memberId = $util.newBuffer([]); + + /** + * GroupMemberEntry power. + * @member {number} power + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupMemberEntry + * @instance + */ + GroupMemberEntry.prototype.power = 0; + + /** + * Creates a new GroupMemberEntry instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupMemberEntry + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.IGroupMemberEntry=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupMemberEntry} GroupMemberEntry instance + */ + GroupMemberEntry.create = function create(properties) { + return new GroupMemberEntry(properties); + }; + + /** + * Encodes the specified GroupMemberEntry message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupMemberEntry.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupMemberEntry + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.IGroupMemberEntry} message GroupMemberEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupMemberEntry.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.memberId != null && Object.hasOwnProperty.call(message, "memberId")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.memberId); + if (message.power != null && Object.hasOwnProperty.call(message, "power")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.power); + return writer; + }; + + /** + * Encodes the specified GroupMemberEntry message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupMemberEntry.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupMemberEntry + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.IGroupMemberEntry} message GroupMemberEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupMemberEntry.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GroupMemberEntry message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupMemberEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupMemberEntry} GroupMemberEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupMemberEntry.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.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupMemberEntry(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.memberId = reader.bytes(); + break; + case 2: + message.power = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GroupMemberEntry message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupMemberEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupMemberEntry} GroupMemberEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupMemberEntry.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GroupMemberEntry message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupMemberEntry + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GroupMemberEntry.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.memberId != null && message.hasOwnProperty("memberId")) + if (!(message.memberId && typeof message.memberId.length === "number" || $util.isString(message.memberId))) + return "memberId: buffer expected"; + if (message.power != null && message.hasOwnProperty("power")) + if (!$util.isInteger(message.power)) + return "power: integer expected"; + return null; + }; + + /** + * Creates a GroupMemberEntry message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupMemberEntry + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupMemberEntry} GroupMemberEntry + */ + GroupMemberEntry.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupMemberEntry) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupMemberEntry(); + if (object.memberId != null) + if (typeof object.memberId === "string") + $util.base64.decode(object.memberId, message.memberId = $util.newBuffer($util.base64.length(object.memberId)), 0); + else if (object.memberId.length >= 0) + message.memberId = object.memberId; + if (object.power != null) + message.power = object.power >>> 0; + return message; + }; + + /** + * Creates a plain object from a GroupMemberEntry message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupMemberEntry + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupMemberEntry} message GroupMemberEntry + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GroupMemberEntry.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.memberId = ""; + else { + object.memberId = []; + if (options.bytes !== Array) + object.memberId = $util.newBuffer(object.memberId); + } + object.power = 0; + } + if (message.memberId != null && message.hasOwnProperty("memberId")) + object.memberId = options.bytes === String ? $util.base64.encode(message.memberId, 0, message.memberId.length) : options.bytes === Array ? Array.prototype.slice.call(message.memberId) : message.memberId; + if (message.power != null && message.hasOwnProperty("power")) + object.power = message.power; + return object; + }; + + /** + * Converts this GroupMemberEntry to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupMemberEntry + * @instance + * @returns {Object.} JSON object + */ + GroupMemberEntry.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GroupMemberEntry; + })(); + + GetGroupInfosResponseV0.GroupPositionInfoEntry = (function() { + + /** + * Properties of a GroupPositionInfoEntry. + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0 + * @interface IGroupPositionInfoEntry + * @property {number|null} [groupContractPosition] GroupPositionInfoEntry groupContractPosition + * @property {Array.|null} [members] GroupPositionInfoEntry members + * @property {number|null} [groupRequiredPower] GroupPositionInfoEntry groupRequiredPower + */ + + /** + * Constructs a new GroupPositionInfoEntry. + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0 + * @classdesc Represents a GroupPositionInfoEntry. + * @implements IGroupPositionInfoEntry + * @constructor + * @param {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.IGroupPositionInfoEntry=} [properties] Properties to set + */ + function GroupPositionInfoEntry(properties) { + this.members = []; + 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]]; + } + + /** + * GroupPositionInfoEntry groupContractPosition. + * @member {number} groupContractPosition + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry + * @instance + */ + GroupPositionInfoEntry.prototype.groupContractPosition = 0; + + /** + * GroupPositionInfoEntry members. + * @member {Array.} members + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry + * @instance + */ + GroupPositionInfoEntry.prototype.members = $util.emptyArray; + + /** + * GroupPositionInfoEntry groupRequiredPower. + * @member {number} groupRequiredPower + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry + * @instance + */ + GroupPositionInfoEntry.prototype.groupRequiredPower = 0; + + /** + * Creates a new GroupPositionInfoEntry instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.IGroupPositionInfoEntry=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry} GroupPositionInfoEntry instance + */ + GroupPositionInfoEntry.create = function create(properties) { + return new GroupPositionInfoEntry(properties); + }; + + /** + * Encodes the specified GroupPositionInfoEntry message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.IGroupPositionInfoEntry} message GroupPositionInfoEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupPositionInfoEntry.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.groupContractPosition != null && Object.hasOwnProperty.call(message, "groupContractPosition")) + writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.groupContractPosition); + if (message.members != null && message.members.length) + for (var i = 0; i < message.members.length; ++i) + $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupMemberEntry.encode(message.members[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.groupRequiredPower != null && Object.hasOwnProperty.call(message, "groupRequiredPower")) + writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.groupRequiredPower); + return writer; + }; + + /** + * Encodes the specified GroupPositionInfoEntry message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.IGroupPositionInfoEntry} message GroupPositionInfoEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupPositionInfoEntry.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GroupPositionInfoEntry message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry} GroupPositionInfoEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupPositionInfoEntry.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.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.groupContractPosition = reader.uint32(); + break; + case 2: + if (!(message.members && message.members.length)) + message.members = []; + message.members.push($root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupMemberEntry.decode(reader, reader.uint32())); + break; + case 3: + message.groupRequiredPower = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GroupPositionInfoEntry message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry} GroupPositionInfoEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupPositionInfoEntry.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GroupPositionInfoEntry message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GroupPositionInfoEntry.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.groupContractPosition != null && message.hasOwnProperty("groupContractPosition")) + if (!$util.isInteger(message.groupContractPosition)) + return "groupContractPosition: integer expected"; + if (message.members != null && message.hasOwnProperty("members")) { + if (!Array.isArray(message.members)) + return "members: array expected"; + for (var i = 0; i < message.members.length; ++i) { + var error = $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupMemberEntry.verify(message.members[i]); + if (error) + return "members." + error; + } + } + if (message.groupRequiredPower != null && message.hasOwnProperty("groupRequiredPower")) + if (!$util.isInteger(message.groupRequiredPower)) + return "groupRequiredPower: integer expected"; + return null; + }; + + /** + * Creates a GroupPositionInfoEntry message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry} GroupPositionInfoEntry + */ + GroupPositionInfoEntry.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry(); + if (object.groupContractPosition != null) + message.groupContractPosition = object.groupContractPosition >>> 0; + if (object.members) { + if (!Array.isArray(object.members)) + throw TypeError(".org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry.members: array expected"); + message.members = []; + for (var i = 0; i < object.members.length; ++i) { + if (typeof object.members[i] !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry.members: object expected"); + message.members[i] = $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupMemberEntry.fromObject(object.members[i]); + } + } + if (object.groupRequiredPower != null) + message.groupRequiredPower = object.groupRequiredPower >>> 0; + return message; + }; + + /** + * Creates a plain object from a GroupPositionInfoEntry message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry} message GroupPositionInfoEntry + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GroupPositionInfoEntry.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.members = []; + if (options.defaults) { + object.groupContractPosition = 0; + object.groupRequiredPower = 0; + } + if (message.groupContractPosition != null && message.hasOwnProperty("groupContractPosition")) + object.groupContractPosition = message.groupContractPosition; + if (message.members && message.members.length) { + object.members = []; + for (var j = 0; j < message.members.length; ++j) + object.members[j] = $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupMemberEntry.toObject(message.members[j], options); + } + if (message.groupRequiredPower != null && message.hasOwnProperty("groupRequiredPower")) + object.groupRequiredPower = message.groupRequiredPower; + return object; + }; + + /** + * Converts this GroupPositionInfoEntry to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry + * @instance + * @returns {Object.} JSON object + */ + GroupPositionInfoEntry.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GroupPositionInfoEntry; + })(); + + GetGroupInfosResponseV0.GroupInfos = (function() { + + /** + * Properties of a GroupInfos. + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0 + * @interface IGroupInfos + * @property {Array.|null} [groupInfos] GroupInfos groupInfos + */ + + /** + * Constructs a new GroupInfos. + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0 + * @classdesc Represents a GroupInfos. + * @implements IGroupInfos + * @constructor + * @param {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.IGroupInfos=} [properties] Properties to set + */ + function GroupInfos(properties) { + this.groupInfos = []; + 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]]; + } + + /** + * GroupInfos groupInfos. + * @member {Array.} groupInfos + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfos + * @instance + */ + GroupInfos.prototype.groupInfos = $util.emptyArray; + + /** + * Creates a new GroupInfos instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfos + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.IGroupInfos=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfos} GroupInfos instance + */ + GroupInfos.create = function create(properties) { + return new GroupInfos(properties); + }; + + /** + * Encodes the specified GroupInfos message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfos.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfos + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.IGroupInfos} message GroupInfos message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupInfos.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.groupInfos != null && message.groupInfos.length) + for (var i = 0; i < message.groupInfos.length; ++i) + $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry.encode(message.groupInfos[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GroupInfos message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfos.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfos + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.IGroupInfos} message GroupInfos message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupInfos.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GroupInfos message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfos + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfos} GroupInfos + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupInfos.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.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfos(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.groupInfos && message.groupInfos.length)) + message.groupInfos = []; + message.groupInfos.push($root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GroupInfos message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfos + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfos} GroupInfos + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupInfos.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GroupInfos message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfos + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GroupInfos.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.groupInfos != null && message.hasOwnProperty("groupInfos")) { + if (!Array.isArray(message.groupInfos)) + return "groupInfos: array expected"; + for (var i = 0; i < message.groupInfos.length; ++i) { + var error = $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry.verify(message.groupInfos[i]); + if (error) + return "groupInfos." + error; + } + } + return null; + }; + + /** + * Creates a GroupInfos message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfos + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfos} GroupInfos + */ + GroupInfos.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfos) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfos(); + if (object.groupInfos) { + if (!Array.isArray(object.groupInfos)) + throw TypeError(".org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfos.groupInfos: array expected"); + message.groupInfos = []; + for (var i = 0; i < object.groupInfos.length; ++i) { + if (typeof object.groupInfos[i] !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfos.groupInfos: object expected"); + message.groupInfos[i] = $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry.fromObject(object.groupInfos[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a GroupInfos message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfos + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfos} message GroupInfos + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GroupInfos.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.groupInfos = []; + if (message.groupInfos && message.groupInfos.length) { + object.groupInfos = []; + for (var j = 0; j < message.groupInfos.length; ++j) + object.groupInfos[j] = $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry.toObject(message.groupInfos[j], options); + } + return object; + }; + + /** + * Converts this GroupInfos to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfos + * @instance + * @returns {Object.} JSON object + */ + GroupInfos.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GroupInfos; + })(); + + return GetGroupInfosResponseV0; + })(); + + return GetGroupInfosResponse; + })(); + + v0.GetGroupActionsRequest = (function() { + + /** + * Properties of a GetGroupActionsRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetGroupActionsRequest + * @property {org.dash.platform.dapi.v0.GetGroupActionsRequest.IGetGroupActionsRequestV0|null} [v0] GetGroupActionsRequest v0 + */ + + /** + * Constructs a new GetGroupActionsRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetGroupActionsRequest. + * @implements IGetGroupActionsRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IGetGroupActionsRequest=} [properties] Properties to set + */ + function GetGroupActionsRequest(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]]; + } + + /** + * GetGroupActionsRequest v0. + * @member {org.dash.platform.dapi.v0.GetGroupActionsRequest.IGetGroupActionsRequestV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest + * @instance + */ + GetGroupActionsRequest.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetGroupActionsRequest version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest + * @instance + */ + Object.defineProperty(GetGroupActionsRequest.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetGroupActionsRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetGroupActionsRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetGroupActionsRequest} GetGroupActionsRequest instance + */ + GetGroupActionsRequest.create = function create(properties) { + return new GetGroupActionsRequest(properties); + }; + + /** + * Encodes the specified GetGroupActionsRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetGroupActionsRequest} message GetGroupActionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGroupActionsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetGroupActionsRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetGroupActionsRequest} message GetGroupActionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGroupActionsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetGroupActionsRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetGroupActionsRequest} GetGroupActionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGroupActionsRequest.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.org.dash.platform.dapi.v0.GetGroupActionsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetGroupActionsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetGroupActionsRequest} GetGroupActionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGroupActionsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetGroupActionsRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetGroupActionsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetGroupActionsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetGroupActionsRequest} GetGroupActionsRequest + */ + GetGroupActionsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionsRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetGroupActionsRequest(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionsRequest.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetGroupActionsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsRequest} message GetGroupActionsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetGroupActionsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetGroupActionsRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest + * @instance + * @returns {Object.} JSON object + */ + GetGroupActionsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * ActionStatus enum. + * @name org.dash.platform.dapi.v0.GetGroupActionsRequest.ActionStatus + * @enum {number} + * @property {number} ACTIVE=0 ACTIVE value + * @property {number} CLOSED=1 CLOSED value + */ + GetGroupActionsRequest.ActionStatus = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ACTIVE"] = 0; + values[valuesById[1] = "CLOSED"] = 1; + return values; + })(); + + GetGroupActionsRequest.StartAtActionId = (function() { + + /** + * Properties of a StartAtActionId. + * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest + * @interface IStartAtActionId + * @property {Uint8Array|null} [startActionId] StartAtActionId startActionId + * @property {boolean|null} [startActionIdIncluded] StartAtActionId startActionIdIncluded + */ + + /** + * Constructs a new StartAtActionId. + * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest + * @classdesc Represents a StartAtActionId. + * @implements IStartAtActionId + * @constructor + * @param {org.dash.platform.dapi.v0.GetGroupActionsRequest.IStartAtActionId=} [properties] Properties to set + */ + function StartAtActionId(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]]; + } + + /** + * StartAtActionId startActionId. + * @member {Uint8Array} startActionId + * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest.StartAtActionId + * @instance + */ + StartAtActionId.prototype.startActionId = $util.newBuffer([]); + + /** + * StartAtActionId startActionIdIncluded. + * @member {boolean} startActionIdIncluded + * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest.StartAtActionId + * @instance + */ + StartAtActionId.prototype.startActionIdIncluded = false; + + /** + * Creates a new StartAtActionId instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest.StartAtActionId + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsRequest.IStartAtActionId=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetGroupActionsRequest.StartAtActionId} StartAtActionId instance + */ + StartAtActionId.create = function create(properties) { + return new StartAtActionId(properties); + }; + + /** + * Encodes the specified StartAtActionId message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsRequest.StartAtActionId.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest.StartAtActionId + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsRequest.IStartAtActionId} message StartAtActionId message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StartAtActionId.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.startActionId != null && Object.hasOwnProperty.call(message, "startActionId")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.startActionId); + if (message.startActionIdIncluded != null && Object.hasOwnProperty.call(message, "startActionIdIncluded")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.startActionIdIncluded); + return writer; + }; + + /** + * Encodes the specified StartAtActionId message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsRequest.StartAtActionId.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest.StartAtActionId + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsRequest.IStartAtActionId} message StartAtActionId message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StartAtActionId.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StartAtActionId message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest.StartAtActionId + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetGroupActionsRequest.StartAtActionId} StartAtActionId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StartAtActionId.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.org.dash.platform.dapi.v0.GetGroupActionsRequest.StartAtActionId(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.startActionId = reader.bytes(); + break; + case 2: + message.startActionIdIncluded = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StartAtActionId message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest.StartAtActionId + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetGroupActionsRequest.StartAtActionId} StartAtActionId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StartAtActionId.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StartAtActionId message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest.StartAtActionId + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StartAtActionId.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.startActionId != null && message.hasOwnProperty("startActionId")) + if (!(message.startActionId && typeof message.startActionId.length === "number" || $util.isString(message.startActionId))) + return "startActionId: buffer expected"; + if (message.startActionIdIncluded != null && message.hasOwnProperty("startActionIdIncluded")) + if (typeof message.startActionIdIncluded !== "boolean") + return "startActionIdIncluded: boolean expected"; + return null; + }; + + /** + * Creates a StartAtActionId message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest.StartAtActionId + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetGroupActionsRequest.StartAtActionId} StartAtActionId + */ + StartAtActionId.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionsRequest.StartAtActionId) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetGroupActionsRequest.StartAtActionId(); + if (object.startActionId != null) + if (typeof object.startActionId === "string") + $util.base64.decode(object.startActionId, message.startActionId = $util.newBuffer($util.base64.length(object.startActionId)), 0); + else if (object.startActionId.length >= 0) + message.startActionId = object.startActionId; + if (object.startActionIdIncluded != null) + message.startActionIdIncluded = Boolean(object.startActionIdIncluded); + return message; + }; + + /** + * Creates a plain object from a StartAtActionId message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest.StartAtActionId + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsRequest.StartAtActionId} message StartAtActionId + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StartAtActionId.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.startActionId = ""; + else { + object.startActionId = []; + if (options.bytes !== Array) + object.startActionId = $util.newBuffer(object.startActionId); + } + object.startActionIdIncluded = false; + } + if (message.startActionId != null && message.hasOwnProperty("startActionId")) + object.startActionId = options.bytes === String ? $util.base64.encode(message.startActionId, 0, message.startActionId.length) : options.bytes === Array ? Array.prototype.slice.call(message.startActionId) : message.startActionId; + if (message.startActionIdIncluded != null && message.hasOwnProperty("startActionIdIncluded")) + object.startActionIdIncluded = message.startActionIdIncluded; + return object; + }; + + /** + * Converts this StartAtActionId to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest.StartAtActionId + * @instance + * @returns {Object.} JSON object + */ + StartAtActionId.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return StartAtActionId; + })(); + + GetGroupActionsRequest.GetGroupActionsRequestV0 = (function() { + + /** + * Properties of a GetGroupActionsRequestV0. + * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest + * @interface IGetGroupActionsRequestV0 + * @property {Uint8Array|null} [contractId] GetGroupActionsRequestV0 contractId + * @property {number|null} [groupContractPosition] GetGroupActionsRequestV0 groupContractPosition + * @property {org.dash.platform.dapi.v0.GetGroupActionsRequest.ActionStatus|null} [status] GetGroupActionsRequestV0 status + * @property {org.dash.platform.dapi.v0.GetGroupActionsRequest.IStartAtActionId|null} [startAtActionId] GetGroupActionsRequestV0 startAtActionId + * @property {number|null} [count] GetGroupActionsRequestV0 count + * @property {boolean|null} [prove] GetGroupActionsRequestV0 prove + */ + + /** + * Constructs a new GetGroupActionsRequestV0. + * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest + * @classdesc Represents a GetGroupActionsRequestV0. + * @implements IGetGroupActionsRequestV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetGroupActionsRequest.IGetGroupActionsRequestV0=} [properties] Properties to set + */ + function GetGroupActionsRequestV0(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]]; + } + + /** + * GetGroupActionsRequestV0 contractId. + * @member {Uint8Array} contractId + * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0 + * @instance + */ + GetGroupActionsRequestV0.prototype.contractId = $util.newBuffer([]); + + /** + * GetGroupActionsRequestV0 groupContractPosition. + * @member {number} groupContractPosition + * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0 + * @instance + */ + GetGroupActionsRequestV0.prototype.groupContractPosition = 0; + + /** + * GetGroupActionsRequestV0 status. + * @member {org.dash.platform.dapi.v0.GetGroupActionsRequest.ActionStatus} status + * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0 + * @instance + */ + GetGroupActionsRequestV0.prototype.status = 0; + + /** + * GetGroupActionsRequestV0 startAtActionId. + * @member {org.dash.platform.dapi.v0.GetGroupActionsRequest.IStartAtActionId|null|undefined} startAtActionId + * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0 + * @instance + */ + GetGroupActionsRequestV0.prototype.startAtActionId = null; + + /** + * GetGroupActionsRequestV0 count. + * @member {number} count + * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0 + * @instance + */ + GetGroupActionsRequestV0.prototype.count = 0; + + /** + * GetGroupActionsRequestV0 prove. + * @member {boolean} prove + * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0 + * @instance + */ + GetGroupActionsRequestV0.prototype.prove = false; + + /** + * Creates a new GetGroupActionsRequestV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsRequest.IGetGroupActionsRequestV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0} GetGroupActionsRequestV0 instance + */ + GetGroupActionsRequestV0.create = function create(properties) { + return new GetGroupActionsRequestV0(properties); + }; + + /** + * Encodes the specified GetGroupActionsRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsRequest.IGetGroupActionsRequestV0} message GetGroupActionsRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGroupActionsRequestV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.contractId != null && Object.hasOwnProperty.call(message, "contractId")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.contractId); + if (message.groupContractPosition != null && Object.hasOwnProperty.call(message, "groupContractPosition")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.groupContractPosition); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.status); + if (message.startAtActionId != null && Object.hasOwnProperty.call(message, "startAtActionId")) + $root.org.dash.platform.dapi.v0.GetGroupActionsRequest.StartAtActionId.encode(message.startAtActionId, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.count != null && Object.hasOwnProperty.call(message, "count")) + writer.uint32(/* id 5, wireType 0 =*/40).uint32(message.count); + if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.prove); + return writer; + }; + + /** + * Encodes the specified GetGroupActionsRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsRequest.IGetGroupActionsRequestV0} message GetGroupActionsRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGroupActionsRequestV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetGroupActionsRequestV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0} GetGroupActionsRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGroupActionsRequestV0.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.org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.contractId = reader.bytes(); + break; + case 2: + message.groupContractPosition = reader.uint32(); + break; + case 3: + message.status = reader.int32(); + break; + case 4: + message.startAtActionId = $root.org.dash.platform.dapi.v0.GetGroupActionsRequest.StartAtActionId.decode(reader, reader.uint32()); + break; + case 5: + message.count = reader.uint32(); + break; + case 6: + message.prove = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetGroupActionsRequestV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0} GetGroupActionsRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGroupActionsRequestV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetGroupActionsRequestV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetGroupActionsRequestV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.contractId != null && message.hasOwnProperty("contractId")) + if (!(message.contractId && typeof message.contractId.length === "number" || $util.isString(message.contractId))) + return "contractId: buffer expected"; + if (message.groupContractPosition != null && message.hasOwnProperty("groupContractPosition")) + if (!$util.isInteger(message.groupContractPosition)) + return "groupContractPosition: integer expected"; + if (message.status != null && message.hasOwnProperty("status")) + switch (message.status) { + default: + return "status: enum value expected"; + case 0: + case 1: + break; + } + if (message.startAtActionId != null && message.hasOwnProperty("startAtActionId")) { + var error = $root.org.dash.platform.dapi.v0.GetGroupActionsRequest.StartAtActionId.verify(message.startAtActionId); + if (error) + return "startAtActionId." + error; + } + if (message.count != null && message.hasOwnProperty("count")) + if (!$util.isInteger(message.count)) + return "count: integer expected"; + if (message.prove != null && message.hasOwnProperty("prove")) + if (typeof message.prove !== "boolean") + return "prove: boolean expected"; + return null; + }; + + /** + * Creates a GetGroupActionsRequestV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0} GetGroupActionsRequestV0 + */ + GetGroupActionsRequestV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0(); + if (object.contractId != null) + if (typeof object.contractId === "string") + $util.base64.decode(object.contractId, message.contractId = $util.newBuffer($util.base64.length(object.contractId)), 0); + else if (object.contractId.length >= 0) + message.contractId = object.contractId; + if (object.groupContractPosition != null) + message.groupContractPosition = object.groupContractPosition >>> 0; + switch (object.status) { + case "ACTIVE": + case 0: + message.status = 0; + break; + case "CLOSED": + case 1: + message.status = 1; + break; + } + if (object.startAtActionId != null) { + if (typeof object.startAtActionId !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0.startAtActionId: object expected"); + message.startAtActionId = $root.org.dash.platform.dapi.v0.GetGroupActionsRequest.StartAtActionId.fromObject(object.startAtActionId); + } + if (object.count != null) + message.count = object.count >>> 0; + if (object.prove != null) + message.prove = Boolean(object.prove); + return message; + }; + + /** + * Creates a plain object from a GetGroupActionsRequestV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0} message GetGroupActionsRequestV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetGroupActionsRequestV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.contractId = ""; + else { + object.contractId = []; + if (options.bytes !== Array) + object.contractId = $util.newBuffer(object.contractId); + } + object.groupContractPosition = 0; + object.status = options.enums === String ? "ACTIVE" : 0; + object.startAtActionId = null; + object.count = 0; + object.prove = false; + } + if (message.contractId != null && message.hasOwnProperty("contractId")) + object.contractId = options.bytes === String ? $util.base64.encode(message.contractId, 0, message.contractId.length) : options.bytes === Array ? Array.prototype.slice.call(message.contractId) : message.contractId; + if (message.groupContractPosition != null && message.hasOwnProperty("groupContractPosition")) + object.groupContractPosition = message.groupContractPosition; + if (message.status != null && message.hasOwnProperty("status")) + object.status = options.enums === String ? $root.org.dash.platform.dapi.v0.GetGroupActionsRequest.ActionStatus[message.status] : message.status; + if (message.startAtActionId != null && message.hasOwnProperty("startAtActionId")) + object.startAtActionId = $root.org.dash.platform.dapi.v0.GetGroupActionsRequest.StartAtActionId.toObject(message.startAtActionId, options); + if (message.count != null && message.hasOwnProperty("count")) + object.count = message.count; + if (message.prove != null && message.hasOwnProperty("prove")) + object.prove = message.prove; + return object; + }; + + /** + * Converts this GetGroupActionsRequestV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0 + * @instance + * @returns {Object.} JSON object + */ + GetGroupActionsRequestV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetGroupActionsRequestV0; + })(); + + return GetGroupActionsRequest; + })(); + + v0.GetGroupActionsResponse = (function() { + + /** + * Properties of a GetGroupActionsResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetGroupActionsResponse + * @property {org.dash.platform.dapi.v0.GetGroupActionsResponse.IGetGroupActionsResponseV0|null} [v0] GetGroupActionsResponse v0 + */ + + /** + * Constructs a new GetGroupActionsResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetGroupActionsResponse. + * @implements IGetGroupActionsResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IGetGroupActionsResponse=} [properties] Properties to set + */ + function GetGroupActionsResponse(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]]; + } + + /** + * GetGroupActionsResponse v0. + * @member {org.dash.platform.dapi.v0.GetGroupActionsResponse.IGetGroupActionsResponseV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse + * @instance + */ + GetGroupActionsResponse.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetGroupActionsResponse version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse + * @instance + */ + Object.defineProperty(GetGroupActionsResponse.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetGroupActionsResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetGroupActionsResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse} GetGroupActionsResponse instance + */ + GetGroupActionsResponse.create = function create(properties) { + return new GetGroupActionsResponse(properties); + }; + + /** + * Encodes the specified GetGroupActionsResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetGroupActionsResponse} message GetGroupActionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGroupActionsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetGroupActionsResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetGroupActionsResponse} message GetGroupActionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGroupActionsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetGroupActionsResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse} GetGroupActionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGroupActionsResponse.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.org.dash.platform.dapi.v0.GetGroupActionsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetGroupActionsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse} GetGroupActionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGroupActionsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetGroupActionsResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetGroupActionsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetGroupActionsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse} GetGroupActionsResponse + */ + GetGroupActionsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionsResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionsResponse.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetGroupActionsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse} message GetGroupActionsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetGroupActionsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetGroupActionsResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse + * @instance + * @returns {Object.} JSON object + */ + GetGroupActionsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetGroupActionsResponse.GetGroupActionsResponseV0 = (function() { + + /** + * Properties of a GetGroupActionsResponseV0. + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse + * @interface IGetGroupActionsResponseV0 + * @property {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IGroupActions|null} [groupActions] GetGroupActionsResponseV0 groupActions + * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetGroupActionsResponseV0 proof + * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetGroupActionsResponseV0 metadata + */ + + /** + * Constructs a new GetGroupActionsResponseV0. + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse + * @classdesc Represents a GetGroupActionsResponseV0. + * @implements IGetGroupActionsResponseV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.IGetGroupActionsResponseV0=} [properties] Properties to set + */ + function GetGroupActionsResponseV0(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]]; + } + + /** + * GetGroupActionsResponseV0 groupActions. + * @member {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IGroupActions|null|undefined} groupActions + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @instance + */ + GetGroupActionsResponseV0.prototype.groupActions = null; + + /** + * GetGroupActionsResponseV0 proof. + * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @instance + */ + GetGroupActionsResponseV0.prototype.proof = null; + + /** + * GetGroupActionsResponseV0 metadata. + * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @instance + */ + GetGroupActionsResponseV0.prototype.metadata = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetGroupActionsResponseV0 result. + * @member {"groupActions"|"proof"|undefined} result + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @instance + */ + Object.defineProperty(GetGroupActionsResponseV0.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["groupActions", "proof"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetGroupActionsResponseV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.IGetGroupActionsResponseV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0} GetGroupActionsResponseV0 instance + */ + GetGroupActionsResponseV0.create = function create(properties) { + return new GetGroupActionsResponseV0(properties); + }; + + /** + * Encodes the specified GetGroupActionsResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.IGetGroupActionsResponseV0} message GetGroupActionsResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGroupActionsResponseV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.groupActions != null && Object.hasOwnProperty.call(message, "groupActions")) + $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActions.encode(message.groupActions, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetGroupActionsResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.IGetGroupActionsResponseV0} message GetGroupActionsResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGroupActionsResponseV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetGroupActionsResponseV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0} GetGroupActionsResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGroupActionsResponseV0.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.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.groupActions = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActions.decode(reader, reader.uint32()); + break; + case 2: + message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); + break; + case 3: + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetGroupActionsResponseV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0} GetGroupActionsResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGroupActionsResponseV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetGroupActionsResponseV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetGroupActionsResponseV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.groupActions != null && message.hasOwnProperty("groupActions")) { + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActions.verify(message.groupActions); + if (error) + return "groupActions." + error; + } + } + if (message.proof != null && message.hasOwnProperty("proof")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); + if (error) + return "proof." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a GetGroupActionsResponseV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0} GetGroupActionsResponseV0 + */ + GetGroupActionsResponseV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0(); + if (object.groupActions != null) { + if (typeof object.groupActions !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.groupActions: object expected"); + message.groupActions = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActions.fromObject(object.groupActions); + } + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.proof: object expected"); + message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.metadata: object expected"); + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a GetGroupActionsResponseV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0} message GetGroupActionsResponseV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetGroupActionsResponseV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.metadata = null; + if (message.groupActions != null && message.hasOwnProperty("groupActions")) { + object.groupActions = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActions.toObject(message.groupActions, options); + if (options.oneofs) + object.result = "groupActions"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); + if (options.oneofs) + object.result = "proof"; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this GetGroupActionsResponseV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @instance + * @returns {Object.} JSON object + */ + GetGroupActionsResponseV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetGroupActionsResponseV0.MintEvent = (function() { + + /** + * Properties of a MintEvent. + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @interface IMintEvent + * @property {number|Long|null} [amount] MintEvent amount + * @property {Uint8Array|null} [recipientId] MintEvent recipientId + * @property {string|null} [publicNote] MintEvent publicNote + */ + + /** + * Constructs a new MintEvent. + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @classdesc Represents a MintEvent. + * @implements IMintEvent + * @constructor + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IMintEvent=} [properties] Properties to set + */ + function MintEvent(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]]; + } + + /** + * MintEvent amount. + * @member {number|Long} amount + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEvent + * @instance + */ + MintEvent.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * MintEvent recipientId. + * @member {Uint8Array} recipientId + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEvent + * @instance + */ + MintEvent.prototype.recipientId = $util.newBuffer([]); + + /** + * MintEvent publicNote. + * @member {string} publicNote + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEvent + * @instance + */ + MintEvent.prototype.publicNote = ""; + + /** + * Creates a new MintEvent instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IMintEvent=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEvent} MintEvent instance + */ + MintEvent.create = function create(properties) { + return new MintEvent(properties); + }; + + /** + * Encodes the specified MintEvent message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEvent.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IMintEvent} message MintEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MintEvent.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.recipientId != null && Object.hasOwnProperty.call(message, "recipientId")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.recipientId); + if (message.publicNote != null && Object.hasOwnProperty.call(message, "publicNote")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.publicNote); + return writer; + }; + + /** + * Encodes the specified MintEvent message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEvent.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IMintEvent} message MintEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MintEvent.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MintEvent message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEvent} MintEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MintEvent.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.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEvent(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.amount = reader.uint64(); + break; + case 2: + message.recipientId = reader.bytes(); + break; + case 3: + message.publicNote = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MintEvent message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEvent} MintEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MintEvent.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MintEvent message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEvent + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MintEvent.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.recipientId != null && message.hasOwnProperty("recipientId")) + if (!(message.recipientId && typeof message.recipientId.length === "number" || $util.isString(message.recipientId))) + return "recipientId: buffer expected"; + if (message.publicNote != null && message.hasOwnProperty("publicNote")) + if (!$util.isString(message.publicNote)) + return "publicNote: string expected"; + return null; + }; + + /** + * Creates a MintEvent message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEvent + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEvent} MintEvent + */ + MintEvent.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEvent) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEvent(); + 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.recipientId != null) + if (typeof object.recipientId === "string") + $util.base64.decode(object.recipientId, message.recipientId = $util.newBuffer($util.base64.length(object.recipientId)), 0); + else if (object.recipientId.length >= 0) + message.recipientId = object.recipientId; + if (object.publicNote != null) + message.publicNote = String(object.publicNote); + return message; + }; + + /** + * Creates a plain object from a MintEvent message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEvent} message MintEvent + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MintEvent.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; + if (options.bytes === String) + object.recipientId = ""; + else { + object.recipientId = []; + if (options.bytes !== Array) + object.recipientId = $util.newBuffer(object.recipientId); + } + object.publicNote = ""; + } + 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.recipientId != null && message.hasOwnProperty("recipientId")) + object.recipientId = options.bytes === String ? $util.base64.encode(message.recipientId, 0, message.recipientId.length) : options.bytes === Array ? Array.prototype.slice.call(message.recipientId) : message.recipientId; + if (message.publicNote != null && message.hasOwnProperty("publicNote")) + object.publicNote = message.publicNote; + return object; + }; + + /** + * Converts this MintEvent to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEvent + * @instance + * @returns {Object.} JSON object + */ + MintEvent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MintEvent; + })(); + + GetGroupActionsResponseV0.BurnEvent = (function() { + + /** + * Properties of a BurnEvent. + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @interface IBurnEvent + * @property {number|Long|null} [amount] BurnEvent amount + * @property {string|null} [publicNote] BurnEvent publicNote + */ + + /** + * Constructs a new BurnEvent. + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @classdesc Represents a BurnEvent. + * @implements IBurnEvent + * @constructor + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IBurnEvent=} [properties] Properties to set + */ + function BurnEvent(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]]; + } + + /** + * BurnEvent amount. + * @member {number|Long} amount + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnEvent + * @instance + */ + BurnEvent.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * BurnEvent publicNote. + * @member {string} publicNote + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnEvent + * @instance + */ + BurnEvent.prototype.publicNote = ""; + + /** + * Creates a new BurnEvent instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IBurnEvent=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnEvent} BurnEvent instance + */ + BurnEvent.create = function create(properties) { + return new BurnEvent(properties); + }; + + /** + * Encodes the specified BurnEvent message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnEvent.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IBurnEvent} message BurnEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BurnEvent.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.publicNote != null && Object.hasOwnProperty.call(message, "publicNote")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.publicNote); + return writer; + }; + + /** + * Encodes the specified BurnEvent message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnEvent.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IBurnEvent} message BurnEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BurnEvent.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BurnEvent message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnEvent} BurnEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BurnEvent.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.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnEvent(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.amount = reader.uint64(); + break; + case 2: + message.publicNote = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BurnEvent message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnEvent} BurnEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BurnEvent.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BurnEvent message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnEvent + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BurnEvent.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.publicNote != null && message.hasOwnProperty("publicNote")) + if (!$util.isString(message.publicNote)) + return "publicNote: string expected"; + return null; + }; + + /** + * Creates a BurnEvent message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnEvent + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnEvent} BurnEvent + */ + BurnEvent.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnEvent) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnEvent(); + 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.publicNote != null) + message.publicNote = String(object.publicNote); + return message; + }; + + /** + * Creates a plain object from a BurnEvent message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnEvent} message BurnEvent + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BurnEvent.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.publicNote = ""; + } + 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.publicNote != null && message.hasOwnProperty("publicNote")) + object.publicNote = message.publicNote; + return object; + }; + + /** + * Converts this BurnEvent to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnEvent + * @instance + * @returns {Object.} JSON object + */ + BurnEvent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return BurnEvent; + })(); + + GetGroupActionsResponseV0.FreezeEvent = (function() { + + /** + * Properties of a FreezeEvent. + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @interface IFreezeEvent + * @property {Uint8Array|null} [frozenId] FreezeEvent frozenId + * @property {string|null} [publicNote] FreezeEvent publicNote + */ + + /** + * Constructs a new FreezeEvent. + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @classdesc Represents a FreezeEvent. + * @implements IFreezeEvent + * @constructor + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IFreezeEvent=} [properties] Properties to set + */ + function FreezeEvent(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]]; + } + + /** + * FreezeEvent frozenId. + * @member {Uint8Array} frozenId + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.FreezeEvent + * @instance + */ + FreezeEvent.prototype.frozenId = $util.newBuffer([]); + + /** + * FreezeEvent publicNote. + * @member {string} publicNote + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.FreezeEvent + * @instance + */ + FreezeEvent.prototype.publicNote = ""; + + /** + * Creates a new FreezeEvent instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.FreezeEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IFreezeEvent=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.FreezeEvent} FreezeEvent instance + */ + FreezeEvent.create = function create(properties) { + return new FreezeEvent(properties); + }; + + /** + * Encodes the specified FreezeEvent message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.FreezeEvent.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.FreezeEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IFreezeEvent} message FreezeEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FreezeEvent.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.frozenId != null && Object.hasOwnProperty.call(message, "frozenId")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.frozenId); + if (message.publicNote != null && Object.hasOwnProperty.call(message, "publicNote")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.publicNote); + return writer; + }; + + /** + * Encodes the specified FreezeEvent message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.FreezeEvent.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.FreezeEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IFreezeEvent} message FreezeEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FreezeEvent.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FreezeEvent message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.FreezeEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.FreezeEvent} FreezeEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FreezeEvent.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.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.FreezeEvent(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.frozenId = reader.bytes(); + break; + case 2: + message.publicNote = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FreezeEvent message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.FreezeEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.FreezeEvent} FreezeEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FreezeEvent.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FreezeEvent message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.FreezeEvent + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FreezeEvent.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.frozenId != null && message.hasOwnProperty("frozenId")) + if (!(message.frozenId && typeof message.frozenId.length === "number" || $util.isString(message.frozenId))) + return "frozenId: buffer expected"; + if (message.publicNote != null && message.hasOwnProperty("publicNote")) + if (!$util.isString(message.publicNote)) + return "publicNote: string expected"; + return null; + }; + + /** + * Creates a FreezeEvent message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.FreezeEvent + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.FreezeEvent} FreezeEvent + */ + FreezeEvent.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.FreezeEvent) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.FreezeEvent(); + if (object.frozenId != null) + if (typeof object.frozenId === "string") + $util.base64.decode(object.frozenId, message.frozenId = $util.newBuffer($util.base64.length(object.frozenId)), 0); + else if (object.frozenId.length >= 0) + message.frozenId = object.frozenId; + if (object.publicNote != null) + message.publicNote = String(object.publicNote); + return message; + }; + + /** + * Creates a plain object from a FreezeEvent message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.FreezeEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.FreezeEvent} message FreezeEvent + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FreezeEvent.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.frozenId = ""; + else { + object.frozenId = []; + if (options.bytes !== Array) + object.frozenId = $util.newBuffer(object.frozenId); + } + object.publicNote = ""; + } + if (message.frozenId != null && message.hasOwnProperty("frozenId")) + object.frozenId = options.bytes === String ? $util.base64.encode(message.frozenId, 0, message.frozenId.length) : options.bytes === Array ? Array.prototype.slice.call(message.frozenId) : message.frozenId; + if (message.publicNote != null && message.hasOwnProperty("publicNote")) + object.publicNote = message.publicNote; + return object; + }; + + /** + * Converts this FreezeEvent to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.FreezeEvent + * @instance + * @returns {Object.} JSON object + */ + FreezeEvent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return FreezeEvent; + })(); + + GetGroupActionsResponseV0.UnfreezeEvent = (function() { + + /** + * Properties of an UnfreezeEvent. + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @interface IUnfreezeEvent + * @property {Uint8Array|null} [frozenId] UnfreezeEvent frozenId + * @property {string|null} [publicNote] UnfreezeEvent publicNote + */ + + /** + * Constructs a new UnfreezeEvent. + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @classdesc Represents an UnfreezeEvent. + * @implements IUnfreezeEvent + * @constructor + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IUnfreezeEvent=} [properties] Properties to set + */ + function UnfreezeEvent(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]]; + } + + /** + * UnfreezeEvent frozenId. + * @member {Uint8Array} frozenId + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEvent + * @instance + */ + UnfreezeEvent.prototype.frozenId = $util.newBuffer([]); + + /** + * UnfreezeEvent publicNote. + * @member {string} publicNote + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEvent + * @instance + */ + UnfreezeEvent.prototype.publicNote = ""; + + /** + * Creates a new UnfreezeEvent instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IUnfreezeEvent=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEvent} UnfreezeEvent instance + */ + UnfreezeEvent.create = function create(properties) { + return new UnfreezeEvent(properties); + }; + + /** + * Encodes the specified UnfreezeEvent message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEvent.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IUnfreezeEvent} message UnfreezeEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UnfreezeEvent.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.frozenId != null && Object.hasOwnProperty.call(message, "frozenId")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.frozenId); + if (message.publicNote != null && Object.hasOwnProperty.call(message, "publicNote")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.publicNote); + return writer; + }; + + /** + * Encodes the specified UnfreezeEvent message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEvent.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IUnfreezeEvent} message UnfreezeEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UnfreezeEvent.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UnfreezeEvent message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEvent} UnfreezeEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UnfreezeEvent.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.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEvent(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.frozenId = reader.bytes(); + break; + case 2: + message.publicNote = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UnfreezeEvent message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEvent} UnfreezeEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UnfreezeEvent.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UnfreezeEvent message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEvent + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UnfreezeEvent.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.frozenId != null && message.hasOwnProperty("frozenId")) + if (!(message.frozenId && typeof message.frozenId.length === "number" || $util.isString(message.frozenId))) + return "frozenId: buffer expected"; + if (message.publicNote != null && message.hasOwnProperty("publicNote")) + if (!$util.isString(message.publicNote)) + return "publicNote: string expected"; + return null; + }; + + /** + * Creates an UnfreezeEvent message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEvent + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEvent} UnfreezeEvent + */ + UnfreezeEvent.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEvent) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEvent(); + if (object.frozenId != null) + if (typeof object.frozenId === "string") + $util.base64.decode(object.frozenId, message.frozenId = $util.newBuffer($util.base64.length(object.frozenId)), 0); + else if (object.frozenId.length >= 0) + message.frozenId = object.frozenId; + if (object.publicNote != null) + message.publicNote = String(object.publicNote); + return message; + }; + + /** + * Creates a plain object from an UnfreezeEvent message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEvent} message UnfreezeEvent + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UnfreezeEvent.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.frozenId = ""; + else { + object.frozenId = []; + if (options.bytes !== Array) + object.frozenId = $util.newBuffer(object.frozenId); + } + object.publicNote = ""; + } + if (message.frozenId != null && message.hasOwnProperty("frozenId")) + object.frozenId = options.bytes === String ? $util.base64.encode(message.frozenId, 0, message.frozenId.length) : options.bytes === Array ? Array.prototype.slice.call(message.frozenId) : message.frozenId; + if (message.publicNote != null && message.hasOwnProperty("publicNote")) + object.publicNote = message.publicNote; + return object; + }; + + /** + * Converts this UnfreezeEvent to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEvent + * @instance + * @returns {Object.} JSON object + */ + UnfreezeEvent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UnfreezeEvent; + })(); + + GetGroupActionsResponseV0.DestroyFrozenFundsEvent = (function() { + + /** + * Properties of a DestroyFrozenFundsEvent. + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @interface IDestroyFrozenFundsEvent + * @property {Uint8Array|null} [frozenId] DestroyFrozenFundsEvent frozenId + * @property {number|Long|null} [amount] DestroyFrozenFundsEvent amount + * @property {string|null} [publicNote] DestroyFrozenFundsEvent publicNote + */ + + /** + * Constructs a new DestroyFrozenFundsEvent. + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @classdesc Represents a DestroyFrozenFundsEvent. + * @implements IDestroyFrozenFundsEvent + * @constructor + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IDestroyFrozenFundsEvent=} [properties] Properties to set + */ + function DestroyFrozenFundsEvent(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]]; + } + + /** + * DestroyFrozenFundsEvent frozenId. + * @member {Uint8Array} frozenId + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent + * @instance + */ + DestroyFrozenFundsEvent.prototype.frozenId = $util.newBuffer([]); + + /** + * DestroyFrozenFundsEvent amount. + * @member {number|Long} amount + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent + * @instance + */ + DestroyFrozenFundsEvent.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * DestroyFrozenFundsEvent publicNote. + * @member {string} publicNote + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent + * @instance + */ + DestroyFrozenFundsEvent.prototype.publicNote = ""; + + /** + * Creates a new DestroyFrozenFundsEvent instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IDestroyFrozenFundsEvent=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent} DestroyFrozenFundsEvent instance + */ + DestroyFrozenFundsEvent.create = function create(properties) { + return new DestroyFrozenFundsEvent(properties); + }; + + /** + * Encodes the specified DestroyFrozenFundsEvent message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IDestroyFrozenFundsEvent} message DestroyFrozenFundsEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DestroyFrozenFundsEvent.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.frozenId != null && Object.hasOwnProperty.call(message, "frozenId")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.frozenId); + if (message.amount != null && Object.hasOwnProperty.call(message, "amount")) + writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.amount); + if (message.publicNote != null && Object.hasOwnProperty.call(message, "publicNote")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.publicNote); + return writer; + }; + + /** + * Encodes the specified DestroyFrozenFundsEvent message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IDestroyFrozenFundsEvent} message DestroyFrozenFundsEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DestroyFrozenFundsEvent.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DestroyFrozenFundsEvent message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent} DestroyFrozenFundsEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DestroyFrozenFundsEvent.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.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.frozenId = reader.bytes(); + break; + case 2: + message.amount = reader.uint64(); + break; + case 3: + message.publicNote = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DestroyFrozenFundsEvent message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent} DestroyFrozenFundsEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DestroyFrozenFundsEvent.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DestroyFrozenFundsEvent message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DestroyFrozenFundsEvent.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.frozenId != null && message.hasOwnProperty("frozenId")) + if (!(message.frozenId && typeof message.frozenId.length === "number" || $util.isString(message.frozenId))) + return "frozenId: buffer 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.publicNote != null && message.hasOwnProperty("publicNote")) + if (!$util.isString(message.publicNote)) + return "publicNote: string expected"; + return null; + }; + + /** + * Creates a DestroyFrozenFundsEvent message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent} DestroyFrozenFundsEvent + */ + DestroyFrozenFundsEvent.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent(); + if (object.frozenId != null) + if (typeof object.frozenId === "string") + $util.base64.decode(object.frozenId, message.frozenId = $util.newBuffer($util.base64.length(object.frozenId)), 0); + else if (object.frozenId.length >= 0) + message.frozenId = object.frozenId; + 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.publicNote != null) + message.publicNote = String(object.publicNote); + return message; + }; + + /** + * Creates a plain object from a DestroyFrozenFundsEvent message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent} message DestroyFrozenFundsEvent + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DestroyFrozenFundsEvent.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.frozenId = ""; + else { + object.frozenId = []; + if (options.bytes !== Array) + object.frozenId = $util.newBuffer(object.frozenId); + } + 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.publicNote = ""; + } + if (message.frozenId != null && message.hasOwnProperty("frozenId")) + object.frozenId = options.bytes === String ? $util.base64.encode(message.frozenId, 0, message.frozenId.length) : options.bytes === Array ? Array.prototype.slice.call(message.frozenId) : message.frozenId; + 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.publicNote != null && message.hasOwnProperty("publicNote")) + object.publicNote = message.publicNote; + return object; + }; + + /** + * Converts this DestroyFrozenFundsEvent to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent + * @instance + * @returns {Object.} JSON object + */ + DestroyFrozenFundsEvent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DestroyFrozenFundsEvent; + })(); + + GetGroupActionsResponseV0.SharedEncryptedNote = (function() { + + /** + * Properties of a SharedEncryptedNote. + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @interface ISharedEncryptedNote + * @property {number|null} [senderKeyIndex] SharedEncryptedNote senderKeyIndex + * @property {number|null} [recipientKeyIndex] SharedEncryptedNote recipientKeyIndex + * @property {Uint8Array|null} [encryptedData] SharedEncryptedNote encryptedData + */ + + /** + * Constructs a new SharedEncryptedNote. + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @classdesc Represents a SharedEncryptedNote. + * @implements ISharedEncryptedNote + * @constructor + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ISharedEncryptedNote=} [properties] Properties to set + */ + function SharedEncryptedNote(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]]; + } + + /** + * SharedEncryptedNote senderKeyIndex. + * @member {number} senderKeyIndex + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.SharedEncryptedNote + * @instance + */ + SharedEncryptedNote.prototype.senderKeyIndex = 0; + + /** + * SharedEncryptedNote recipientKeyIndex. + * @member {number} recipientKeyIndex + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.SharedEncryptedNote + * @instance + */ + SharedEncryptedNote.prototype.recipientKeyIndex = 0; + + /** + * SharedEncryptedNote encryptedData. + * @member {Uint8Array} encryptedData + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.SharedEncryptedNote + * @instance + */ + SharedEncryptedNote.prototype.encryptedData = $util.newBuffer([]); + + /** + * Creates a new SharedEncryptedNote instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.SharedEncryptedNote + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ISharedEncryptedNote=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.SharedEncryptedNote} SharedEncryptedNote instance + */ + SharedEncryptedNote.create = function create(properties) { + return new SharedEncryptedNote(properties); + }; + + /** + * Encodes the specified SharedEncryptedNote message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.SharedEncryptedNote.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.SharedEncryptedNote + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ISharedEncryptedNote} message SharedEncryptedNote message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SharedEncryptedNote.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.senderKeyIndex != null && Object.hasOwnProperty.call(message, "senderKeyIndex")) + writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.senderKeyIndex); + if (message.recipientKeyIndex != null && Object.hasOwnProperty.call(message, "recipientKeyIndex")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.recipientKeyIndex); + if (message.encryptedData != null && Object.hasOwnProperty.call(message, "encryptedData")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.encryptedData); + return writer; + }; + + /** + * Encodes the specified SharedEncryptedNote message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.SharedEncryptedNote.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.SharedEncryptedNote + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ISharedEncryptedNote} message SharedEncryptedNote message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SharedEncryptedNote.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SharedEncryptedNote message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.SharedEncryptedNote + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.SharedEncryptedNote} SharedEncryptedNote + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SharedEncryptedNote.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.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.SharedEncryptedNote(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.senderKeyIndex = reader.uint32(); + break; + case 2: + message.recipientKeyIndex = reader.uint32(); + break; + case 3: + message.encryptedData = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SharedEncryptedNote message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.SharedEncryptedNote + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.SharedEncryptedNote} SharedEncryptedNote + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SharedEncryptedNote.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SharedEncryptedNote message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.SharedEncryptedNote + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SharedEncryptedNote.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.senderKeyIndex != null && message.hasOwnProperty("senderKeyIndex")) + if (!$util.isInteger(message.senderKeyIndex)) + return "senderKeyIndex: integer expected"; + if (message.recipientKeyIndex != null && message.hasOwnProperty("recipientKeyIndex")) + if (!$util.isInteger(message.recipientKeyIndex)) + return "recipientKeyIndex: integer expected"; + if (message.encryptedData != null && message.hasOwnProperty("encryptedData")) + if (!(message.encryptedData && typeof message.encryptedData.length === "number" || $util.isString(message.encryptedData))) + return "encryptedData: buffer expected"; + return null; + }; + + /** + * Creates a SharedEncryptedNote message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.SharedEncryptedNote + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.SharedEncryptedNote} SharedEncryptedNote + */ + SharedEncryptedNote.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.SharedEncryptedNote) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.SharedEncryptedNote(); + if (object.senderKeyIndex != null) + message.senderKeyIndex = object.senderKeyIndex >>> 0; + if (object.recipientKeyIndex != null) + message.recipientKeyIndex = object.recipientKeyIndex >>> 0; + if (object.encryptedData != null) + if (typeof object.encryptedData === "string") + $util.base64.decode(object.encryptedData, message.encryptedData = $util.newBuffer($util.base64.length(object.encryptedData)), 0); + else if (object.encryptedData.length >= 0) + message.encryptedData = object.encryptedData; + return message; + }; + + /** + * Creates a plain object from a SharedEncryptedNote message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.SharedEncryptedNote + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.SharedEncryptedNote} message SharedEncryptedNote + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SharedEncryptedNote.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.senderKeyIndex = 0; + object.recipientKeyIndex = 0; + if (options.bytes === String) + object.encryptedData = ""; + else { + object.encryptedData = []; + if (options.bytes !== Array) + object.encryptedData = $util.newBuffer(object.encryptedData); + } + } + if (message.senderKeyIndex != null && message.hasOwnProperty("senderKeyIndex")) + object.senderKeyIndex = message.senderKeyIndex; + if (message.recipientKeyIndex != null && message.hasOwnProperty("recipientKeyIndex")) + object.recipientKeyIndex = message.recipientKeyIndex; + if (message.encryptedData != null && message.hasOwnProperty("encryptedData")) + object.encryptedData = options.bytes === String ? $util.base64.encode(message.encryptedData, 0, message.encryptedData.length) : options.bytes === Array ? Array.prototype.slice.call(message.encryptedData) : message.encryptedData; + return object; + }; + + /** + * Converts this SharedEncryptedNote to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.SharedEncryptedNote + * @instance + * @returns {Object.} JSON object + */ + SharedEncryptedNote.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SharedEncryptedNote; + })(); + + GetGroupActionsResponseV0.PersonalEncryptedNote = (function() { + + /** + * Properties of a PersonalEncryptedNote. + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @interface IPersonalEncryptedNote + * @property {number|null} [rootEncryptionKeyIndex] PersonalEncryptedNote rootEncryptionKeyIndex + * @property {number|null} [derivationEncryptionKeyIndex] PersonalEncryptedNote derivationEncryptionKeyIndex + * @property {Uint8Array|null} [encryptedData] PersonalEncryptedNote encryptedData + */ + + /** + * Constructs a new PersonalEncryptedNote. + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @classdesc Represents a PersonalEncryptedNote. + * @implements IPersonalEncryptedNote + * @constructor + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IPersonalEncryptedNote=} [properties] Properties to set + */ + function PersonalEncryptedNote(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]]; + } + + /** + * PersonalEncryptedNote rootEncryptionKeyIndex. + * @member {number} rootEncryptionKeyIndex + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.PersonalEncryptedNote + * @instance + */ + PersonalEncryptedNote.prototype.rootEncryptionKeyIndex = 0; + + /** + * PersonalEncryptedNote derivationEncryptionKeyIndex. + * @member {number} derivationEncryptionKeyIndex + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.PersonalEncryptedNote + * @instance + */ + PersonalEncryptedNote.prototype.derivationEncryptionKeyIndex = 0; + + /** + * PersonalEncryptedNote encryptedData. + * @member {Uint8Array} encryptedData + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.PersonalEncryptedNote + * @instance + */ + PersonalEncryptedNote.prototype.encryptedData = $util.newBuffer([]); + + /** + * Creates a new PersonalEncryptedNote instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.PersonalEncryptedNote + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IPersonalEncryptedNote=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.PersonalEncryptedNote} PersonalEncryptedNote instance + */ + PersonalEncryptedNote.create = function create(properties) { + return new PersonalEncryptedNote(properties); + }; + + /** + * Encodes the specified PersonalEncryptedNote message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.PersonalEncryptedNote.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.PersonalEncryptedNote + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IPersonalEncryptedNote} message PersonalEncryptedNote message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PersonalEncryptedNote.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rootEncryptionKeyIndex != null && Object.hasOwnProperty.call(message, "rootEncryptionKeyIndex")) + writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.rootEncryptionKeyIndex); + if (message.derivationEncryptionKeyIndex != null && Object.hasOwnProperty.call(message, "derivationEncryptionKeyIndex")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.derivationEncryptionKeyIndex); + if (message.encryptedData != null && Object.hasOwnProperty.call(message, "encryptedData")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.encryptedData); + return writer; + }; + + /** + * Encodes the specified PersonalEncryptedNote message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.PersonalEncryptedNote.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.PersonalEncryptedNote + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IPersonalEncryptedNote} message PersonalEncryptedNote message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PersonalEncryptedNote.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PersonalEncryptedNote message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.PersonalEncryptedNote + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.PersonalEncryptedNote} PersonalEncryptedNote + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PersonalEncryptedNote.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.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.PersonalEncryptedNote(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.rootEncryptionKeyIndex = reader.uint32(); + break; + case 2: + message.derivationEncryptionKeyIndex = reader.uint32(); + break; + case 3: + message.encryptedData = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PersonalEncryptedNote message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.PersonalEncryptedNote + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.PersonalEncryptedNote} PersonalEncryptedNote + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PersonalEncryptedNote.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PersonalEncryptedNote message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.PersonalEncryptedNote + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PersonalEncryptedNote.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.rootEncryptionKeyIndex != null && message.hasOwnProperty("rootEncryptionKeyIndex")) + if (!$util.isInteger(message.rootEncryptionKeyIndex)) + return "rootEncryptionKeyIndex: integer expected"; + if (message.derivationEncryptionKeyIndex != null && message.hasOwnProperty("derivationEncryptionKeyIndex")) + if (!$util.isInteger(message.derivationEncryptionKeyIndex)) + return "derivationEncryptionKeyIndex: integer expected"; + if (message.encryptedData != null && message.hasOwnProperty("encryptedData")) + if (!(message.encryptedData && typeof message.encryptedData.length === "number" || $util.isString(message.encryptedData))) + return "encryptedData: buffer expected"; + return null; + }; + + /** + * Creates a PersonalEncryptedNote message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.PersonalEncryptedNote + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.PersonalEncryptedNote} PersonalEncryptedNote + */ + PersonalEncryptedNote.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.PersonalEncryptedNote) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.PersonalEncryptedNote(); + if (object.rootEncryptionKeyIndex != null) + message.rootEncryptionKeyIndex = object.rootEncryptionKeyIndex >>> 0; + if (object.derivationEncryptionKeyIndex != null) + message.derivationEncryptionKeyIndex = object.derivationEncryptionKeyIndex >>> 0; + if (object.encryptedData != null) + if (typeof object.encryptedData === "string") + $util.base64.decode(object.encryptedData, message.encryptedData = $util.newBuffer($util.base64.length(object.encryptedData)), 0); + else if (object.encryptedData.length >= 0) + message.encryptedData = object.encryptedData; + return message; + }; + + /** + * Creates a plain object from a PersonalEncryptedNote message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.PersonalEncryptedNote + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.PersonalEncryptedNote} message PersonalEncryptedNote + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PersonalEncryptedNote.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.rootEncryptionKeyIndex = 0; + object.derivationEncryptionKeyIndex = 0; + if (options.bytes === String) + object.encryptedData = ""; + else { + object.encryptedData = []; + if (options.bytes !== Array) + object.encryptedData = $util.newBuffer(object.encryptedData); + } + } + if (message.rootEncryptionKeyIndex != null && message.hasOwnProperty("rootEncryptionKeyIndex")) + object.rootEncryptionKeyIndex = message.rootEncryptionKeyIndex; + if (message.derivationEncryptionKeyIndex != null && message.hasOwnProperty("derivationEncryptionKeyIndex")) + object.derivationEncryptionKeyIndex = message.derivationEncryptionKeyIndex; + if (message.encryptedData != null && message.hasOwnProperty("encryptedData")) + object.encryptedData = options.bytes === String ? $util.base64.encode(message.encryptedData, 0, message.encryptedData.length) : options.bytes === Array ? Array.prototype.slice.call(message.encryptedData) : message.encryptedData; + return object; + }; + + /** + * Converts this PersonalEncryptedNote to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.PersonalEncryptedNote + * @instance + * @returns {Object.} JSON object + */ + PersonalEncryptedNote.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PersonalEncryptedNote; + })(); + + GetGroupActionsResponseV0.EmergencyActionEvent = (function() { + + /** + * Properties of an EmergencyActionEvent. + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @interface IEmergencyActionEvent + * @property {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent.ActionType|null} [actionType] EmergencyActionEvent actionType + * @property {string|null} [publicNote] EmergencyActionEvent publicNote + */ + + /** + * Constructs a new EmergencyActionEvent. + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @classdesc Represents an EmergencyActionEvent. + * @implements IEmergencyActionEvent + * @constructor + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IEmergencyActionEvent=} [properties] Properties to set + */ + function EmergencyActionEvent(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]]; + } + + /** + * EmergencyActionEvent actionType. + * @member {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent.ActionType} actionType + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent + * @instance + */ + EmergencyActionEvent.prototype.actionType = 0; + + /** + * EmergencyActionEvent publicNote. + * @member {string} publicNote + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent + * @instance + */ + EmergencyActionEvent.prototype.publicNote = ""; + + /** + * Creates a new EmergencyActionEvent instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IEmergencyActionEvent=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent} EmergencyActionEvent instance + */ + EmergencyActionEvent.create = function create(properties) { + return new EmergencyActionEvent(properties); + }; + + /** + * Encodes the specified EmergencyActionEvent message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IEmergencyActionEvent} message EmergencyActionEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EmergencyActionEvent.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.actionType != null && Object.hasOwnProperty.call(message, "actionType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.actionType); + if (message.publicNote != null && Object.hasOwnProperty.call(message, "publicNote")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.publicNote); + return writer; + }; + + /** + * Encodes the specified EmergencyActionEvent message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IEmergencyActionEvent} message EmergencyActionEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EmergencyActionEvent.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EmergencyActionEvent message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent} EmergencyActionEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EmergencyActionEvent.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.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.actionType = reader.int32(); + break; + case 2: + message.publicNote = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EmergencyActionEvent message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent} EmergencyActionEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EmergencyActionEvent.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EmergencyActionEvent message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EmergencyActionEvent.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.actionType != null && message.hasOwnProperty("actionType")) + switch (message.actionType) { + default: + return "actionType: enum value expected"; + case 0: + case 1: + break; + } + if (message.publicNote != null && message.hasOwnProperty("publicNote")) + if (!$util.isString(message.publicNote)) + return "publicNote: string expected"; + return null; + }; + + /** + * Creates an EmergencyActionEvent message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent} EmergencyActionEvent + */ + EmergencyActionEvent.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent(); + switch (object.actionType) { + case "PAUSE": + case 0: + message.actionType = 0; + break; + case "RESUME": + case 1: + message.actionType = 1; + break; + } + if (object.publicNote != null) + message.publicNote = String(object.publicNote); + return message; + }; + + /** + * Creates a plain object from an EmergencyActionEvent message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent} message EmergencyActionEvent + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EmergencyActionEvent.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.actionType = options.enums === String ? "PAUSE" : 0; + object.publicNote = ""; + } + if (message.actionType != null && message.hasOwnProperty("actionType")) + object.actionType = options.enums === String ? $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent.ActionType[message.actionType] : message.actionType; + if (message.publicNote != null && message.hasOwnProperty("publicNote")) + object.publicNote = message.publicNote; + return object; + }; + + /** + * Converts this EmergencyActionEvent to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent + * @instance + * @returns {Object.} JSON object + */ + EmergencyActionEvent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * ActionType enum. + * @name org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent.ActionType + * @enum {number} + * @property {number} PAUSE=0 PAUSE value + * @property {number} RESUME=1 RESUME value + */ + EmergencyActionEvent.ActionType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PAUSE"] = 0; + values[valuesById[1] = "RESUME"] = 1; + return values; + })(); + + return EmergencyActionEvent; + })(); + + GetGroupActionsResponseV0.TokenConfigUpdateEvent = (function() { + + /** + * Properties of a TokenConfigUpdateEvent. + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @interface ITokenConfigUpdateEvent + * @property {Uint8Array|null} [tokenConfigUpdateItem] TokenConfigUpdateEvent tokenConfigUpdateItem + * @property {string|null} [publicNote] TokenConfigUpdateEvent publicNote + */ + + /** + * Constructs a new TokenConfigUpdateEvent. + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @classdesc Represents a TokenConfigUpdateEvent. + * @implements ITokenConfigUpdateEvent + * @constructor + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ITokenConfigUpdateEvent=} [properties] Properties to set + */ + function TokenConfigUpdateEvent(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]]; + } + + /** + * TokenConfigUpdateEvent tokenConfigUpdateItem. + * @member {Uint8Array} tokenConfigUpdateItem + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent + * @instance + */ + TokenConfigUpdateEvent.prototype.tokenConfigUpdateItem = $util.newBuffer([]); + + /** + * TokenConfigUpdateEvent publicNote. + * @member {string} publicNote + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent + * @instance + */ + TokenConfigUpdateEvent.prototype.publicNote = ""; + + /** + * Creates a new TokenConfigUpdateEvent instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ITokenConfigUpdateEvent=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent} TokenConfigUpdateEvent instance + */ + TokenConfigUpdateEvent.create = function create(properties) { + return new TokenConfigUpdateEvent(properties); + }; + + /** + * Encodes the specified TokenConfigUpdateEvent message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ITokenConfigUpdateEvent} message TokenConfigUpdateEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenConfigUpdateEvent.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tokenConfigUpdateItem != null && Object.hasOwnProperty.call(message, "tokenConfigUpdateItem")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.tokenConfigUpdateItem); + if (message.publicNote != null && Object.hasOwnProperty.call(message, "publicNote")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.publicNote); + return writer; + }; + + /** + * Encodes the specified TokenConfigUpdateEvent message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ITokenConfigUpdateEvent} message TokenConfigUpdateEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenConfigUpdateEvent.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TokenConfigUpdateEvent message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent} TokenConfigUpdateEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenConfigUpdateEvent.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.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tokenConfigUpdateItem = reader.bytes(); + break; + case 2: + message.publicNote = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TokenConfigUpdateEvent message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent} TokenConfigUpdateEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenConfigUpdateEvent.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TokenConfigUpdateEvent message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TokenConfigUpdateEvent.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tokenConfigUpdateItem != null && message.hasOwnProperty("tokenConfigUpdateItem")) + if (!(message.tokenConfigUpdateItem && typeof message.tokenConfigUpdateItem.length === "number" || $util.isString(message.tokenConfigUpdateItem))) + return "tokenConfigUpdateItem: buffer expected"; + if (message.publicNote != null && message.hasOwnProperty("publicNote")) + if (!$util.isString(message.publicNote)) + return "publicNote: string expected"; + return null; + }; + + /** + * Creates a TokenConfigUpdateEvent message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent} TokenConfigUpdateEvent + */ + TokenConfigUpdateEvent.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent(); + if (object.tokenConfigUpdateItem != null) + if (typeof object.tokenConfigUpdateItem === "string") + $util.base64.decode(object.tokenConfigUpdateItem, message.tokenConfigUpdateItem = $util.newBuffer($util.base64.length(object.tokenConfigUpdateItem)), 0); + else if (object.tokenConfigUpdateItem.length >= 0) + message.tokenConfigUpdateItem = object.tokenConfigUpdateItem; + if (object.publicNote != null) + message.publicNote = String(object.publicNote); + return message; + }; + + /** + * Creates a plain object from a TokenConfigUpdateEvent message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent} message TokenConfigUpdateEvent + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TokenConfigUpdateEvent.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.tokenConfigUpdateItem = ""; + else { + object.tokenConfigUpdateItem = []; + if (options.bytes !== Array) + object.tokenConfigUpdateItem = $util.newBuffer(object.tokenConfigUpdateItem); + } + object.publicNote = ""; + } + if (message.tokenConfigUpdateItem != null && message.hasOwnProperty("tokenConfigUpdateItem")) + object.tokenConfigUpdateItem = options.bytes === String ? $util.base64.encode(message.tokenConfigUpdateItem, 0, message.tokenConfigUpdateItem.length) : options.bytes === Array ? Array.prototype.slice.call(message.tokenConfigUpdateItem) : message.tokenConfigUpdateItem; + if (message.publicNote != null && message.hasOwnProperty("publicNote")) + object.publicNote = message.publicNote; + return object; + }; + + /** + * Converts this TokenConfigUpdateEvent to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent + * @instance + * @returns {Object.} JSON object + */ + TokenConfigUpdateEvent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TokenConfigUpdateEvent; + })(); + + GetGroupActionsResponseV0.GroupActionEvent = (function() { + + /** + * Properties of a GroupActionEvent. + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @interface IGroupActionEvent + * @property {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ITokenEvent|null} [tokenEvent] GroupActionEvent tokenEvent + * @property {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IDocumentEvent|null} [documentEvent] GroupActionEvent documentEvent + * @property {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IContractEvent|null} [contractEvent] GroupActionEvent contractEvent + */ + + /** + * Constructs a new GroupActionEvent. + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @classdesc Represents a GroupActionEvent. + * @implements IGroupActionEvent + * @constructor + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IGroupActionEvent=} [properties] Properties to set + */ + function GroupActionEvent(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]]; + } + + /** + * GroupActionEvent tokenEvent. + * @member {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ITokenEvent|null|undefined} tokenEvent + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent + * @instance + */ + GroupActionEvent.prototype.tokenEvent = null; + + /** + * GroupActionEvent documentEvent. + * @member {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IDocumentEvent|null|undefined} documentEvent + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent + * @instance + */ + GroupActionEvent.prototype.documentEvent = null; + + /** + * GroupActionEvent contractEvent. + * @member {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IContractEvent|null|undefined} contractEvent + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent + * @instance + */ + GroupActionEvent.prototype.contractEvent = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GroupActionEvent eventType. + * @member {"tokenEvent"|"documentEvent"|"contractEvent"|undefined} eventType + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent + * @instance + */ + Object.defineProperty(GroupActionEvent.prototype, "eventType", { + get: $util.oneOfGetter($oneOfFields = ["tokenEvent", "documentEvent", "contractEvent"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GroupActionEvent instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IGroupActionEvent=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent} GroupActionEvent instance + */ + GroupActionEvent.create = function create(properties) { + return new GroupActionEvent(properties); + }; + + /** + * Encodes the specified GroupActionEvent message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IGroupActionEvent} message GroupActionEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupActionEvent.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tokenEvent != null && Object.hasOwnProperty.call(message, "tokenEvent")) + $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent.encode(message.tokenEvent, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.documentEvent != null && Object.hasOwnProperty.call(message, "documentEvent")) + $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent.encode(message.documentEvent, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.contractEvent != null && Object.hasOwnProperty.call(message, "contractEvent")) + $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent.encode(message.contractEvent, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GroupActionEvent message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IGroupActionEvent} message GroupActionEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupActionEvent.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GroupActionEvent message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent} GroupActionEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupActionEvent.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.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tokenEvent = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent.decode(reader, reader.uint32()); + break; + case 2: + message.documentEvent = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent.decode(reader, reader.uint32()); + break; + case 3: + message.contractEvent = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GroupActionEvent message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent} GroupActionEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupActionEvent.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GroupActionEvent message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GroupActionEvent.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.tokenEvent != null && message.hasOwnProperty("tokenEvent")) { + properties.eventType = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent.verify(message.tokenEvent); + if (error) + return "tokenEvent." + error; + } + } + if (message.documentEvent != null && message.hasOwnProperty("documentEvent")) { + if (properties.eventType === 1) + return "eventType: multiple values"; + properties.eventType = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent.verify(message.documentEvent); + if (error) + return "documentEvent." + error; + } + } + if (message.contractEvent != null && message.hasOwnProperty("contractEvent")) { + if (properties.eventType === 1) + return "eventType: multiple values"; + properties.eventType = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent.verify(message.contractEvent); + if (error) + return "contractEvent." + error; + } + } + return null; + }; + + /** + * Creates a GroupActionEvent message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent} GroupActionEvent + */ + GroupActionEvent.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent(); + if (object.tokenEvent != null) { + if (typeof object.tokenEvent !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent.tokenEvent: object expected"); + message.tokenEvent = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent.fromObject(object.tokenEvent); + } + if (object.documentEvent != null) { + if (typeof object.documentEvent !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent.documentEvent: object expected"); + message.documentEvent = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent.fromObject(object.documentEvent); + } + if (object.contractEvent != null) { + if (typeof object.contractEvent !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent.contractEvent: object expected"); + message.contractEvent = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent.fromObject(object.contractEvent); + } + return message; + }; + + /** + * Creates a plain object from a GroupActionEvent message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent} message GroupActionEvent + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GroupActionEvent.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.tokenEvent != null && message.hasOwnProperty("tokenEvent")) { + object.tokenEvent = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent.toObject(message.tokenEvent, options); + if (options.oneofs) + object.eventType = "tokenEvent"; + } + if (message.documentEvent != null && message.hasOwnProperty("documentEvent")) { + object.documentEvent = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent.toObject(message.documentEvent, options); + if (options.oneofs) + object.eventType = "documentEvent"; + } + if (message.contractEvent != null && message.hasOwnProperty("contractEvent")) { + object.contractEvent = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent.toObject(message.contractEvent, options); + if (options.oneofs) + object.eventType = "contractEvent"; + } + return object; + }; + + /** + * Converts this GroupActionEvent to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent + * @instance + * @returns {Object.} JSON object + */ + GroupActionEvent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GroupActionEvent; + })(); + + GetGroupActionsResponseV0.DocumentEvent = (function() { + + /** + * Properties of a DocumentEvent. + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @interface IDocumentEvent + * @property {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IDocumentCreateEvent|null} [create] DocumentEvent create + */ + + /** + * Constructs a new DocumentEvent. + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @classdesc Represents a DocumentEvent. + * @implements IDocumentEvent + * @constructor + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IDocumentEvent=} [properties] Properties to set + */ + function DocumentEvent(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]]; + } + + /** + * DocumentEvent create. + * @member {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IDocumentCreateEvent|null|undefined} create + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent + * @instance + */ + DocumentEvent.prototype.create = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DocumentEvent type. + * @member {"create"|undefined} type + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent + * @instance + */ + Object.defineProperty(DocumentEvent.prototype, "type", { + get: $util.oneOfGetter($oneOfFields = ["create"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DocumentEvent instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IDocumentEvent=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent} DocumentEvent instance + */ + DocumentEvent.create = function create(properties) { + return new DocumentEvent(properties); + }; + + /** + * Encodes the specified DocumentEvent message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IDocumentEvent} message DocumentEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DocumentEvent.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.create != null && Object.hasOwnProperty.call(message, "create")) + $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentCreateEvent.encode(message.create, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DocumentEvent message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IDocumentEvent} message DocumentEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DocumentEvent.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DocumentEvent message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent} DocumentEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DocumentEvent.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.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.create = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentCreateEvent.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DocumentEvent message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent} DocumentEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DocumentEvent.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DocumentEvent message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DocumentEvent.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.create != null && message.hasOwnProperty("create")) { + properties.type = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentCreateEvent.verify(message.create); + if (error) + return "create." + error; + } + } + return null; + }; + + /** + * Creates a DocumentEvent message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent} DocumentEvent + */ + DocumentEvent.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent(); + if (object.create != null) { + if (typeof object.create !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent.create: object expected"); + message.create = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentCreateEvent.fromObject(object.create); + } + return message; + }; + + /** + * Creates a plain object from a DocumentEvent message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent} message DocumentEvent + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DocumentEvent.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.create != null && message.hasOwnProperty("create")) { + object.create = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentCreateEvent.toObject(message.create, options); + if (options.oneofs) + object.type = "create"; + } + return object; + }; + + /** + * Converts this DocumentEvent to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent + * @instance + * @returns {Object.} JSON object + */ + DocumentEvent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DocumentEvent; + })(); + + GetGroupActionsResponseV0.DocumentCreateEvent = (function() { + + /** + * Properties of a DocumentCreateEvent. + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @interface IDocumentCreateEvent + * @property {Uint8Array|null} [createdDocument] DocumentCreateEvent createdDocument + */ + + /** + * Constructs a new DocumentCreateEvent. + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @classdesc Represents a DocumentCreateEvent. + * @implements IDocumentCreateEvent + * @constructor + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IDocumentCreateEvent=} [properties] Properties to set + */ + function DocumentCreateEvent(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]]; + } + + /** + * DocumentCreateEvent createdDocument. + * @member {Uint8Array} createdDocument + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentCreateEvent + * @instance + */ + DocumentCreateEvent.prototype.createdDocument = $util.newBuffer([]); + + /** + * Creates a new DocumentCreateEvent instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentCreateEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IDocumentCreateEvent=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentCreateEvent} DocumentCreateEvent instance + */ + DocumentCreateEvent.create = function create(properties) { + return new DocumentCreateEvent(properties); + }; + + /** + * Encodes the specified DocumentCreateEvent message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentCreateEvent.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentCreateEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IDocumentCreateEvent} message DocumentCreateEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DocumentCreateEvent.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.createdDocument != null && Object.hasOwnProperty.call(message, "createdDocument")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.createdDocument); + return writer; + }; + + /** + * Encodes the specified DocumentCreateEvent message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentCreateEvent.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentCreateEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IDocumentCreateEvent} message DocumentCreateEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DocumentCreateEvent.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DocumentCreateEvent message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentCreateEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentCreateEvent} DocumentCreateEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DocumentCreateEvent.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.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentCreateEvent(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.createdDocument = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DocumentCreateEvent message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentCreateEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentCreateEvent} DocumentCreateEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DocumentCreateEvent.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DocumentCreateEvent message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentCreateEvent + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DocumentCreateEvent.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.createdDocument != null && message.hasOwnProperty("createdDocument")) + if (!(message.createdDocument && typeof message.createdDocument.length === "number" || $util.isString(message.createdDocument))) + return "createdDocument: buffer expected"; + return null; + }; + + /** + * Creates a DocumentCreateEvent message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentCreateEvent + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentCreateEvent} DocumentCreateEvent + */ + DocumentCreateEvent.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentCreateEvent) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentCreateEvent(); + if (object.createdDocument != null) + if (typeof object.createdDocument === "string") + $util.base64.decode(object.createdDocument, message.createdDocument = $util.newBuffer($util.base64.length(object.createdDocument)), 0); + else if (object.createdDocument.length >= 0) + message.createdDocument = object.createdDocument; + return message; + }; + + /** + * Creates a plain object from a DocumentCreateEvent message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentCreateEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentCreateEvent} message DocumentCreateEvent + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DocumentCreateEvent.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if (options.bytes === String) + object.createdDocument = ""; + else { + object.createdDocument = []; + if (options.bytes !== Array) + object.createdDocument = $util.newBuffer(object.createdDocument); + } + if (message.createdDocument != null && message.hasOwnProperty("createdDocument")) + object.createdDocument = options.bytes === String ? $util.base64.encode(message.createdDocument, 0, message.createdDocument.length) : options.bytes === Array ? Array.prototype.slice.call(message.createdDocument) : message.createdDocument; + return object; + }; + + /** + * Converts this DocumentCreateEvent to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentCreateEvent + * @instance + * @returns {Object.} JSON object + */ + DocumentCreateEvent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DocumentCreateEvent; + })(); + + GetGroupActionsResponseV0.ContractUpdateEvent = (function() { + + /** + * Properties of a ContractUpdateEvent. + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @interface IContractUpdateEvent + * @property {Uint8Array|null} [updatedContract] ContractUpdateEvent updatedContract + */ + + /** + * Constructs a new ContractUpdateEvent. + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @classdesc Represents a ContractUpdateEvent. + * @implements IContractUpdateEvent + * @constructor + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IContractUpdateEvent=} [properties] Properties to set + */ + function ContractUpdateEvent(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]]; + } + + /** + * ContractUpdateEvent updatedContract. + * @member {Uint8Array} updatedContract + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractUpdateEvent + * @instance + */ + ContractUpdateEvent.prototype.updatedContract = $util.newBuffer([]); + + /** + * Creates a new ContractUpdateEvent instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractUpdateEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IContractUpdateEvent=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractUpdateEvent} ContractUpdateEvent instance + */ + ContractUpdateEvent.create = function create(properties) { + return new ContractUpdateEvent(properties); + }; + + /** + * Encodes the specified ContractUpdateEvent message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractUpdateEvent.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractUpdateEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IContractUpdateEvent} message ContractUpdateEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContractUpdateEvent.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.updatedContract != null && Object.hasOwnProperty.call(message, "updatedContract")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.updatedContract); + return writer; + }; + + /** + * Encodes the specified ContractUpdateEvent message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractUpdateEvent.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractUpdateEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IContractUpdateEvent} message ContractUpdateEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContractUpdateEvent.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ContractUpdateEvent message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractUpdateEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractUpdateEvent} ContractUpdateEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContractUpdateEvent.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.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractUpdateEvent(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.updatedContract = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ContractUpdateEvent message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractUpdateEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractUpdateEvent} ContractUpdateEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContractUpdateEvent.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ContractUpdateEvent message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractUpdateEvent + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ContractUpdateEvent.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.updatedContract != null && message.hasOwnProperty("updatedContract")) + if (!(message.updatedContract && typeof message.updatedContract.length === "number" || $util.isString(message.updatedContract))) + return "updatedContract: buffer expected"; + return null; + }; + + /** + * Creates a ContractUpdateEvent message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractUpdateEvent + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractUpdateEvent} ContractUpdateEvent + */ + ContractUpdateEvent.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractUpdateEvent) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractUpdateEvent(); + if (object.updatedContract != null) + if (typeof object.updatedContract === "string") + $util.base64.decode(object.updatedContract, message.updatedContract = $util.newBuffer($util.base64.length(object.updatedContract)), 0); + else if (object.updatedContract.length >= 0) + message.updatedContract = object.updatedContract; + return message; + }; + + /** + * Creates a plain object from a ContractUpdateEvent message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractUpdateEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractUpdateEvent} message ContractUpdateEvent + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ContractUpdateEvent.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if (options.bytes === String) + object.updatedContract = ""; + else { + object.updatedContract = []; + if (options.bytes !== Array) + object.updatedContract = $util.newBuffer(object.updatedContract); + } + if (message.updatedContract != null && message.hasOwnProperty("updatedContract")) + object.updatedContract = options.bytes === String ? $util.base64.encode(message.updatedContract, 0, message.updatedContract.length) : options.bytes === Array ? Array.prototype.slice.call(message.updatedContract) : message.updatedContract; + return object; + }; + + /** + * Converts this ContractUpdateEvent to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractUpdateEvent + * @instance + * @returns {Object.} JSON object + */ + ContractUpdateEvent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ContractUpdateEvent; + })(); + + GetGroupActionsResponseV0.ContractEvent = (function() { + + /** + * Properties of a ContractEvent. + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @interface IContractEvent + * @property {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IContractUpdateEvent|null} [update] ContractEvent update + */ + + /** + * Constructs a new ContractEvent. + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @classdesc Represents a ContractEvent. + * @implements IContractEvent + * @constructor + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IContractEvent=} [properties] Properties to set + */ + function ContractEvent(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]]; + } + + /** + * ContractEvent update. + * @member {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IContractUpdateEvent|null|undefined} update + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent + * @instance + */ + ContractEvent.prototype.update = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ContractEvent type. + * @member {"update"|undefined} type + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent + * @instance + */ + Object.defineProperty(ContractEvent.prototype, "type", { + get: $util.oneOfGetter($oneOfFields = ["update"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ContractEvent instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IContractEvent=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent} ContractEvent instance + */ + ContractEvent.create = function create(properties) { + return new ContractEvent(properties); + }; + + /** + * Encodes the specified ContractEvent message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IContractEvent} message ContractEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContractEvent.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.update != null && Object.hasOwnProperty.call(message, "update")) + $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractUpdateEvent.encode(message.update, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ContractEvent message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IContractEvent} message ContractEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContractEvent.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ContractEvent message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent} ContractEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContractEvent.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.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.update = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractUpdateEvent.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ContractEvent message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent} ContractEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContractEvent.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ContractEvent message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ContractEvent.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.update != null && message.hasOwnProperty("update")) { + properties.type = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractUpdateEvent.verify(message.update); + if (error) + return "update." + error; + } + } + return null; + }; + + /** + * Creates a ContractEvent message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent} ContractEvent + */ + ContractEvent.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent(); + if (object.update != null) { + if (typeof object.update !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent.update: object expected"); + message.update = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractUpdateEvent.fromObject(object.update); + } + return message; + }; + + /** + * Creates a plain object from a ContractEvent message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent} message ContractEvent + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ContractEvent.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.update != null && message.hasOwnProperty("update")) { + object.update = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractUpdateEvent.toObject(message.update, options); + if (options.oneofs) + object.type = "update"; + } + return object; + }; + + /** + * Converts this ContractEvent to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent + * @instance + * @returns {Object.} JSON object + */ + ContractEvent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ContractEvent; + })(); + + GetGroupActionsResponseV0.TokenEvent = (function() { + + /** + * Properties of a TokenEvent. + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @interface ITokenEvent + * @property {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IMintEvent|null} [mint] TokenEvent mint + * @property {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IBurnEvent|null} [burn] TokenEvent burn + * @property {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IFreezeEvent|null} [freeze] TokenEvent freeze + * @property {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IUnfreezeEvent|null} [unfreeze] TokenEvent unfreeze + * @property {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IDestroyFrozenFundsEvent|null} [destroyFrozenFunds] TokenEvent destroyFrozenFunds + * @property {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IEmergencyActionEvent|null} [emergencyAction] TokenEvent emergencyAction + * @property {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ITokenConfigUpdateEvent|null} [tokenConfigUpdate] TokenEvent tokenConfigUpdate + */ + + /** + * Constructs a new TokenEvent. + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @classdesc Represents a TokenEvent. + * @implements ITokenEvent + * @constructor + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ITokenEvent=} [properties] Properties to set + */ + function TokenEvent(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]]; + } + + /** + * TokenEvent mint. + * @member {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IMintEvent|null|undefined} mint + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent + * @instance + */ + TokenEvent.prototype.mint = null; + + /** + * TokenEvent burn. + * @member {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IBurnEvent|null|undefined} burn + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent + * @instance + */ + TokenEvent.prototype.burn = null; + + /** + * TokenEvent freeze. + * @member {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IFreezeEvent|null|undefined} freeze + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent + * @instance + */ + TokenEvent.prototype.freeze = null; + + /** + * TokenEvent unfreeze. + * @member {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IUnfreezeEvent|null|undefined} unfreeze + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent + * @instance + */ + TokenEvent.prototype.unfreeze = null; + + /** + * TokenEvent destroyFrozenFunds. + * @member {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IDestroyFrozenFundsEvent|null|undefined} destroyFrozenFunds + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent + * @instance + */ + TokenEvent.prototype.destroyFrozenFunds = null; + + /** + * TokenEvent emergencyAction. + * @member {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IEmergencyActionEvent|null|undefined} emergencyAction + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent + * @instance + */ + TokenEvent.prototype.emergencyAction = null; + + /** + * TokenEvent tokenConfigUpdate. + * @member {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ITokenConfigUpdateEvent|null|undefined} tokenConfigUpdate + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent + * @instance + */ + TokenEvent.prototype.tokenConfigUpdate = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * TokenEvent type. + * @member {"mint"|"burn"|"freeze"|"unfreeze"|"destroyFrozenFunds"|"emergencyAction"|"tokenConfigUpdate"|undefined} type + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent + * @instance + */ + Object.defineProperty(TokenEvent.prototype, "type", { + get: $util.oneOfGetter($oneOfFields = ["mint", "burn", "freeze", "unfreeze", "destroyFrozenFunds", "emergencyAction", "tokenConfigUpdate"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TokenEvent instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ITokenEvent=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent} TokenEvent instance + */ + TokenEvent.create = function create(properties) { + return new TokenEvent(properties); + }; + + /** + * Encodes the specified TokenEvent message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ITokenEvent} message TokenEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenEvent.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.mint != null && Object.hasOwnProperty.call(message, "mint")) + $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEvent.encode(message.mint, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.burn != null && Object.hasOwnProperty.call(message, "burn")) + $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnEvent.encode(message.burn, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.freeze != null && Object.hasOwnProperty.call(message, "freeze")) + $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.FreezeEvent.encode(message.freeze, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.unfreeze != null && Object.hasOwnProperty.call(message, "unfreeze")) + $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEvent.encode(message.unfreeze, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.destroyFrozenFunds != null && Object.hasOwnProperty.call(message, "destroyFrozenFunds")) + $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent.encode(message.destroyFrozenFunds, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.emergencyAction != null && Object.hasOwnProperty.call(message, "emergencyAction")) + $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent.encode(message.emergencyAction, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.tokenConfigUpdate != null && Object.hasOwnProperty.call(message, "tokenConfigUpdate")) + $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent.encode(message.tokenConfigUpdate, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TokenEvent message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ITokenEvent} message TokenEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenEvent.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TokenEvent message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent} TokenEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenEvent.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.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.mint = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEvent.decode(reader, reader.uint32()); + break; + case 2: + message.burn = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnEvent.decode(reader, reader.uint32()); + break; + case 3: + message.freeze = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.FreezeEvent.decode(reader, reader.uint32()); + break; + case 4: + message.unfreeze = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEvent.decode(reader, reader.uint32()); + break; + case 5: + message.destroyFrozenFunds = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent.decode(reader, reader.uint32()); + break; + case 6: + message.emergencyAction = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent.decode(reader, reader.uint32()); + break; + case 7: + message.tokenConfigUpdate = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TokenEvent message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent} TokenEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenEvent.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TokenEvent message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TokenEvent.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.mint != null && message.hasOwnProperty("mint")) { + properties.type = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEvent.verify(message.mint); + if (error) + return "mint." + error; + } + } + if (message.burn != null && message.hasOwnProperty("burn")) { + if (properties.type === 1) + return "type: multiple values"; + properties.type = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnEvent.verify(message.burn); + if (error) + return "burn." + error; + } + } + if (message.freeze != null && message.hasOwnProperty("freeze")) { + if (properties.type === 1) + return "type: multiple values"; + properties.type = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.FreezeEvent.verify(message.freeze); + if (error) + return "freeze." + error; + } + } + if (message.unfreeze != null && message.hasOwnProperty("unfreeze")) { + if (properties.type === 1) + return "type: multiple values"; + properties.type = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEvent.verify(message.unfreeze); + if (error) + return "unfreeze." + error; + } + } + if (message.destroyFrozenFunds != null && message.hasOwnProperty("destroyFrozenFunds")) { + if (properties.type === 1) + return "type: multiple values"; + properties.type = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent.verify(message.destroyFrozenFunds); + if (error) + return "destroyFrozenFunds." + error; + } + } + if (message.emergencyAction != null && message.hasOwnProperty("emergencyAction")) { + if (properties.type === 1) + return "type: multiple values"; + properties.type = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent.verify(message.emergencyAction); + if (error) + return "emergencyAction." + error; + } + } + if (message.tokenConfigUpdate != null && message.hasOwnProperty("tokenConfigUpdate")) { + if (properties.type === 1) + return "type: multiple values"; + properties.type = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent.verify(message.tokenConfigUpdate); + if (error) + return "tokenConfigUpdate." + error; + } + } + return null; + }; + + /** + * Creates a TokenEvent message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent} TokenEvent + */ + TokenEvent.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent(); + if (object.mint != null) { + if (typeof object.mint !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent.mint: object expected"); + message.mint = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEvent.fromObject(object.mint); + } + if (object.burn != null) { + if (typeof object.burn !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent.burn: object expected"); + message.burn = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnEvent.fromObject(object.burn); + } + if (object.freeze != null) { + if (typeof object.freeze !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent.freeze: object expected"); + message.freeze = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.FreezeEvent.fromObject(object.freeze); + } + if (object.unfreeze != null) { + if (typeof object.unfreeze !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent.unfreeze: object expected"); + message.unfreeze = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEvent.fromObject(object.unfreeze); + } + if (object.destroyFrozenFunds != null) { + if (typeof object.destroyFrozenFunds !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent.destroyFrozenFunds: object expected"); + message.destroyFrozenFunds = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent.fromObject(object.destroyFrozenFunds); + } + if (object.emergencyAction != null) { + if (typeof object.emergencyAction !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent.emergencyAction: object expected"); + message.emergencyAction = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent.fromObject(object.emergencyAction); + } + if (object.tokenConfigUpdate != null) { + if (typeof object.tokenConfigUpdate !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent.tokenConfigUpdate: object expected"); + message.tokenConfigUpdate = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent.fromObject(object.tokenConfigUpdate); + } + return message; + }; + + /** + * Creates a plain object from a TokenEvent message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent} message TokenEvent + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TokenEvent.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.mint != null && message.hasOwnProperty("mint")) { + object.mint = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEvent.toObject(message.mint, options); + if (options.oneofs) + object.type = "mint"; + } + if (message.burn != null && message.hasOwnProperty("burn")) { + object.burn = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnEvent.toObject(message.burn, options); + if (options.oneofs) + object.type = "burn"; + } + if (message.freeze != null && message.hasOwnProperty("freeze")) { + object.freeze = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.FreezeEvent.toObject(message.freeze, options); + if (options.oneofs) + object.type = "freeze"; + } + if (message.unfreeze != null && message.hasOwnProperty("unfreeze")) { + object.unfreeze = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEvent.toObject(message.unfreeze, options); + if (options.oneofs) + object.type = "unfreeze"; + } + if (message.destroyFrozenFunds != null && message.hasOwnProperty("destroyFrozenFunds")) { + object.destroyFrozenFunds = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent.toObject(message.destroyFrozenFunds, options); + if (options.oneofs) + object.type = "destroyFrozenFunds"; + } + if (message.emergencyAction != null && message.hasOwnProperty("emergencyAction")) { + object.emergencyAction = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent.toObject(message.emergencyAction, options); + if (options.oneofs) + object.type = "emergencyAction"; + } + if (message.tokenConfigUpdate != null && message.hasOwnProperty("tokenConfigUpdate")) { + object.tokenConfigUpdate = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent.toObject(message.tokenConfigUpdate, options); + if (options.oneofs) + object.type = "tokenConfigUpdate"; + } + return object; + }; + + /** + * Converts this TokenEvent to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent + * @instance + * @returns {Object.} JSON object + */ + TokenEvent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TokenEvent; + })(); + + GetGroupActionsResponseV0.GroupActionEntry = (function() { + + /** + * Properties of a GroupActionEntry. + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @interface IGroupActionEntry + * @property {Uint8Array|null} [actionId] GroupActionEntry actionId + * @property {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IGroupActionEvent|null} [event] GroupActionEntry event + */ + + /** + * Constructs a new GroupActionEntry. + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @classdesc Represents a GroupActionEntry. + * @implements IGroupActionEntry + * @constructor + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IGroupActionEntry=} [properties] Properties to set + */ + function GroupActionEntry(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]]; + } + + /** + * GroupActionEntry actionId. + * @member {Uint8Array} actionId + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntry + * @instance + */ + GroupActionEntry.prototype.actionId = $util.newBuffer([]); + + /** + * GroupActionEntry event. + * @member {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IGroupActionEvent|null|undefined} event + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntry + * @instance + */ + GroupActionEntry.prototype.event = null; + + /** + * Creates a new GroupActionEntry instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntry + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IGroupActionEntry=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntry} GroupActionEntry instance + */ + GroupActionEntry.create = function create(properties) { + return new GroupActionEntry(properties); + }; + + /** + * Encodes the specified GroupActionEntry message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntry.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntry + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IGroupActionEntry} message GroupActionEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupActionEntry.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.actionId != null && Object.hasOwnProperty.call(message, "actionId")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.actionId); + if (message.event != null && Object.hasOwnProperty.call(message, "event")) + $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent.encode(message.event, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GroupActionEntry message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntry.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntry + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IGroupActionEntry} message GroupActionEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupActionEntry.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GroupActionEntry message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntry} GroupActionEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupActionEntry.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.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntry(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.actionId = reader.bytes(); + break; + case 2: + message.event = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GroupActionEntry message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntry} GroupActionEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupActionEntry.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GroupActionEntry message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntry + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GroupActionEntry.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.actionId != null && message.hasOwnProperty("actionId")) + if (!(message.actionId && typeof message.actionId.length === "number" || $util.isString(message.actionId))) + return "actionId: buffer expected"; + if (message.event != null && message.hasOwnProperty("event")) { + var error = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent.verify(message.event); + if (error) + return "event." + error; + } + return null; + }; + + /** + * Creates a GroupActionEntry message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntry + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntry} GroupActionEntry + */ + GroupActionEntry.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntry) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntry(); + if (object.actionId != null) + if (typeof object.actionId === "string") + $util.base64.decode(object.actionId, message.actionId = $util.newBuffer($util.base64.length(object.actionId)), 0); + else if (object.actionId.length >= 0) + message.actionId = object.actionId; + if (object.event != null) { + if (typeof object.event !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntry.event: object expected"); + message.event = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent.fromObject(object.event); + } + return message; + }; + + /** + * Creates a plain object from a GroupActionEntry message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntry + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntry} message GroupActionEntry + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GroupActionEntry.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.actionId = ""; + else { + object.actionId = []; + if (options.bytes !== Array) + object.actionId = $util.newBuffer(object.actionId); + } + object.event = null; + } + if (message.actionId != null && message.hasOwnProperty("actionId")) + object.actionId = options.bytes === String ? $util.base64.encode(message.actionId, 0, message.actionId.length) : options.bytes === Array ? Array.prototype.slice.call(message.actionId) : message.actionId; + if (message.event != null && message.hasOwnProperty("event")) + object.event = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent.toObject(message.event, options); + return object; + }; + + /** + * Converts this GroupActionEntry to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntry + * @instance + * @returns {Object.} JSON object + */ + GroupActionEntry.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GroupActionEntry; + })(); + + GetGroupActionsResponseV0.GroupActions = (function() { + + /** + * Properties of a GroupActions. + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @interface IGroupActions + * @property {Array.|null} [groupActions] GroupActions groupActions + */ + + /** + * Constructs a new GroupActions. + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @classdesc Represents a GroupActions. + * @implements IGroupActions + * @constructor + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IGroupActions=} [properties] Properties to set + */ + function GroupActions(properties) { + this.groupActions = []; + 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]]; + } + + /** + * GroupActions groupActions. + * @member {Array.} groupActions + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActions + * @instance + */ + GroupActions.prototype.groupActions = $util.emptyArray; + + /** + * Creates a new GroupActions instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActions + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IGroupActions=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActions} GroupActions instance + */ + GroupActions.create = function create(properties) { + return new GroupActions(properties); + }; + + /** + * Encodes the specified GroupActions message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActions.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActions + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IGroupActions} message GroupActions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupActions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.groupActions != null && message.groupActions.length) + for (var i = 0; i < message.groupActions.length; ++i) + $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntry.encode(message.groupActions[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GroupActions message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActions.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActions + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IGroupActions} message GroupActions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupActions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GroupActions message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActions} GroupActions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupActions.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.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.groupActions && message.groupActions.length)) + message.groupActions = []; + message.groupActions.push($root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntry.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GroupActions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActions} GroupActions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupActions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GroupActions message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GroupActions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.groupActions != null && message.hasOwnProperty("groupActions")) { + if (!Array.isArray(message.groupActions)) + return "groupActions: array expected"; + for (var i = 0; i < message.groupActions.length; ++i) { + var error = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntry.verify(message.groupActions[i]); + if (error) + return "groupActions." + error; + } + } + return null; + }; + + /** + * Creates a GroupActions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActions + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActions} GroupActions + */ + GroupActions.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActions) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActions(); + if (object.groupActions) { + if (!Array.isArray(object.groupActions)) + throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActions.groupActions: array expected"); + message.groupActions = []; + for (var i = 0; i < object.groupActions.length; ++i) { + if (typeof object.groupActions[i] !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActions.groupActions: object expected"); + message.groupActions[i] = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntry.fromObject(object.groupActions[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a GroupActions message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActions + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActions} message GroupActions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GroupActions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.groupActions = []; + if (message.groupActions && message.groupActions.length) { + object.groupActions = []; + for (var j = 0; j < message.groupActions.length; ++j) + object.groupActions[j] = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntry.toObject(message.groupActions[j], options); + } + return object; + }; + + /** + * Converts this GroupActions to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActions + * @instance + * @returns {Object.} JSON object + */ + GroupActions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GroupActions; + })(); + + return GetGroupActionsResponseV0; + })(); + + return GetGroupActionsResponse; + })(); + + v0.GetGroupActionSignersRequest = (function() { + + /** + * Properties of a GetGroupActionSignersRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetGroupActionSignersRequest + * @property {org.dash.platform.dapi.v0.GetGroupActionSignersRequest.IGetGroupActionSignersRequestV0|null} [v0] GetGroupActionSignersRequest v0 + */ + + /** + * Constructs a new GetGroupActionSignersRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetGroupActionSignersRequest. + * @implements IGetGroupActionSignersRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IGetGroupActionSignersRequest=} [properties] Properties to set + */ + function GetGroupActionSignersRequest(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]]; + } + + /** + * GetGroupActionSignersRequest v0. + * @member {org.dash.platform.dapi.v0.GetGroupActionSignersRequest.IGetGroupActionSignersRequestV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersRequest + * @instance + */ + GetGroupActionSignersRequest.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetGroupActionSignersRequest version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersRequest + * @instance + */ + Object.defineProperty(GetGroupActionSignersRequest.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetGroupActionSignersRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetGroupActionSignersRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetGroupActionSignersRequest} GetGroupActionSignersRequest instance + */ + GetGroupActionSignersRequest.create = function create(properties) { + return new GetGroupActionSignersRequest(properties); + }; + + /** + * Encodes the specified GetGroupActionSignersRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionSignersRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetGroupActionSignersRequest} message GetGroupActionSignersRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGroupActionSignersRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetGroupActionSignersRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionSignersRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetGroupActionSignersRequest} message GetGroupActionSignersRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGroupActionSignersRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetGroupActionSignersRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetGroupActionSignersRequest} GetGroupActionSignersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGroupActionSignersRequest.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.org.dash.platform.dapi.v0.GetGroupActionSignersRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetGroupActionSignersRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetGroupActionSignersRequest} GetGroupActionSignersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGroupActionSignersRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetGroupActionSignersRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetGroupActionSignersRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetGroupActionSignersRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetGroupActionSignersRequest} GetGroupActionSignersRequest + */ + GetGroupActionSignersRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionSignersRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetGroupActionSignersRequest(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionSignersRequest.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetGroupActionSignersRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersRequest + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionSignersRequest} message GetGroupActionSignersRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetGroupActionSignersRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetGroupActionSignersRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersRequest + * @instance + * @returns {Object.} JSON object + */ + GetGroupActionSignersRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * ActionStatus enum. + * @name org.dash.platform.dapi.v0.GetGroupActionSignersRequest.ActionStatus + * @enum {number} + * @property {number} ACTIVE=0 ACTIVE value + * @property {number} CLOSED=1 CLOSED value + */ + GetGroupActionSignersRequest.ActionStatus = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ACTIVE"] = 0; + values[valuesById[1] = "CLOSED"] = 1; + return values; + })(); + + GetGroupActionSignersRequest.GetGroupActionSignersRequestV0 = (function() { + + /** + * Properties of a GetGroupActionSignersRequestV0. + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersRequest + * @interface IGetGroupActionSignersRequestV0 + * @property {Uint8Array|null} [contractId] GetGroupActionSignersRequestV0 contractId + * @property {number|null} [groupContractPosition] GetGroupActionSignersRequestV0 groupContractPosition + * @property {org.dash.platform.dapi.v0.GetGroupActionSignersRequest.ActionStatus|null} [status] GetGroupActionSignersRequestV0 status + * @property {Uint8Array|null} [actionId] GetGroupActionSignersRequestV0 actionId + * @property {boolean|null} [prove] GetGroupActionSignersRequestV0 prove + */ + + /** + * Constructs a new GetGroupActionSignersRequestV0. + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersRequest + * @classdesc Represents a GetGroupActionSignersRequestV0. + * @implements IGetGroupActionSignersRequestV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetGroupActionSignersRequest.IGetGroupActionSignersRequestV0=} [properties] Properties to set + */ + function GetGroupActionSignersRequestV0(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]]; + } + + /** + * GetGroupActionSignersRequestV0 contractId. + * @member {Uint8Array} contractId + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0 + * @instance + */ + GetGroupActionSignersRequestV0.prototype.contractId = $util.newBuffer([]); + + /** + * GetGroupActionSignersRequestV0 groupContractPosition. + * @member {number} groupContractPosition + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0 + * @instance + */ + GetGroupActionSignersRequestV0.prototype.groupContractPosition = 0; + + /** + * GetGroupActionSignersRequestV0 status. + * @member {org.dash.platform.dapi.v0.GetGroupActionSignersRequest.ActionStatus} status + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0 + * @instance + */ + GetGroupActionSignersRequestV0.prototype.status = 0; + + /** + * GetGroupActionSignersRequestV0 actionId. + * @member {Uint8Array} actionId + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0 + * @instance + */ + GetGroupActionSignersRequestV0.prototype.actionId = $util.newBuffer([]); + + /** + * GetGroupActionSignersRequestV0 prove. + * @member {boolean} prove + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0 + * @instance + */ + GetGroupActionSignersRequestV0.prototype.prove = false; + + /** + * Creates a new GetGroupActionSignersRequestV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionSignersRequest.IGetGroupActionSignersRequestV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0} GetGroupActionSignersRequestV0 instance + */ + GetGroupActionSignersRequestV0.create = function create(properties) { + return new GetGroupActionSignersRequestV0(properties); + }; + + /** + * Encodes the specified GetGroupActionSignersRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionSignersRequest.IGetGroupActionSignersRequestV0} message GetGroupActionSignersRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGroupActionSignersRequestV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.contractId != null && Object.hasOwnProperty.call(message, "contractId")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.contractId); + if (message.groupContractPosition != null && Object.hasOwnProperty.call(message, "groupContractPosition")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.groupContractPosition); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.status); + if (message.actionId != null && Object.hasOwnProperty.call(message, "actionId")) + writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.actionId); + if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.prove); + return writer; + }; + + /** + * Encodes the specified GetGroupActionSignersRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionSignersRequest.IGetGroupActionSignersRequestV0} message GetGroupActionSignersRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGroupActionSignersRequestV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetGroupActionSignersRequestV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0} GetGroupActionSignersRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGroupActionSignersRequestV0.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.org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.contractId = reader.bytes(); + break; + case 2: + message.groupContractPosition = reader.uint32(); + break; + case 3: + message.status = reader.int32(); + break; + case 4: + message.actionId = reader.bytes(); + break; + case 5: + message.prove = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetGroupActionSignersRequestV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0} GetGroupActionSignersRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGroupActionSignersRequestV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetGroupActionSignersRequestV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetGroupActionSignersRequestV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.contractId != null && message.hasOwnProperty("contractId")) + if (!(message.contractId && typeof message.contractId.length === "number" || $util.isString(message.contractId))) + return "contractId: buffer expected"; + if (message.groupContractPosition != null && message.hasOwnProperty("groupContractPosition")) + if (!$util.isInteger(message.groupContractPosition)) + return "groupContractPosition: integer expected"; + if (message.status != null && message.hasOwnProperty("status")) + switch (message.status) { + default: + return "status: enum value expected"; + case 0: + case 1: + break; + } + if (message.actionId != null && message.hasOwnProperty("actionId")) + if (!(message.actionId && typeof message.actionId.length === "number" || $util.isString(message.actionId))) + return "actionId: buffer expected"; + if (message.prove != null && message.hasOwnProperty("prove")) + if (typeof message.prove !== "boolean") + return "prove: boolean expected"; + return null; + }; + + /** + * Creates a GetGroupActionSignersRequestV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0} GetGroupActionSignersRequestV0 + */ + GetGroupActionSignersRequestV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0(); + if (object.contractId != null) + if (typeof object.contractId === "string") + $util.base64.decode(object.contractId, message.contractId = $util.newBuffer($util.base64.length(object.contractId)), 0); + else if (object.contractId.length >= 0) + message.contractId = object.contractId; + if (object.groupContractPosition != null) + message.groupContractPosition = object.groupContractPosition >>> 0; + switch (object.status) { + case "ACTIVE": + case 0: + message.status = 0; + break; + case "CLOSED": + case 1: + message.status = 1; + break; + } + if (object.actionId != null) + if (typeof object.actionId === "string") + $util.base64.decode(object.actionId, message.actionId = $util.newBuffer($util.base64.length(object.actionId)), 0); + else if (object.actionId.length >= 0) + message.actionId = object.actionId; + if (object.prove != null) + message.prove = Boolean(object.prove); + return message; + }; + + /** + * Creates a plain object from a GetGroupActionSignersRequestV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0} message GetGroupActionSignersRequestV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetGroupActionSignersRequestV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.contractId = ""; + else { + object.contractId = []; + if (options.bytes !== Array) + object.contractId = $util.newBuffer(object.contractId); + } + object.groupContractPosition = 0; + object.status = options.enums === String ? "ACTIVE" : 0; + if (options.bytes === String) + object.actionId = ""; + else { + object.actionId = []; + if (options.bytes !== Array) + object.actionId = $util.newBuffer(object.actionId); + } + object.prove = false; + } + if (message.contractId != null && message.hasOwnProperty("contractId")) + object.contractId = options.bytes === String ? $util.base64.encode(message.contractId, 0, message.contractId.length) : options.bytes === Array ? Array.prototype.slice.call(message.contractId) : message.contractId; + if (message.groupContractPosition != null && message.hasOwnProperty("groupContractPosition")) + object.groupContractPosition = message.groupContractPosition; + if (message.status != null && message.hasOwnProperty("status")) + object.status = options.enums === String ? $root.org.dash.platform.dapi.v0.GetGroupActionSignersRequest.ActionStatus[message.status] : message.status; + if (message.actionId != null && message.hasOwnProperty("actionId")) + object.actionId = options.bytes === String ? $util.base64.encode(message.actionId, 0, message.actionId.length) : options.bytes === Array ? Array.prototype.slice.call(message.actionId) : message.actionId; + if (message.prove != null && message.hasOwnProperty("prove")) + object.prove = message.prove; + return object; + }; + + /** + * Converts this GetGroupActionSignersRequestV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0 + * @instance + * @returns {Object.} JSON object + */ + GetGroupActionSignersRequestV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetGroupActionSignersRequestV0; + })(); + + return GetGroupActionSignersRequest; + })(); + + v0.GetGroupActionSignersResponse = (function() { + + /** + * Properties of a GetGroupActionSignersResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetGroupActionSignersResponse + * @property {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.IGetGroupActionSignersResponseV0|null} [v0] GetGroupActionSignersResponse v0 + */ + + /** + * Constructs a new GetGroupActionSignersResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetGroupActionSignersResponse. + * @implements IGetGroupActionSignersResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IGetGroupActionSignersResponse=} [properties] Properties to set + */ + function GetGroupActionSignersResponse(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]]; + } + + /** + * GetGroupActionSignersResponse v0. + * @member {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.IGetGroupActionSignersResponseV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse + * @instance + */ + GetGroupActionSignersResponse.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetGroupActionSignersResponse version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse + * @instance + */ + Object.defineProperty(GetGroupActionSignersResponse.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetGroupActionSignersResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetGroupActionSignersResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetGroupActionSignersResponse} GetGroupActionSignersResponse instance + */ + GetGroupActionSignersResponse.create = function create(properties) { + return new GetGroupActionSignersResponse(properties); + }; + + /** + * Encodes the specified GetGroupActionSignersResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionSignersResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetGroupActionSignersResponse} message GetGroupActionSignersResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGroupActionSignersResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetGroupActionSignersResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionSignersResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetGroupActionSignersResponse} message GetGroupActionSignersResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGroupActionSignersResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetGroupActionSignersResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetGroupActionSignersResponse} GetGroupActionSignersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGroupActionSignersResponse.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.org.dash.platform.dapi.v0.GetGroupActionSignersResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetGroupActionSignersResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetGroupActionSignersResponse} GetGroupActionSignersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGroupActionSignersResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetGroupActionSignersResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetGroupActionSignersResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetGroupActionSignersResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetGroupActionSignersResponse} GetGroupActionSignersResponse + */ + GetGroupActionSignersResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionSignersResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetGroupActionSignersResponse(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionSignersResponse.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetGroupActionSignersResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionSignersResponse} message GetGroupActionSignersResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetGroupActionSignersResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetGroupActionSignersResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse + * @instance + * @returns {Object.} JSON object + */ + GetGroupActionSignersResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetGroupActionSignersResponse.GetGroupActionSignersResponseV0 = (function() { + + /** + * Properties of a GetGroupActionSignersResponseV0. + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse + * @interface IGetGroupActionSignersResponseV0 + * @property {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.IGroupActionSigners|null} [groupActionSigners] GetGroupActionSignersResponseV0 groupActionSigners + * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetGroupActionSignersResponseV0 proof + * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetGroupActionSignersResponseV0 metadata + */ + + /** + * Constructs a new GetGroupActionSignersResponseV0. + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse + * @classdesc Represents a GetGroupActionSignersResponseV0. + * @implements IGetGroupActionSignersResponseV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.IGetGroupActionSignersResponseV0=} [properties] Properties to set + */ + function GetGroupActionSignersResponseV0(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]]; + } + + /** + * GetGroupActionSignersResponseV0 groupActionSigners. + * @member {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.IGroupActionSigners|null|undefined} groupActionSigners + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0 + * @instance + */ + GetGroupActionSignersResponseV0.prototype.groupActionSigners = null; + + /** + * GetGroupActionSignersResponseV0 proof. + * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0 + * @instance + */ + GetGroupActionSignersResponseV0.prototype.proof = null; + + /** + * GetGroupActionSignersResponseV0 metadata. + * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0 + * @instance + */ + GetGroupActionSignersResponseV0.prototype.metadata = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetGroupActionSignersResponseV0 result. + * @member {"groupActionSigners"|"proof"|undefined} result + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0 + * @instance + */ + Object.defineProperty(GetGroupActionSignersResponseV0.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["groupActionSigners", "proof"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetGroupActionSignersResponseV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.IGetGroupActionSignersResponseV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0} GetGroupActionSignersResponseV0 instance + */ + GetGroupActionSignersResponseV0.create = function create(properties) { + return new GetGroupActionSignersResponseV0(properties); + }; + + /** + * Encodes the specified GetGroupActionSignersResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.IGetGroupActionSignersResponseV0} message GetGroupActionSignersResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGroupActionSignersResponseV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.groupActionSigners != null && Object.hasOwnProperty.call(message, "groupActionSigners")) + $root.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigners.encode(message.groupActionSigners, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetGroupActionSignersResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.IGetGroupActionSignersResponseV0} message GetGroupActionSignersResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGroupActionSignersResponseV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetGroupActionSignersResponseV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0} GetGroupActionSignersResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGroupActionSignersResponseV0.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.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.groupActionSigners = $root.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigners.decode(reader, reader.uint32()); + break; + case 2: + message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); + break; + case 3: + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetGroupActionSignersResponseV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0} GetGroupActionSignersResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGroupActionSignersResponseV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetGroupActionSignersResponseV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetGroupActionSignersResponseV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.groupActionSigners != null && message.hasOwnProperty("groupActionSigners")) { + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigners.verify(message.groupActionSigners); + if (error) + return "groupActionSigners." + error; + } + } + if (message.proof != null && message.hasOwnProperty("proof")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); + if (error) + return "proof." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a GetGroupActionSignersResponseV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0} GetGroupActionSignersResponseV0 + */ + GetGroupActionSignersResponseV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0(); + if (object.groupActionSigners != null) { + if (typeof object.groupActionSigners !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.groupActionSigners: object expected"); + message.groupActionSigners = $root.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigners.fromObject(object.groupActionSigners); + } + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.proof: object expected"); + message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.metadata: object expected"); + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a GetGroupActionSignersResponseV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0} message GetGroupActionSignersResponseV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetGroupActionSignersResponseV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.metadata = null; + if (message.groupActionSigners != null && message.hasOwnProperty("groupActionSigners")) { + object.groupActionSigners = $root.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigners.toObject(message.groupActionSigners, options); + if (options.oneofs) + object.result = "groupActionSigners"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); + if (options.oneofs) + object.result = "proof"; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this GetGroupActionSignersResponseV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0 + * @instance + * @returns {Object.} JSON object + */ + GetGroupActionSignersResponseV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetGroupActionSignersResponseV0.GroupActionSigner = (function() { + + /** + * Properties of a GroupActionSigner. + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0 + * @interface IGroupActionSigner + * @property {Uint8Array|null} [signerId] GroupActionSigner signerId + * @property {number|null} [power] GroupActionSigner power + */ + + /** + * Constructs a new GroupActionSigner. + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0 + * @classdesc Represents a GroupActionSigner. + * @implements IGroupActionSigner + * @constructor + * @param {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.IGroupActionSigner=} [properties] Properties to set + */ + function GroupActionSigner(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]]; + } + + /** + * GroupActionSigner signerId. + * @member {Uint8Array} signerId + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigner + * @instance + */ + GroupActionSigner.prototype.signerId = $util.newBuffer([]); + + /** + * GroupActionSigner power. + * @member {number} power + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigner + * @instance + */ + GroupActionSigner.prototype.power = 0; + + /** + * Creates a new GroupActionSigner instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigner + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.IGroupActionSigner=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigner} GroupActionSigner instance + */ + GroupActionSigner.create = function create(properties) { + return new GroupActionSigner(properties); + }; + + /** + * Encodes the specified GroupActionSigner message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigner.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigner + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.IGroupActionSigner} message GroupActionSigner message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupActionSigner.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.signerId != null && Object.hasOwnProperty.call(message, "signerId")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.signerId); + if (message.power != null && Object.hasOwnProperty.call(message, "power")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.power); + return writer; + }; + + /** + * Encodes the specified GroupActionSigner message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigner.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigner + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.IGroupActionSigner} message GroupActionSigner message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupActionSigner.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GroupActionSigner message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigner + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigner} GroupActionSigner + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupActionSigner.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.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigner(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.signerId = reader.bytes(); + break; + case 2: + message.power = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GroupActionSigner message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigner + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigner} GroupActionSigner + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupActionSigner.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GroupActionSigner message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigner + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GroupActionSigner.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.signerId != null && message.hasOwnProperty("signerId")) + if (!(message.signerId && typeof message.signerId.length === "number" || $util.isString(message.signerId))) + return "signerId: buffer expected"; + if (message.power != null && message.hasOwnProperty("power")) + if (!$util.isInteger(message.power)) + return "power: integer expected"; + return null; + }; + + /** + * Creates a GroupActionSigner message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigner + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigner} GroupActionSigner + */ + GroupActionSigner.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigner) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigner(); + if (object.signerId != null) + if (typeof object.signerId === "string") + $util.base64.decode(object.signerId, message.signerId = $util.newBuffer($util.base64.length(object.signerId)), 0); + else if (object.signerId.length >= 0) + message.signerId = object.signerId; + if (object.power != null) + message.power = object.power >>> 0; + return message; + }; + + /** + * Creates a plain object from a GroupActionSigner message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigner + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigner} message GroupActionSigner + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GroupActionSigner.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.signerId = ""; + else { + object.signerId = []; + if (options.bytes !== Array) + object.signerId = $util.newBuffer(object.signerId); + } + object.power = 0; + } + if (message.signerId != null && message.hasOwnProperty("signerId")) + object.signerId = options.bytes === String ? $util.base64.encode(message.signerId, 0, message.signerId.length) : options.bytes === Array ? Array.prototype.slice.call(message.signerId) : message.signerId; + if (message.power != null && message.hasOwnProperty("power")) + object.power = message.power; + return object; + }; + + /** + * Converts this GroupActionSigner to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigner + * @instance + * @returns {Object.} JSON object + */ + GroupActionSigner.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GroupActionSigner; + })(); + + GetGroupActionSignersResponseV0.GroupActionSigners = (function() { + + /** + * Properties of a GroupActionSigners. + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0 + * @interface IGroupActionSigners + * @property {Array.|null} [signers] GroupActionSigners signers + */ + + /** + * Constructs a new GroupActionSigners. + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0 + * @classdesc Represents a GroupActionSigners. + * @implements IGroupActionSigners + * @constructor + * @param {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.IGroupActionSigners=} [properties] Properties to set + */ + function GroupActionSigners(properties) { + 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]]; + } + + /** + * GroupActionSigners signers. + * @member {Array.} signers + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigners + * @instance + */ + GroupActionSigners.prototype.signers = $util.emptyArray; + + /** + * Creates a new GroupActionSigners instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigners + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.IGroupActionSigners=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigners} GroupActionSigners instance + */ + GroupActionSigners.create = function create(properties) { + return new GroupActionSigners(properties); + }; + + /** + * Encodes the specified GroupActionSigners message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigners.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigners + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.IGroupActionSigners} message GroupActionSigners message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupActionSigners.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.signers != null && message.signers.length) + for (var i = 0; i < message.signers.length; ++i) + $root.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigner.encode(message.signers[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GroupActionSigners message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigners.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigners + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.IGroupActionSigners} message GroupActionSigners message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupActionSigners.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GroupActionSigners message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigners + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigners} GroupActionSigners + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupActionSigners.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.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigners(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.signers && message.signers.length)) + message.signers = []; + message.signers.push($root.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigner.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GroupActionSigners message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigners + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigners} GroupActionSigners + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupActionSigners.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GroupActionSigners message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigners + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GroupActionSigners.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object 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) { + var error = $root.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigner.verify(message.signers[i]); + if (error) + return "signers." + error; + } + } + return null; + }; + + /** + * Creates a GroupActionSigners message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigners + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigners} GroupActionSigners + */ + GroupActionSigners.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigners) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigners(); + if (object.signers) { + if (!Array.isArray(object.signers)) + throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigners.signers: array expected"); + message.signers = []; + for (var i = 0; i < object.signers.length; ++i) { + if (typeof object.signers[i] !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigners.signers: object expected"); + message.signers[i] = $root.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigner.fromObject(object.signers[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a GroupActionSigners message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigners + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigners} message GroupActionSigners + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GroupActionSigners.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.signers = []; + if (message.signers && message.signers.length) { + object.signers = []; + for (var j = 0; j < message.signers.length; ++j) + object.signers[j] = $root.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigner.toObject(message.signers[j], options); + } + return object; + }; + + /** + * Converts this GroupActionSigners to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigners + * @instance + * @returns {Object.} JSON object + */ + GroupActionSigners.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GroupActionSigners; + })(); + + return GetGroupActionSignersResponseV0; + })(); + + return GetGroupActionSignersResponse; + })(); + + return v0; + })(); + + return dapi; + })(); + + return platform; + })(); + + return dash; + })(); + + return org; +})(); + +$root.google = (function() { + + /** + * Namespace google. + * @exports google + * @namespace + */ + var google = {}; + + google.protobuf = (function() { + + /** + * Namespace protobuf. + * @memberof google + * @namespace + */ + var protobuf = {}; + + protobuf.DoubleValue = (function() { + + /** + * Properties of a DoubleValue. + * @memberof google.protobuf + * @interface IDoubleValue + * @property {number|null} [value] DoubleValue value + */ + + /** + * Constructs a new DoubleValue. + * @memberof google.protobuf + * @classdesc Represents a DoubleValue. + * @implements IDoubleValue + * @constructor + * @param {google.protobuf.IDoubleValue=} [properties] Properties to set + */ + function DoubleValue(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]]; + } + + /** + * DoubleValue value. + * @member {number} value + * @memberof google.protobuf.DoubleValue + * @instance + */ + DoubleValue.prototype.value = 0; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @function create + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue=} [properties] Properties to set + * @returns {google.protobuf.DoubleValue} DoubleValue instance + */ + DoubleValue.create = function create(properties) { + return new DoubleValue(properties); + }; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue} message DoubleValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DoubleValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 1 =*/9).double(message.value); + return writer; + }; + + /** + * Encodes the specified DoubleValue message, length delimited. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue} message DoubleValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DoubleValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DoubleValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DoubleValue} DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DoubleValue.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.DoubleValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.value = reader.double(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DoubleValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DoubleValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DoubleValue} DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DoubleValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DoubleValue message. + * @function verify + * @memberof google.protobuf.DoubleValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DoubleValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value !== "number") + return "value: number expected"; + return null; + }; + + /** + * Creates a DoubleValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DoubleValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DoubleValue} DoubleValue + */ + DoubleValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DoubleValue) + return object; + var message = new $root.google.protobuf.DoubleValue(); + if (object.value != null) + message.value = Number(object.value); + return message; + }; + + /** + * Creates a plain object from a DoubleValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.DoubleValue} message DoubleValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DoubleValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = 0; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.json && !isFinite(message.value) ? String(message.value) : message.value; + return object; + }; + + /** + * Converts this DoubleValue to JSON. + * @function toJSON + * @memberof google.protobuf.DoubleValue + * @instance + * @returns {Object.} JSON object + */ + DoubleValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DoubleValue; + })(); + + protobuf.FloatValue = (function() { + + /** + * Properties of a FloatValue. + * @memberof google.protobuf + * @interface IFloatValue + * @property {number|null} [value] FloatValue value + */ + + /** + * Constructs a new FloatValue. + * @memberof google.protobuf + * @classdesc Represents a FloatValue. + * @implements IFloatValue + * @constructor + * @param {google.protobuf.IFloatValue=} [properties] Properties to set + */ + function FloatValue(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]]; + } + + /** + * FloatValue value. + * @member {number} value + * @memberof google.protobuf.FloatValue + * @instance + */ + FloatValue.prototype.value = 0; + + /** + * Creates a new FloatValue instance using the specified properties. + * @function create + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue=} [properties] Properties to set + * @returns {google.protobuf.FloatValue} FloatValue instance + */ + FloatValue.create = function create(properties) { + return new FloatValue(properties); + }; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue} message FloatValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FloatValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.value); + return writer; + }; + + /** + * Encodes the specified FloatValue message, length delimited. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue} message FloatValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FloatValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FloatValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FloatValue} FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FloatValue.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.FloatValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.value = reader.float(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FloatValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FloatValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FloatValue} FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FloatValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FloatValue message. + * @function verify + * @memberof google.protobuf.FloatValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FloatValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value !== "number") + return "value: number expected"; + return null; + }; + + /** + * Creates a FloatValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FloatValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FloatValue} FloatValue + */ + FloatValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FloatValue) + return object; + var message = new $root.google.protobuf.FloatValue(); + if (object.value != null) + message.value = Number(object.value); + return message; + }; + + /** + * Creates a plain object from a FloatValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.FloatValue} message FloatValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FloatValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = 0; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.json && !isFinite(message.value) ? String(message.value) : message.value; + return object; + }; + + /** + * Converts this FloatValue to JSON. + * @function toJSON + * @memberof google.protobuf.FloatValue + * @instance + * @returns {Object.} JSON object + */ + FloatValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return FloatValue; + })(); + + protobuf.Int64Value = (function() { + + /** + * Properties of an Int64Value. + * @memberof google.protobuf + * @interface IInt64Value + * @property {number|Long|null} [value] Int64Value value + */ + + /** + * Constructs a new Int64Value. + * @memberof google.protobuf + * @classdesc Represents an Int64Value. + * @implements IInt64Value + * @constructor + * @param {google.protobuf.IInt64Value=} [properties] Properties to set + */ + function Int64Value(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]]; + } + + /** + * Int64Value value. + * @member {number|Long} value + * @memberof google.protobuf.Int64Value + * @instance + */ + Int64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Int64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value=} [properties] Properties to set + * @returns {google.protobuf.Int64Value} Int64Value instance + */ + Int64Value.create = function create(properties) { + return new Int64Value(properties); + }; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value} message Int64Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int64Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.value); + return writer; + }; + + /** + * Encodes the specified Int64Value message, length delimited. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value} message Int64Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int64Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int64Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Int64Value} Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int64Value.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.Int64Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.value = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Int64Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Int64Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Int64Value} Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int64Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Int64Value message. + * @function verify + * @memberof google.protobuf.Int64Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Int64Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isInteger(message.value) && !(message.value && $util.isInteger(message.value.low) && $util.isInteger(message.value.high))) + return "value: integer|Long expected"; + return null; + }; + + /** + * Creates an Int64Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Int64Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Int64Value} Int64Value + */ + Int64Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Int64Value) + return object; + var message = new $root.google.protobuf.Int64Value(); + if (object.value != null) + if ($util.Long) + (message.value = $util.Long.fromValue(object.value)).unsigned = false; + else if (typeof object.value === "string") + message.value = parseInt(object.value, 10); + else if (typeof object.value === "number") + message.value = object.value; + else if (typeof object.value === "object") + message.value = new $util.LongBits(object.value.low >>> 0, object.value.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from an Int64Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.Int64Value} message Int64Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Int64Value.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.value = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.value = options.longs === String ? "0" : 0; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value === "number") + object.value = options.longs === String ? String(message.value) : message.value; + else + object.value = options.longs === String ? $util.Long.prototype.toString.call(message.value) : options.longs === Number ? new $util.LongBits(message.value.low >>> 0, message.value.high >>> 0).toNumber() : message.value; + return object; + }; + + /** + * Converts this Int64Value to JSON. + * @function toJSON + * @memberof google.protobuf.Int64Value + * @instance + * @returns {Object.} JSON object + */ + Int64Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Int64Value; + })(); + + protobuf.UInt64Value = (function() { + + /** + * Properties of a UInt64Value. + * @memberof google.protobuf + * @interface IUInt64Value + * @property {number|Long|null} [value] UInt64Value value + */ + + /** + * Constructs a new UInt64Value. + * @memberof google.protobuf + * @classdesc Represents a UInt64Value. + * @implements IUInt64Value + * @constructor + * @param {google.protobuf.IUInt64Value=} [properties] Properties to set + */ + function UInt64Value(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]]; + } + + /** + * UInt64Value value. + * @member {number|Long} value + * @memberof google.protobuf.UInt64Value + * @instance + */ + UInt64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new UInt64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value=} [properties] Properties to set + * @returns {google.protobuf.UInt64Value} UInt64Value instance + */ + UInt64Value.create = function create(properties) { + return new UInt64Value(properties); + }; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value} message UInt64Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt64Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.value); + return writer; + }; + + /** + * Encodes the specified UInt64Value message, length delimited. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value} message UInt64Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt64Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt64Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UInt64Value} UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt64Value.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.UInt64Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.value = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a UInt64Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UInt64Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UInt64Value} UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt64Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a UInt64Value message. + * @function verify + * @memberof google.protobuf.UInt64Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UInt64Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isInteger(message.value) && !(message.value && $util.isInteger(message.value.low) && $util.isInteger(message.value.high))) + return "value: integer|Long expected"; + return null; + }; + + /** + * Creates a UInt64Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UInt64Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UInt64Value} UInt64Value + */ + UInt64Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UInt64Value) + return object; + var message = new $root.google.protobuf.UInt64Value(); + if (object.value != null) + if ($util.Long) + (message.value = $util.Long.fromValue(object.value)).unsigned = true; + else if (typeof object.value === "string") + message.value = parseInt(object.value, 10); + else if (typeof object.value === "number") + message.value = object.value; + else if (typeof object.value === "object") + message.value = new $util.LongBits(object.value.low >>> 0, object.value.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from a UInt64Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.UInt64Value} message UInt64Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UInt64Value.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.value = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.value = options.longs === String ? "0" : 0; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value === "number") + object.value = options.longs === String ? String(message.value) : message.value; + else + object.value = options.longs === String ? $util.Long.prototype.toString.call(message.value) : options.longs === Number ? new $util.LongBits(message.value.low >>> 0, message.value.high >>> 0).toNumber(true) : message.value; + return object; + }; + + /** + * Converts this UInt64Value to JSON. + * @function toJSON + * @memberof google.protobuf.UInt64Value + * @instance + * @returns {Object.} JSON object + */ + UInt64Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UInt64Value; + })(); + + protobuf.Int32Value = (function() { + + /** + * Properties of an Int32Value. + * @memberof google.protobuf + * @interface IInt32Value + * @property {number|null} [value] Int32Value value + */ + + /** + * Constructs a new Int32Value. + * @memberof google.protobuf + * @classdesc Represents an Int32Value. + * @implements IInt32Value + * @constructor + * @param {google.protobuf.IInt32Value=} [properties] Properties to set + */ + function Int32Value(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]]; + } + + /** + * Int32Value value. + * @member {number} value + * @memberof google.protobuf.Int32Value + * @instance + */ + Int32Value.prototype.value = 0; + + /** + * Creates a new Int32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value=} [properties] Properties to set + * @returns {google.protobuf.Int32Value} Int32Value instance + */ + Int32Value.create = function create(properties) { + return new Int32Value(properties); + }; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value} message Int32Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int32Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.value); + return writer; + }; + + /** + * Encodes the specified Int32Value message, length delimited. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value} message Int32Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int32Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int32Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Int32Value} Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int32Value.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.Int32Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.value = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Int32Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Int32Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Int32Value} Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int32Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Int32Value message. + * @function verify + * @memberof google.protobuf.Int32Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Int32Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isInteger(message.value)) + return "value: integer expected"; + return null; + }; + + /** + * Creates an Int32Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Int32Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Int32Value} Int32Value + */ + Int32Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Int32Value) + return object; + var message = new $root.google.protobuf.Int32Value(); + if (object.value != null) + message.value = object.value | 0; + return message; + }; + + /** + * Creates a plain object from an Int32Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.Int32Value} message Int32Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Int32Value.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = 0; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; + + /** + * Converts this Int32Value to JSON. + * @function toJSON + * @memberof google.protobuf.Int32Value + * @instance + * @returns {Object.} JSON object + */ + Int32Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Int32Value; + })(); + + protobuf.UInt32Value = (function() { + + /** + * Properties of a UInt32Value. + * @memberof google.protobuf + * @interface IUInt32Value + * @property {number|null} [value] UInt32Value value + */ + + /** + * Constructs a new UInt32Value. + * @memberof google.protobuf + * @classdesc Represents a UInt32Value. + * @implements IUInt32Value + * @constructor + * @param {google.protobuf.IUInt32Value=} [properties] Properties to set + */ + function UInt32Value(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]]; + } + + /** + * UInt32Value value. + * @member {number} value + * @memberof google.protobuf.UInt32Value + * @instance + */ + UInt32Value.prototype.value = 0; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value=} [properties] Properties to set + * @returns {google.protobuf.UInt32Value} UInt32Value instance + */ + UInt32Value.create = function create(properties) { + return new UInt32Value(properties); + }; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value} message UInt32Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt32Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.value); + return writer; + }; + + /** + * Encodes the specified UInt32Value message, length delimited. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value} message UInt32Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt32Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt32Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UInt32Value} UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt32Value.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.UInt32Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.value = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a UInt32Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UInt32Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UInt32Value} UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt32Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a UInt32Value message. + * @function verify + * @memberof google.protobuf.UInt32Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UInt32Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isInteger(message.value)) + return "value: integer expected"; + return null; + }; + + /** + * Creates a UInt32Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UInt32Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UInt32Value} UInt32Value + */ + UInt32Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UInt32Value) + return object; + var message = new $root.google.protobuf.UInt32Value(); + if (object.value != null) + message.value = object.value >>> 0; + return message; + }; + + /** + * Creates a plain object from a UInt32Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.UInt32Value} message UInt32Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UInt32Value.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = 0; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; + + /** + * Converts this UInt32Value to JSON. + * @function toJSON + * @memberof google.protobuf.UInt32Value + * @instance + * @returns {Object.} JSON object + */ + UInt32Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UInt32Value; + })(); + + protobuf.BoolValue = (function() { + + /** + * Properties of a BoolValue. + * @memberof google.protobuf + * @interface IBoolValue + * @property {boolean|null} [value] BoolValue value + */ + + /** + * Constructs a new BoolValue. + * @memberof google.protobuf + * @classdesc Represents a BoolValue. + * @implements IBoolValue + * @constructor + * @param {google.protobuf.IBoolValue=} [properties] Properties to set + */ + function BoolValue(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]]; + } + + /** + * BoolValue value. + * @member {boolean} value + * @memberof google.protobuf.BoolValue + * @instance + */ + BoolValue.prototype.value = false; + + /** + * Creates a new BoolValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue=} [properties] Properties to set + * @returns {google.protobuf.BoolValue} BoolValue instance + */ + BoolValue.create = function create(properties) { + return new BoolValue(properties); + }; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue} message BoolValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoolValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.value); + return writer; + }; + + /** + * Encodes the specified BoolValue message, length delimited. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue} message BoolValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoolValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BoolValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.BoolValue} BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoolValue.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.BoolValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.value = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BoolValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.BoolValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.BoolValue} BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoolValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BoolValue message. + * @function verify + * @memberof google.protobuf.BoolValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BoolValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value !== "boolean") + return "value: boolean expected"; + return null; + }; + + /** + * Creates a BoolValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.BoolValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.BoolValue} BoolValue + */ + BoolValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.BoolValue) + return object; + var message = new $root.google.protobuf.BoolValue(); + if (object.value != null) + message.value = Boolean(object.value); + return message; + }; + + /** + * Creates a plain object from a BoolValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.BoolValue} message BoolValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BoolValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = false; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; + + /** + * Converts this BoolValue to JSON. + * @function toJSON + * @memberof google.protobuf.BoolValue + * @instance + * @returns {Object.} JSON object + */ + BoolValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return BoolValue; + })(); + + protobuf.StringValue = (function() { + + /** + * Properties of a StringValue. + * @memberof google.protobuf + * @interface IStringValue + * @property {string|null} [value] StringValue value + */ + + /** + * Constructs a new StringValue. + * @memberof google.protobuf + * @classdesc Represents a StringValue. + * @implements IStringValue + * @constructor + * @param {google.protobuf.IStringValue=} [properties] Properties to set + */ + function StringValue(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]]; + } + + /** + * StringValue value. + * @member {string} value + * @memberof google.protobuf.StringValue + * @instance + */ + StringValue.prototype.value = ""; + + /** + * Creates a new StringValue instance using the specified properties. + * @function create + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue=} [properties] Properties to set + * @returns {google.protobuf.StringValue} StringValue instance + */ + StringValue.create = function create(properties) { + return new StringValue(properties); + }; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue} message StringValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringValue.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 StringValue message, length delimited. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue} message StringValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.StringValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.StringValue} StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringValue.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.StringValue(); + 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 StringValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.StringValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.StringValue} StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StringValue message. + * @function verify + * @memberof google.protobuf.StringValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StringValue.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 StringValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.StringValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.StringValue} StringValue + */ + StringValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.StringValue) + return object; + var message = new $root.google.protobuf.StringValue(); + if (object.value != null) + message.value = String(object.value); + return message; + }; + + /** + * Creates a plain object from a StringValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.StringValue} message StringValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StringValue.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 StringValue to JSON. + * @function toJSON + * @memberof google.protobuf.StringValue + * @instance + * @returns {Object.} JSON object + */ + StringValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return StringValue; + })(); + + protobuf.BytesValue = (function() { + + /** + * Properties of a BytesValue. + * @memberof google.protobuf + * @interface IBytesValue + * @property {Uint8Array|null} [value] BytesValue value + */ + + /** + * Constructs a new BytesValue. + * @memberof google.protobuf + * @classdesc Represents a BytesValue. + * @implements IBytesValue + * @constructor + * @param {google.protobuf.IBytesValue=} [properties] Properties to set + */ + function BytesValue(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]]; + } + + /** + * BytesValue value. + * @member {Uint8Array} value + * @memberof google.protobuf.BytesValue + * @instance + */ + BytesValue.prototype.value = $util.newBuffer([]); + + /** + * Creates a new BytesValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue=} [properties] Properties to set + * @returns {google.protobuf.BytesValue} BytesValue instance + */ + BytesValue.create = function create(properties) { + return new BytesValue(properties); + }; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue} message BytesValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BytesValue.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).bytes(message.value); + return writer; + }; + + /** + * Encodes the specified BytesValue message, length delimited. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue} message BytesValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BytesValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BytesValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.BytesValue} BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BytesValue.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.BytesValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.value = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BytesValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.BytesValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.BytesValue} BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BytesValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BytesValue message. + * @function verify + * @memberof google.protobuf.BytesValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BytesValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) + return "value: buffer expected"; + return null; + }; + + /** + * Creates a BytesValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.BytesValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.BytesValue} BytesValue + */ + BytesValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.BytesValue) + return object; + var message = new $root.google.protobuf.BytesValue(); + if (object.value != null) + if (typeof object.value === "string") + $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); + else if (object.value.length >= 0) + message.value = object.value; + return message; + }; + + /** + * Creates a plain object from a BytesValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.BytesValue} message BytesValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BytesValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if (options.bytes === String) + object.value = ""; + else { + object.value = []; + if (options.bytes !== Array) + object.value = $util.newBuffer(object.value); + } + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; + return object; + }; + + /** + * Converts this BytesValue to JSON. + * @function toJSON + * @memberof google.protobuf.BytesValue + * @instance + * @returns {Object.} JSON object + */ + BytesValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return BytesValue; + })(); + + protobuf.Struct = (function() { + + /** + * Properties of a Struct. + * @memberof google.protobuf + * @interface IStruct + * @property {Object.|null} [fields] Struct fields + */ + + /** + * Constructs a new Struct. + * @memberof google.protobuf + * @classdesc Represents a Struct. + * @implements IStruct + * @constructor + * @param {google.protobuf.IStruct=} [properties] Properties to set + */ + function Struct(properties) { + this.fields = {}; + 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]]; + } + + /** + * Struct fields. + * @member {Object.} fields + * @memberof google.protobuf.Struct + * @instance + */ + Struct.prototype.fields = $util.emptyObject; + + /** + * Creates a new Struct instance using the specified properties. + * @function create + * @memberof google.protobuf.Struct + * @static + * @param {google.protobuf.IStruct=} [properties] Properties to set + * @returns {google.protobuf.Struct} Struct instance + */ + Struct.create = function create(properties) { + return new Struct(properties); + }; + + /** + * Encodes the specified Struct message. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Struct + * @static + * @param {google.protobuf.IStruct} message Struct message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Struct.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fields != null && Object.hasOwnProperty.call(message, "fields")) + for (var keys = Object.keys(message.fields), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.protobuf.Value.encode(message.fields[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + return writer; + }; + + /** + * Encodes the specified Struct message, length delimited. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Struct + * @static + * @param {google.protobuf.IStruct} message Struct message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Struct.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Struct message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Struct + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Struct} Struct + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Struct.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.Struct(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (message.fields === $util.emptyObject) + message.fields = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.protobuf.Value.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.fields[key] = value; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Struct message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Struct + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Struct} Struct + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Struct.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Struct message. + * @function verify + * @memberof google.protobuf.Struct + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Struct.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.fields != null && message.hasOwnProperty("fields")) { + if (!$util.isObject(message.fields)) + return "fields: object expected"; + var key = Object.keys(message.fields); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.protobuf.Value.verify(message.fields[key[i]]); + if (error) + return "fields." + error; + } + } + return null; + }; + + /** + * Creates a Struct message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Struct + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Struct} Struct + */ + Struct.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Struct) + return object; + var message = new $root.google.protobuf.Struct(); + if (object.fields) { + if (typeof object.fields !== "object") + throw TypeError(".google.protobuf.Struct.fields: object expected"); + message.fields = {}; + for (var keys = Object.keys(object.fields), i = 0; i < keys.length; ++i) { + if (typeof object.fields[keys[i]] !== "object") + throw TypeError(".google.protobuf.Struct.fields: object expected"); + message.fields[keys[i]] = $root.google.protobuf.Value.fromObject(object.fields[keys[i]]); + } + } + return message; + }; + + /** + * Creates a plain object from a Struct message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Struct + * @static + * @param {google.protobuf.Struct} message Struct + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Struct.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.fields = {}; + var keys2; + if (message.fields && (keys2 = Object.keys(message.fields)).length) { + object.fields = {}; + for (var j = 0; j < keys2.length; ++j) + object.fields[keys2[j]] = $root.google.protobuf.Value.toObject(message.fields[keys2[j]], options); + } + return object; + }; + + /** + * Converts this Struct to JSON. + * @function toJSON + * @memberof google.protobuf.Struct + * @instance + * @returns {Object.} JSON object + */ + Struct.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Struct; + })(); + + protobuf.Value = (function() { + + /** + * Properties of a Value. + * @memberof google.protobuf + * @interface IValue + * @property {google.protobuf.NullValue|null} [nullValue] Value nullValue + * @property {number|null} [numberValue] Value numberValue + * @property {string|null} [stringValue] Value stringValue + * @property {boolean|null} [boolValue] Value boolValue + * @property {google.protobuf.IStruct|null} [structValue] Value structValue + * @property {google.protobuf.IListValue|null} [listValue] Value listValue + */ + + /** + * Constructs a new Value. + * @memberof google.protobuf + * @classdesc Represents a Value. + * @implements IValue + * @constructor + * @param {google.protobuf.IValue=} [properties] Properties to set + */ + function Value(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]]; + } + + /** + * Value nullValue. + * @member {google.protobuf.NullValue} nullValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.nullValue = 0; + + /** + * Value numberValue. + * @member {number} numberValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.numberValue = 0; + + /** + * Value stringValue. + * @member {string} stringValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.stringValue = ""; + + /** + * Value boolValue. + * @member {boolean} boolValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.boolValue = false; + + /** + * Value structValue. + * @member {google.protobuf.IStruct|null|undefined} structValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.structValue = null; + + /** + * Value listValue. + * @member {google.protobuf.IListValue|null|undefined} listValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.listValue = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Value kind. + * @member {"nullValue"|"numberValue"|"stringValue"|"boolValue"|"structValue"|"listValue"|undefined} kind + * @memberof google.protobuf.Value + * @instance + */ + Object.defineProperty(Value.prototype, "kind", { + get: $util.oneOfGetter($oneOfFields = ["nullValue", "numberValue", "stringValue", "boolValue", "structValue", "listValue"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Value + * @static + * @param {google.protobuf.IValue=} [properties] Properties to set + * @returns {google.protobuf.Value} Value instance + */ + Value.create = function create(properties) { + return new Value(properties); + }; + + /** + * Encodes the specified Value message. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Value + * @static + * @param {google.protobuf.IValue} message Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.nullValue != null && Object.hasOwnProperty.call(message, "nullValue")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.nullValue); + if (message.numberValue != null && Object.hasOwnProperty.call(message, "numberValue")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.numberValue); + if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.stringValue); + if (message.boolValue != null && Object.hasOwnProperty.call(message, "boolValue")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.boolValue); + if (message.structValue != null && Object.hasOwnProperty.call(message, "structValue")) + $root.google.protobuf.Struct.encode(message.structValue, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.listValue != null && Object.hasOwnProperty.call(message, "listValue")) + $root.google.protobuf.ListValue.encode(message.listValue, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Value message, length delimited. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Value + * @static + * @param {google.protobuf.IValue} message Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Value} Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Value.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.Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.nullValue = reader.int32(); + break; + case 2: + message.numberValue = reader.double(); + break; + case 3: + message.stringValue = reader.string(); + break; + case 4: + message.boolValue = reader.bool(); + break; + case 5: + message.structValue = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + case 6: + message.listValue = $root.google.protobuf.ListValue.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Value} Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Value message. + * @function verify + * @memberof google.protobuf.Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.nullValue != null && message.hasOwnProperty("nullValue")) { + properties.kind = 1; + switch (message.nullValue) { + default: + return "nullValue: enum value expected"; + case 0: + break; + } + } + if (message.numberValue != null && message.hasOwnProperty("numberValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + if (typeof message.numberValue !== "number") + return "numberValue: number expected"; + } + if (message.stringValue != null && message.hasOwnProperty("stringValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + if (!$util.isString(message.stringValue)) + return "stringValue: string expected"; + } + if (message.boolValue != null && message.hasOwnProperty("boolValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + if (typeof message.boolValue !== "boolean") + return "boolValue: boolean expected"; + } + if (message.structValue != null && message.hasOwnProperty("structValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + var error = $root.google.protobuf.Struct.verify(message.structValue); + if (error) + return "structValue." + error; + } + } + if (message.listValue != null && message.hasOwnProperty("listValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + var error = $root.google.protobuf.ListValue.verify(message.listValue); + if (error) + return "listValue." + error; + } + } + return null; + }; + + /** + * Creates a Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Value} Value + */ + Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Value) + return object; + var message = new $root.google.protobuf.Value(); + switch (object.nullValue) { + case "NULL_VALUE": + case 0: + message.nullValue = 0; + break; + } + if (object.numberValue != null) + message.numberValue = Number(object.numberValue); + if (object.stringValue != null) + message.stringValue = String(object.stringValue); + if (object.boolValue != null) + message.boolValue = Boolean(object.boolValue); + if (object.structValue != null) { + if (typeof object.structValue !== "object") + throw TypeError(".google.protobuf.Value.structValue: object expected"); + message.structValue = $root.google.protobuf.Struct.fromObject(object.structValue); + } + if (object.listValue != null) { + if (typeof object.listValue !== "object") + throw TypeError(".google.protobuf.Value.listValue: object expected"); + message.listValue = $root.google.protobuf.ListValue.fromObject(object.listValue); + } + return message; + }; + + /** + * Creates a plain object from a Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Value + * @static + * @param {google.protobuf.Value} message Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Value.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.nullValue != null && message.hasOwnProperty("nullValue")) { + object.nullValue = options.enums === String ? $root.google.protobuf.NullValue[message.nullValue] : message.nullValue; + if (options.oneofs) + object.kind = "nullValue"; + } + if (message.numberValue != null && message.hasOwnProperty("numberValue")) { + object.numberValue = options.json && !isFinite(message.numberValue) ? String(message.numberValue) : message.numberValue; + if (options.oneofs) + object.kind = "numberValue"; + } + if (message.stringValue != null && message.hasOwnProperty("stringValue")) { + object.stringValue = message.stringValue; + if (options.oneofs) + object.kind = "stringValue"; + } + if (message.boolValue != null && message.hasOwnProperty("boolValue")) { + object.boolValue = message.boolValue; + if (options.oneofs) + object.kind = "boolValue"; + } + if (message.structValue != null && message.hasOwnProperty("structValue")) { + object.structValue = $root.google.protobuf.Struct.toObject(message.structValue, options); + if (options.oneofs) + object.kind = "structValue"; + } + if (message.listValue != null && message.hasOwnProperty("listValue")) { + object.listValue = $root.google.protobuf.ListValue.toObject(message.listValue, options); + if (options.oneofs) + object.kind = "listValue"; + } + return object; + }; + + /** + * Converts this Value to JSON. + * @function toJSON + * @memberof google.protobuf.Value + * @instance + * @returns {Object.} JSON object + */ + Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Value; + })(); + + /** + * NullValue enum. + * @name google.protobuf.NullValue + * @enum {number} + * @property {number} NULL_VALUE=0 NULL_VALUE value + */ + protobuf.NullValue = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NULL_VALUE"] = 0; + return values; + })(); + + protobuf.ListValue = (function() { + + /** + * Properties of a ListValue. + * @memberof google.protobuf + * @interface IListValue + * @property {Array.|null} [values] ListValue values + */ + + /** + * Constructs a new ListValue. + * @memberof google.protobuf + * @classdesc Represents a ListValue. + * @implements IListValue + * @constructor + * @param {google.protobuf.IListValue=} [properties] Properties to set + */ + function ListValue(properties) { + this.values = []; + 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]]; + } + + /** + * ListValue values. + * @member {Array.} values + * @memberof google.protobuf.ListValue + * @instance + */ + ListValue.prototype.values = $util.emptyArray; + + /** + * Creates a new ListValue instance using the specified properties. + * @function create + * @memberof google.protobuf.ListValue + * @static + * @param {google.protobuf.IListValue=} [properties] Properties to set + * @returns {google.protobuf.ListValue} ListValue instance + */ + ListValue.create = function create(properties) { + return new ListValue(properties); + }; + + /** + * Encodes the specified ListValue message. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ListValue + * @static + * @param {google.protobuf.IListValue} message ListValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.values != null && message.values.length) + for (var i = 0; i < message.values.length; ++i) + $root.google.protobuf.Value.encode(message.values[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ListValue message, length delimited. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ListValue + * @static + * @param {google.protobuf.IListValue} message ListValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ListValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ListValue} ListValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListValue.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.ListValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.values && message.values.length)) + message.values = []; + message.values.push($root.google.protobuf.Value.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ListValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ListValue} ListValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListValue message. + * @function verify + * @memberof google.protobuf.ListValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.values != null && message.hasOwnProperty("values")) { + if (!Array.isArray(message.values)) + return "values: array expected"; + for (var i = 0; i < message.values.length; ++i) { + var error = $root.google.protobuf.Value.verify(message.values[i]); + if (error) + return "values." + error; + } + } + return null; + }; + + /** + * Creates a ListValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ListValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ListValue} ListValue + */ + ListValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ListValue) + return object; + var message = new $root.google.protobuf.ListValue(); + if (object.values) { + if (!Array.isArray(object.values)) + throw TypeError(".google.protobuf.ListValue.values: array expected"); + message.values = []; + for (var i = 0; i < object.values.length; ++i) { + if (typeof object.values[i] !== "object") + throw TypeError(".google.protobuf.ListValue.values: object expected"); + message.values[i] = $root.google.protobuf.Value.fromObject(object.values[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ListValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ListValue + * @static + * @param {google.protobuf.ListValue} message ListValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.values = []; + if (message.values && message.values.length) { + object.values = []; + for (var j = 0; j < message.values.length; ++j) + object.values[j] = $root.google.protobuf.Value.toObject(message.values[j], options); + } + return object; + }; + + /** + * Converts this ListValue to JSON. + * @function toJSON + * @memberof google.protobuf.ListValue + * @instance + * @returns {Object.} JSON object + */ + ListValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListValue; + })(); + + protobuf.Timestamp = (function() { + + /** + * Properties of a Timestamp. + * @memberof google.protobuf + * @interface ITimestamp + * @property {number|Long|null} [seconds] Timestamp seconds + * @property {number|null} [nanos] Timestamp nanos + */ + + /** + * Constructs a new Timestamp. + * @memberof google.protobuf + * @classdesc Represents a Timestamp. + * @implements ITimestamp + * @constructor + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + */ + function Timestamp(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]]; + } + + /** + * Timestamp seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Timestamp nanos. + * @member {number} nanos + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.nanos = 0; + + /** + * Creates a new Timestamp instance using the specified properties. + * @function create + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + * @returns {google.protobuf.Timestamp} Timestamp instance + */ + Timestamp.create = function create(properties) { + return new Timestamp(properties); + }; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.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.Timestamp(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.seconds = reader.int64(); + break; + case 2: + message.nanos = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Timestamp message. + * @function verify + * @memberof google.protobuf.Timestamp + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Timestamp.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) + return "seconds: integer|Long expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Timestamp + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Timestamp} Timestamp + */ + Timestamp.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Timestamp) + return object; + var message = new $root.google.protobuf.Timestamp(); + if (object.seconds != null) + if ($util.Long) + (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; + else if (typeof object.seconds === "string") + message.seconds = parseInt(object.seconds, 10); + else if (typeof object.seconds === "number") + message.seconds = object.seconds; + else if (typeof object.seconds === "object") + message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.Timestamp} message Timestamp + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Timestamp.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.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.seconds = options.longs === String ? "0" : 0; + object.nanos = 0; + } + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (typeof message.seconds === "number") + object.seconds = options.longs === String ? String(message.seconds) : message.seconds; + else + object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * Converts this Timestamp to JSON. + * @function toJSON + * @memberof google.protobuf.Timestamp + * @instance + * @returns {Object.} JSON object + */ + Timestamp.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Timestamp; + })(); + + return protobuf; + })(); + + return google; +})(); + +module.exports = $root; diff --git a/packages/dapi-grpc/clients/drive/v0/nodejs/drive_protoc.js b/packages/dapi-grpc/clients/drive/v0/nodejs/drive_protoc.js new file mode 100644 index 00000000000..041dacca666 --- /dev/null +++ b/packages/dapi-grpc/clients/drive/v0/nodejs/drive_protoc.js @@ -0,0 +1,420 @@ +// source: drive.proto +/** + * @fileoverview + * @enhanceable + * @suppress {missingRequire} reports error on implicit type usages. + * @suppress {messageConventions} JS Compiler reports an error if a variable or + * field starts with 'MSG_' and isn't a translatable message. + * @public + */ +// GENERATED CODE -- DO NOT EDIT! +/* eslint-disable */ +// @ts-nocheck + +var jspb = require('google-protobuf'); +var goog = jspb; +const proto = {}; + +var platform_pb = require('./platform_pb.js'); +goog.object.extend(proto, platform_pb); +goog.exportSymbol('proto.org.dash.platform.drive.v0.GetProofsRequest', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.drive.v0.GetProofsResponse', null, { proto }); +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.org.dash.platform.drive.v0.GetProofsRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.org.dash.platform.drive.v0.GetProofsRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.org.dash.platform.drive.v0.GetProofsRequest.displayName = 'proto.org.dash.platform.drive.v0.GetProofsRequest'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.org.dash.platform.drive.v0.GetProofsResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.org.dash.platform.drive.v0.GetProofsResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.org.dash.platform.drive.v0.GetProofsResponse.displayName = 'proto.org.dash.platform.drive.v0.GetProofsResponse'; +} + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.org.dash.platform.drive.v0.GetProofsRequest.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.drive.v0.GetProofsRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.org.dash.platform.drive.v0.GetProofsRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.drive.v0.GetProofsRequest.toObject = function(includeInstance, msg) { + var f, obj = { + stateTransition: msg.getStateTransition_asB64() + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.org.dash.platform.drive.v0.GetProofsRequest} + */ +proto.org.dash.platform.drive.v0.GetProofsRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.org.dash.platform.drive.v0.GetProofsRequest; + return proto.org.dash.platform.drive.v0.GetProofsRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.org.dash.platform.drive.v0.GetProofsRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.org.dash.platform.drive.v0.GetProofsRequest} + */ +proto.org.dash.platform.drive.v0.GetProofsRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setStateTransition(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.org.dash.platform.drive.v0.GetProofsRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.drive.v0.GetProofsRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.org.dash.platform.drive.v0.GetProofsRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.drive.v0.GetProofsRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getStateTransition_asU8(); + if (f.length > 0) { + writer.writeBytes( + 1, + f + ); + } +}; + + +/** + * optional bytes state_transition = 1; + * @return {string} + */ +proto.org.dash.platform.drive.v0.GetProofsRequest.prototype.getStateTransition = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * optional bytes state_transition = 1; + * This is a type-conversion wrapper around `getStateTransition()` + * @return {string} + */ +proto.org.dash.platform.drive.v0.GetProofsRequest.prototype.getStateTransition_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getStateTransition())); +}; + + +/** + * optional bytes state_transition = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getStateTransition()` + * @return {!Uint8Array} + */ +proto.org.dash.platform.drive.v0.GetProofsRequest.prototype.getStateTransition_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getStateTransition())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.org.dash.platform.drive.v0.GetProofsRequest} returns this + */ +proto.org.dash.platform.drive.v0.GetProofsRequest.prototype.setStateTransition = function(value) { + return jspb.Message.setProto3BytesField(this, 1, value); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.org.dash.platform.drive.v0.GetProofsResponse.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.drive.v0.GetProofsResponse.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.org.dash.platform.drive.v0.GetProofsResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.drive.v0.GetProofsResponse.toObject = function(includeInstance, msg) { + var f, obj = { + proof: (f = msg.getProof()) && platform_pb.Proof.toObject(includeInstance, f), + metadata: (f = msg.getMetadata()) && platform_pb.ResponseMetadata.toObject(includeInstance, f) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.org.dash.platform.drive.v0.GetProofsResponse} + */ +proto.org.dash.platform.drive.v0.GetProofsResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.org.dash.platform.drive.v0.GetProofsResponse; + return proto.org.dash.platform.drive.v0.GetProofsResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.org.dash.platform.drive.v0.GetProofsResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.org.dash.platform.drive.v0.GetProofsResponse} + */ +proto.org.dash.platform.drive.v0.GetProofsResponse.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new platform_pb.Proof; + reader.readMessage(value,platform_pb.Proof.deserializeBinaryFromReader); + msg.setProof(value); + break; + case 2: + var value = new platform_pb.ResponseMetadata; + reader.readMessage(value,platform_pb.ResponseMetadata.deserializeBinaryFromReader); + msg.setMetadata(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.org.dash.platform.drive.v0.GetProofsResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.drive.v0.GetProofsResponse.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.org.dash.platform.drive.v0.GetProofsResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.drive.v0.GetProofsResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getProof(); + if (f != null) { + writer.writeMessage( + 1, + f, + platform_pb.Proof.serializeBinaryToWriter + ); + } + f = message.getMetadata(); + if (f != null) { + writer.writeMessage( + 2, + f, + platform_pb.ResponseMetadata.serializeBinaryToWriter + ); + } +}; + + +/** + * optional org.dash.platform.dapi.v0.Proof proof = 1; + * @return {?proto.org.dash.platform.dapi.v0.Proof} + */ +proto.org.dash.platform.drive.v0.GetProofsResponse.prototype.getProof = function() { + return /** @type{?proto.org.dash.platform.dapi.v0.Proof} */ ( + jspb.Message.getWrapperField(this, platform_pb.Proof, 1)); +}; + + +/** + * @param {?proto.org.dash.platform.dapi.v0.Proof|undefined} value + * @return {!proto.org.dash.platform.drive.v0.GetProofsResponse} returns this +*/ +proto.org.dash.platform.drive.v0.GetProofsResponse.prototype.setProof = function(value) { + return jspb.Message.setWrapperField(this, 1, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.org.dash.platform.drive.v0.GetProofsResponse} returns this + */ +proto.org.dash.platform.drive.v0.GetProofsResponse.prototype.clearProof = function() { + return this.setProof(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.drive.v0.GetProofsResponse.prototype.hasProof = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * optional org.dash.platform.dapi.v0.ResponseMetadata metadata = 2; + * @return {?proto.org.dash.platform.dapi.v0.ResponseMetadata} + */ +proto.org.dash.platform.drive.v0.GetProofsResponse.prototype.getMetadata = function() { + return /** @type{?proto.org.dash.platform.dapi.v0.ResponseMetadata} */ ( + jspb.Message.getWrapperField(this, platform_pb.ResponseMetadata, 2)); +}; + + +/** + * @param {?proto.org.dash.platform.dapi.v0.ResponseMetadata|undefined} value + * @return {!proto.org.dash.platform.drive.v0.GetProofsResponse} returns this +*/ +proto.org.dash.platform.drive.v0.GetProofsResponse.prototype.setMetadata = function(value) { + return jspb.Message.setWrapperField(this, 2, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.org.dash.platform.drive.v0.GetProofsResponse} returns this + */ +proto.org.dash.platform.drive.v0.GetProofsResponse.prototype.clearMetadata = function() { + return this.setMetadata(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.drive.v0.GetProofsResponse.prototype.hasMetadata = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +goog.object.extend(exports, proto.org.dash.platform.drive.v0); diff --git a/packages/dapi-grpc/clients/drive/v0/web/drive_pb.d.ts b/packages/dapi-grpc/clients/drive/v0/web/drive_pb.d.ts new file mode 100644 index 00000000000..a1225a6bc4d --- /dev/null +++ b/packages/dapi-grpc/clients/drive/v0/web/drive_pb.d.ts @@ -0,0 +1,56 @@ +// package: org.dash.platform.drive.v0 +// file: drive.proto + +import * as jspb from "google-protobuf"; +import * as platform_pb from "./platform_pb"; + +export class GetProofsRequest extends jspb.Message { + getStateTransition(): Uint8Array | string; + getStateTransition_asU8(): Uint8Array; + getStateTransition_asB64(): string; + setStateTransition(value: Uint8Array | string): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): GetProofsRequest.AsObject; + static toObject(includeInstance: boolean, msg: GetProofsRequest): GetProofsRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: GetProofsRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): GetProofsRequest; + static deserializeBinaryFromReader(message: GetProofsRequest, reader: jspb.BinaryReader): GetProofsRequest; +} + +export namespace GetProofsRequest { + export type AsObject = { + stateTransition: Uint8Array | string, + } +} + +export class GetProofsResponse extends jspb.Message { + hasProof(): boolean; + clearProof(): void; + getProof(): platform_pb.Proof | undefined; + setProof(value?: platform_pb.Proof): void; + + hasMetadata(): boolean; + clearMetadata(): void; + getMetadata(): platform_pb.ResponseMetadata | undefined; + setMetadata(value?: platform_pb.ResponseMetadata): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): GetProofsResponse.AsObject; + static toObject(includeInstance: boolean, msg: GetProofsResponse): GetProofsResponse.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: GetProofsResponse, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): GetProofsResponse; + static deserializeBinaryFromReader(message: GetProofsResponse, reader: jspb.BinaryReader): GetProofsResponse; +} + +export namespace GetProofsResponse { + export type AsObject = { + proof?: platform_pb.Proof.AsObject, + metadata?: platform_pb.ResponseMetadata.AsObject, + } +} + diff --git a/packages/dapi-grpc/clients/drive/v0/web/drive_pb.js b/packages/dapi-grpc/clients/drive/v0/web/drive_pb.js new file mode 100644 index 00000000000..041dacca666 --- /dev/null +++ b/packages/dapi-grpc/clients/drive/v0/web/drive_pb.js @@ -0,0 +1,420 @@ +// source: drive.proto +/** + * @fileoverview + * @enhanceable + * @suppress {missingRequire} reports error on implicit type usages. + * @suppress {messageConventions} JS Compiler reports an error if a variable or + * field starts with 'MSG_' and isn't a translatable message. + * @public + */ +// GENERATED CODE -- DO NOT EDIT! +/* eslint-disable */ +// @ts-nocheck + +var jspb = require('google-protobuf'); +var goog = jspb; +const proto = {}; + +var platform_pb = require('./platform_pb.js'); +goog.object.extend(proto, platform_pb); +goog.exportSymbol('proto.org.dash.platform.drive.v0.GetProofsRequest', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.drive.v0.GetProofsResponse', null, { proto }); +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.org.dash.platform.drive.v0.GetProofsRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.org.dash.platform.drive.v0.GetProofsRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.org.dash.platform.drive.v0.GetProofsRequest.displayName = 'proto.org.dash.platform.drive.v0.GetProofsRequest'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.org.dash.platform.drive.v0.GetProofsResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.org.dash.platform.drive.v0.GetProofsResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.org.dash.platform.drive.v0.GetProofsResponse.displayName = 'proto.org.dash.platform.drive.v0.GetProofsResponse'; +} + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.org.dash.platform.drive.v0.GetProofsRequest.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.drive.v0.GetProofsRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.org.dash.platform.drive.v0.GetProofsRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.drive.v0.GetProofsRequest.toObject = function(includeInstance, msg) { + var f, obj = { + stateTransition: msg.getStateTransition_asB64() + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.org.dash.platform.drive.v0.GetProofsRequest} + */ +proto.org.dash.platform.drive.v0.GetProofsRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.org.dash.platform.drive.v0.GetProofsRequest; + return proto.org.dash.platform.drive.v0.GetProofsRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.org.dash.platform.drive.v0.GetProofsRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.org.dash.platform.drive.v0.GetProofsRequest} + */ +proto.org.dash.platform.drive.v0.GetProofsRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setStateTransition(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.org.dash.platform.drive.v0.GetProofsRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.drive.v0.GetProofsRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.org.dash.platform.drive.v0.GetProofsRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.drive.v0.GetProofsRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getStateTransition_asU8(); + if (f.length > 0) { + writer.writeBytes( + 1, + f + ); + } +}; + + +/** + * optional bytes state_transition = 1; + * @return {string} + */ +proto.org.dash.platform.drive.v0.GetProofsRequest.prototype.getStateTransition = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * optional bytes state_transition = 1; + * This is a type-conversion wrapper around `getStateTransition()` + * @return {string} + */ +proto.org.dash.platform.drive.v0.GetProofsRequest.prototype.getStateTransition_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getStateTransition())); +}; + + +/** + * optional bytes state_transition = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getStateTransition()` + * @return {!Uint8Array} + */ +proto.org.dash.platform.drive.v0.GetProofsRequest.prototype.getStateTransition_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getStateTransition())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.org.dash.platform.drive.v0.GetProofsRequest} returns this + */ +proto.org.dash.platform.drive.v0.GetProofsRequest.prototype.setStateTransition = function(value) { + return jspb.Message.setProto3BytesField(this, 1, value); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.org.dash.platform.drive.v0.GetProofsResponse.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.drive.v0.GetProofsResponse.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.org.dash.platform.drive.v0.GetProofsResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.drive.v0.GetProofsResponse.toObject = function(includeInstance, msg) { + var f, obj = { + proof: (f = msg.getProof()) && platform_pb.Proof.toObject(includeInstance, f), + metadata: (f = msg.getMetadata()) && platform_pb.ResponseMetadata.toObject(includeInstance, f) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.org.dash.platform.drive.v0.GetProofsResponse} + */ +proto.org.dash.platform.drive.v0.GetProofsResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.org.dash.platform.drive.v0.GetProofsResponse; + return proto.org.dash.platform.drive.v0.GetProofsResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.org.dash.platform.drive.v0.GetProofsResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.org.dash.platform.drive.v0.GetProofsResponse} + */ +proto.org.dash.platform.drive.v0.GetProofsResponse.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new platform_pb.Proof; + reader.readMessage(value,platform_pb.Proof.deserializeBinaryFromReader); + msg.setProof(value); + break; + case 2: + var value = new platform_pb.ResponseMetadata; + reader.readMessage(value,platform_pb.ResponseMetadata.deserializeBinaryFromReader); + msg.setMetadata(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.org.dash.platform.drive.v0.GetProofsResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.drive.v0.GetProofsResponse.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.org.dash.platform.drive.v0.GetProofsResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.drive.v0.GetProofsResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getProof(); + if (f != null) { + writer.writeMessage( + 1, + f, + platform_pb.Proof.serializeBinaryToWriter + ); + } + f = message.getMetadata(); + if (f != null) { + writer.writeMessage( + 2, + f, + platform_pb.ResponseMetadata.serializeBinaryToWriter + ); + } +}; + + +/** + * optional org.dash.platform.dapi.v0.Proof proof = 1; + * @return {?proto.org.dash.platform.dapi.v0.Proof} + */ +proto.org.dash.platform.drive.v0.GetProofsResponse.prototype.getProof = function() { + return /** @type{?proto.org.dash.platform.dapi.v0.Proof} */ ( + jspb.Message.getWrapperField(this, platform_pb.Proof, 1)); +}; + + +/** + * @param {?proto.org.dash.platform.dapi.v0.Proof|undefined} value + * @return {!proto.org.dash.platform.drive.v0.GetProofsResponse} returns this +*/ +proto.org.dash.platform.drive.v0.GetProofsResponse.prototype.setProof = function(value) { + return jspb.Message.setWrapperField(this, 1, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.org.dash.platform.drive.v0.GetProofsResponse} returns this + */ +proto.org.dash.platform.drive.v0.GetProofsResponse.prototype.clearProof = function() { + return this.setProof(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.drive.v0.GetProofsResponse.prototype.hasProof = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * optional org.dash.platform.dapi.v0.ResponseMetadata metadata = 2; + * @return {?proto.org.dash.platform.dapi.v0.ResponseMetadata} + */ +proto.org.dash.platform.drive.v0.GetProofsResponse.prototype.getMetadata = function() { + return /** @type{?proto.org.dash.platform.dapi.v0.ResponseMetadata} */ ( + jspb.Message.getWrapperField(this, platform_pb.ResponseMetadata, 2)); +}; + + +/** + * @param {?proto.org.dash.platform.dapi.v0.ResponseMetadata|undefined} value + * @return {!proto.org.dash.platform.drive.v0.GetProofsResponse} returns this +*/ +proto.org.dash.platform.drive.v0.GetProofsResponse.prototype.setMetadata = function(value) { + return jspb.Message.setWrapperField(this, 2, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.org.dash.platform.drive.v0.GetProofsResponse} returns this + */ +proto.org.dash.platform.drive.v0.GetProofsResponse.prototype.clearMetadata = function() { + return this.setMetadata(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.drive.v0.GetProofsResponse.prototype.hasMetadata = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +goog.object.extend(exports, proto.org.dash.platform.drive.v0); diff --git a/packages/dapi-grpc/clients/drive/v0/web/drive_pb_service.d.ts b/packages/dapi-grpc/clients/drive/v0/web/drive_pb_service.d.ts new file mode 100644 index 00000000000..622cbe05034 --- /dev/null +++ b/packages/dapi-grpc/clients/drive/v0/web/drive_pb_service.d.ts @@ -0,0 +1,63 @@ +// package: org.dash.platform.drive.v0 +// file: drive.proto + +import * as drive_pb from "./drive_pb"; +import {grpc} from "@improbable-eng/grpc-web"; + +type DriveInternalgetProofs = { + readonly methodName: string; + readonly service: typeof DriveInternal; + readonly requestStream: false; + readonly responseStream: false; + readonly requestType: typeof drive_pb.GetProofsRequest; + readonly responseType: typeof drive_pb.GetProofsResponse; +}; + +export class DriveInternal { + static readonly serviceName: string; + static readonly getProofs: DriveInternalgetProofs; +} + +export type ServiceError = { message: string, code: number; metadata: grpc.Metadata } +export type Status = { details: string, code: number; metadata: grpc.Metadata } + +interface UnaryResponse { + cancel(): void; +} +interface ResponseStream { + cancel(): void; + on(type: 'data', handler: (message: T) => void): ResponseStream; + on(type: 'end', handler: (status?: Status) => void): ResponseStream; + on(type: 'status', handler: (status: Status) => void): ResponseStream; +} +interface RequestStream { + write(message: T): RequestStream; + end(): void; + cancel(): void; + on(type: 'end', handler: (status?: Status) => void): RequestStream; + on(type: 'status', handler: (status: Status) => void): RequestStream; +} +interface BidirectionalStream { + write(message: ReqT): BidirectionalStream; + end(): void; + cancel(): void; + on(type: 'data', handler: (message: ResT) => void): BidirectionalStream; + on(type: 'end', handler: (status?: Status) => void): BidirectionalStream; + on(type: 'status', handler: (status: Status) => void): BidirectionalStream; +} + +export class DriveInternalClient { + readonly serviceHost: string; + + constructor(serviceHost: string, options?: grpc.RpcOptions); + getProofs( + requestMessage: drive_pb.GetProofsRequest, + metadata: grpc.Metadata, + callback: (error: ServiceError|null, responseMessage: drive_pb.GetProofsResponse|null) => void + ): UnaryResponse; + getProofs( + requestMessage: drive_pb.GetProofsRequest, + callback: (error: ServiceError|null, responseMessage: drive_pb.GetProofsResponse|null) => void + ): UnaryResponse; +} + diff --git a/packages/dapi-grpc/clients/drive/v0/web/drive_pb_service.js b/packages/dapi-grpc/clients/drive/v0/web/drive_pb_service.js new file mode 100644 index 00000000000..fc572bf92ba --- /dev/null +++ b/packages/dapi-grpc/clients/drive/v0/web/drive_pb_service.js @@ -0,0 +1,61 @@ +// package: org.dash.platform.drive.v0 +// file: drive.proto + +var drive_pb = require("./drive_pb"); +var grpc = require("@improbable-eng/grpc-web").grpc; + +var DriveInternal = (function () { + function DriveInternal() {} + DriveInternal.serviceName = "org.dash.platform.drive.v0.DriveInternal"; + return DriveInternal; +}()); + +DriveInternal.getProofs = { + methodName: "getProofs", + service: DriveInternal, + requestStream: false, + responseStream: false, + requestType: drive_pb.GetProofsRequest, + responseType: drive_pb.GetProofsResponse +}; + +exports.DriveInternal = DriveInternal; + +function DriveInternalClient(serviceHost, options) { + this.serviceHost = serviceHost; + this.options = options || {}; +} + +DriveInternalClient.prototype.getProofs = function getProofs(requestMessage, metadata, callback) { + if (arguments.length === 2) { + callback = arguments[1]; + } + var client = grpc.unary(DriveInternal.getProofs, { + request: requestMessage, + host: this.serviceHost, + metadata: metadata, + transport: this.options.transport, + debug: this.options.debug, + onEnd: function (response) { + if (callback) { + if (response.status !== grpc.Code.OK) { + var err = new Error(response.statusMessage); + err.code = response.status; + err.metadata = response.trailers; + callback(err, null); + } else { + callback(null, response.message); + } + } + } + }); + return { + cancel: function () { + callback = null; + client.close(); + } + }; +}; + +exports.DriveInternalClient = DriveInternalClient; + diff --git a/packages/dapi-grpc/clients/platform/v0/java/org/dash/platform/dapi/v0/PlatformGrpc.java b/packages/dapi-grpc/clients/platform/v0/java/org/dash/platform/dapi/v0/PlatformGrpc.java index f0d139c5183..c5398563de4 100644 --- a/packages/dapi-grpc/clients/platform/v0/java/org/dash/platform/dapi/v0/PlatformGrpc.java +++ b/packages/dapi-grpc/clients/platform/v0/java/org/dash/platform/dapi/v0/PlatformGrpc.java @@ -356,37 +356,6 @@ org.dash.platform.dapi.v0.PlatformOuterClass.GetEvonodesProposedEpochBlocksRespo return getGetEvonodesProposedEpochBlocksByRangeMethod; } - private static volatile io.grpc.MethodDescriptor getGetProofsMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "getProofs", - requestType = org.dash.platform.dapi.v0.PlatformOuterClass.GetProofsRequest.class, - responseType = org.dash.platform.dapi.v0.PlatformOuterClass.GetProofsResponse.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getGetProofsMethod() { - io.grpc.MethodDescriptor getGetProofsMethod; - if ((getGetProofsMethod = PlatformGrpc.getGetProofsMethod) == null) { - synchronized (PlatformGrpc.class) { - if ((getGetProofsMethod = PlatformGrpc.getGetProofsMethod) == null) { - PlatformGrpc.getGetProofsMethod = getGetProofsMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "getProofs")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - org.dash.platform.dapi.v0.PlatformOuterClass.GetProofsRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - org.dash.platform.dapi.v0.PlatformOuterClass.GetProofsResponse.getDefaultInstance())) - .setSchemaDescriptor(new PlatformMethodDescriptorSupplier("getProofs")) - .build(); - } - } - } - return getGetProofsMethod; - } - private static volatile io.grpc.MethodDescriptor getGetDataContractMethod; @@ -1473,13 +1442,6 @@ public void getEvonodesProposedEpochBlocksByRange(org.dash.platform.dapi.v0.Plat io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetEvonodesProposedEpochBlocksByRangeMethod(), responseObserver); } - /** - */ - public void getProofs(org.dash.platform.dapi.v0.PlatformOuterClass.GetProofsRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetProofsMethod(), responseObserver); - } - /** */ public void getDataContract(org.dash.platform.dapi.v0.PlatformOuterClass.GetDataContractRequest request, @@ -1791,13 +1753,6 @@ public void getGroupActionSigners(org.dash.platform.dapi.v0.PlatformOuterClass.G org.dash.platform.dapi.v0.PlatformOuterClass.GetEvonodesProposedEpochBlocksByRangeRequest, org.dash.platform.dapi.v0.PlatformOuterClass.GetEvonodesProposedEpochBlocksResponse>( this, METHODID_GET_EVONODES_PROPOSED_EPOCH_BLOCKS_BY_RANGE))) - .addMethod( - getGetProofsMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - org.dash.platform.dapi.v0.PlatformOuterClass.GetProofsRequest, - org.dash.platform.dapi.v0.PlatformOuterClass.GetProofsResponse>( - this, METHODID_GET_PROOFS))) .addMethod( getGetDataContractMethod(), io.grpc.stub.ServerCalls.asyncUnaryCall( @@ -2121,14 +2076,6 @@ public void getEvonodesProposedEpochBlocksByRange(org.dash.platform.dapi.v0.Plat getChannel().newCall(getGetEvonodesProposedEpochBlocksByRangeMethod(), getCallOptions()), request, responseObserver); } - /** - */ - public void getProofs(org.dash.platform.dapi.v0.PlatformOuterClass.GetProofsRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getGetProofsMethod(), getCallOptions()), request, responseObserver); - } - /** */ public void getDataContract(org.dash.platform.dapi.v0.PlatformOuterClass.GetDataContractRequest request, @@ -2484,13 +2431,6 @@ public org.dash.platform.dapi.v0.PlatformOuterClass.GetEvonodesProposedEpochBloc getChannel(), getGetEvonodesProposedEpochBlocksByRangeMethod(), getCallOptions(), request); } - /** - */ - public org.dash.platform.dapi.v0.PlatformOuterClass.GetProofsResponse getProofs(org.dash.platform.dapi.v0.PlatformOuterClass.GetProofsRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getGetProofsMethod(), getCallOptions(), request); - } - /** */ public org.dash.platform.dapi.v0.PlatformOuterClass.GetDataContractResponse getDataContract(org.dash.platform.dapi.v0.PlatformOuterClass.GetDataContractRequest request) { @@ -2826,14 +2766,6 @@ public com.google.common.util.concurrent.ListenableFuture getProofs( - org.dash.platform.dapi.v0.PlatformOuterClass.GetProofsRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getGetProofsMethod(), getCallOptions()), request); - } - /** */ public com.google.common.util.concurrent.ListenableFuture getDataContract( @@ -3109,38 +3041,37 @@ public com.google.common.util.concurrent.ListenableFuture implements io.grpc.stub.ServerCalls.UnaryMethod, @@ -3203,10 +3134,6 @@ public void invoke(Req request, io.grpc.stub.StreamObserver responseObserv serviceImpl.getEvonodesProposedEpochBlocksByRange((org.dash.platform.dapi.v0.PlatformOuterClass.GetEvonodesProposedEpochBlocksByRangeRequest) request, (io.grpc.stub.StreamObserver) responseObserver); break; - case METHODID_GET_PROOFS: - serviceImpl.getProofs((org.dash.platform.dapi.v0.PlatformOuterClass.GetProofsRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; case METHODID_GET_DATA_CONTRACT: serviceImpl.getDataContract((org.dash.platform.dapi.v0.PlatformOuterClass.GetDataContractRequest) request, (io.grpc.stub.StreamObserver) responseObserver); @@ -3403,7 +3330,6 @@ public static io.grpc.ServiceDescriptor getServiceDescriptor() { .addMethod(getGetIdentityBalanceAndRevisionMethod()) .addMethod(getGetEvonodesProposedEpochBlocksByIdsMethod()) .addMethod(getGetEvonodesProposedEpochBlocksByRangeMethod()) - .addMethod(getGetProofsMethod()) .addMethod(getGetDataContractMethod()) .addMethod(getGetDataContractHistoryMethod()) .addMethod(getGetDataContractsMethod()) diff --git a/packages/dapi-grpc/clients/platform/v0/nodejs/PlatformPromiseClient.js b/packages/dapi-grpc/clients/platform/v0/nodejs/PlatformPromiseClient.js index a6190b4ac77..8a11e009c82 100644 --- a/packages/dapi-grpc/clients/platform/v0/nodejs/PlatformPromiseClient.js +++ b/packages/dapi-grpc/clients/platform/v0/nodejs/PlatformPromiseClient.js @@ -50,8 +50,6 @@ const { PBJSGetProtocolVersionUpgradeVoteStatusResponse, GetProtocolVersionUpgradeStateRequest: PBJSGetProtocolVersionUpgradeStateRequest, GetProtocolVersionUpgradeStateResponse: PBJSGetProtocolVersionUpgradeStateResponse, - GetProofsRequest: PBJSGetProofsRequest, - GetProofsResponse: PBJSGetProofsResponse, GetIdentityContractNonceRequest: PBJSGetIdentityContractNonceRequest, GetIdentityContractNonceResponse: PBJSGetIdentityContractNonceResponse, GetIdentityNonceRequest: PBJSGetIdentityNonceRequest, @@ -84,7 +82,6 @@ const { GetEpochsInfoResponse: ProtocGetEpochsInfoResponse, GetProtocolVersionUpgradeVoteStatusResponse: ProtocGetProtocolVersionUpgradeVoteStatusResponse, GetProtocolVersionUpgradeStateResponse: ProtocGetProtocolVersionUpgradeStateResponse, - GetProofsResponse: ProtocGetProofsResponse, GetIdentityContractNonceResponse: ProtocGetIdentityContractNonceResponse, GetIdentityNonceResponse: ProtocGetIdentityNonceResponse, GetIdentityKeysResponse: ProtocGetIdentityKeysResponse, @@ -165,10 +162,6 @@ class PlatformPromiseClient { this.client.getProtocolVersionUpgradeState.bind(this.client), ); - this.client.getProofs = promisify( - this.client.getProofs.bind(this.client), - ); - this.client.getIdentityContractNonce = promisify( this.client.getIdentityContractNonce.bind(this.client), ); @@ -586,38 +579,6 @@ class PlatformPromiseClient { ); } - /** - * - * @param {!GetProofsRequest} request - * @param {?Object} metadata - * @param {CallOptions} [options={}] - * @returns {Promise} - */ - getProofs(request, metadata = {}, options = {}) { - if (!isObject(metadata)) { - throw new Error('metadata must be an object'); - } - - return this.client.getProofs( - request, - convertObjectToMetadata(metadata), - { - interceptors: [ - jsonToProtobufInterceptorFactory( - jsonToProtobufFactory( - ProtocGetProofsResponse, - PBJSGetProofsResponse, - ), - protobufToJsonFactory( - PBJSGetProofsRequest, - ), - ), - ], - ...options, - }, - ); - } - /** * @param {!PBJSGetIdentityContractNonceRequest} getIdentityContractNonceRequest * @param {?Object} metadata diff --git a/packages/dapi-grpc/clients/platform/v0/nodejs/platform_pbjs.js b/packages/dapi-grpc/clients/platform/v0/nodejs/platform_pbjs.js index 6cf6ca064c2..8ea5da1ed09 100644 --- a/packages/dapi-grpc/clients/platform/v0/nodejs/platform_pbjs.js +++ b/packages/dapi-grpc/clients/platform/v0/nodejs/platform_pbjs.js @@ -449,39 +449,6 @@ $root.org = (function() { * @variation 2 */ - /** - * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getProofs}. - * @memberof org.dash.platform.dapi.v0.Platform - * @typedef getProofsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {org.dash.platform.dapi.v0.GetProofsResponse} [response] GetProofsResponse - */ - - /** - * Calls getProofs. - * @function getProofs - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetProofsRequest} request GetProofsRequest message or plain object - * @param {org.dash.platform.dapi.v0.Platform.getProofsCallback} callback Node-style callback called with the error, if any, and GetProofsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Platform.prototype.getProofs = function getProofs(request, callback) { - return this.rpcCall(getProofs, $root.org.dash.platform.dapi.v0.GetProofsRequest, $root.org.dash.platform.dapi.v0.GetProofsResponse, request, callback); - }, "name", { value: "getProofs" }); - - /** - * Calls getProofs. - * @function getProofs - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetProofsRequest} request GetProofsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - /** * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getDataContract}. * @memberof org.dash.platform.dapi.v0.Platform @@ -15001,3095 +14968,6 @@ $root.org = (function() { return GetIdentitiesBalancesResponse; })(); - v0.GetProofsRequest = (function() { - - /** - * Properties of a GetProofsRequest. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetProofsRequest - * @property {org.dash.platform.dapi.v0.GetProofsRequest.IGetProofsRequestV0|null} [v0] GetProofsRequest v0 - */ - - /** - * Constructs a new GetProofsRequest. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetProofsRequest. - * @implements IGetProofsRequest - * @constructor - * @param {org.dash.platform.dapi.v0.IGetProofsRequest=} [properties] Properties to set - */ - function GetProofsRequest(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]]; - } - - /** - * GetProofsRequest v0. - * @member {org.dash.platform.dapi.v0.GetProofsRequest.IGetProofsRequestV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetProofsRequest - * @instance - */ - GetProofsRequest.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetProofsRequest version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetProofsRequest - * @instance - */ - Object.defineProperty(GetProofsRequest.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetProofsRequest instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetProofsRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetProofsRequest=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetProofsRequest} GetProofsRequest instance - */ - GetProofsRequest.create = function create(properties) { - return new GetProofsRequest(properties); - }; - - /** - * Encodes the specified GetProofsRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetProofsRequest.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetProofsRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetProofsRequest} message GetProofsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetProofsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetProofsRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetProofsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetProofsRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetProofsRequest} message GetProofsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetProofsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetProofsRequest message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetProofsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetProofsRequest} GetProofsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetProofsRequest.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.org.dash.platform.dapi.v0.GetProofsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetProofsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetProofsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetProofsRequest} GetProofsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetProofsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetProofsRequest message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetProofsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetProofsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetProofsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetProofsRequest - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetProofsRequest} GetProofsRequest - */ - GetProofsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetProofsRequest) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetProofsRequest(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetProofsRequest.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetProofsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetProofsRequest - * @static - * @param {org.dash.platform.dapi.v0.GetProofsRequest} message GetProofsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetProofsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetProofsRequest to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetProofsRequest - * @instance - * @returns {Object.} JSON object - */ - GetProofsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetProofsRequest.GetProofsRequestV0 = (function() { - - /** - * Properties of a GetProofsRequestV0. - * @memberof org.dash.platform.dapi.v0.GetProofsRequest - * @interface IGetProofsRequestV0 - * @property {Array.|null} [identities] GetProofsRequestV0 identities - * @property {Array.|null} [contracts] GetProofsRequestV0 contracts - * @property {Array.|null} [documents] GetProofsRequestV0 documents - * @property {Array.|null} [votes] GetProofsRequestV0 votes - * @property {Array.|null} [identityTokenBalances] GetProofsRequestV0 identityTokenBalances - * @property {Array.|null} [identityTokenInfos] GetProofsRequestV0 identityTokenInfos - * @property {Array.|null} [tokenStatuses] GetProofsRequestV0 tokenStatuses - */ - - /** - * Constructs a new GetProofsRequestV0. - * @memberof org.dash.platform.dapi.v0.GetProofsRequest - * @classdesc Represents a GetProofsRequestV0. - * @implements IGetProofsRequestV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetProofsRequest.IGetProofsRequestV0=} [properties] Properties to set - */ - function GetProofsRequestV0(properties) { - this.identities = []; - this.contracts = []; - this.documents = []; - this.votes = []; - this.identityTokenBalances = []; - this.identityTokenInfos = []; - this.tokenStatuses = []; - 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]]; - } - - /** - * GetProofsRequestV0 identities. - * @member {Array.} identities - * @memberof org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0 - * @instance - */ - GetProofsRequestV0.prototype.identities = $util.emptyArray; - - /** - * GetProofsRequestV0 contracts. - * @member {Array.} contracts - * @memberof org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0 - * @instance - */ - GetProofsRequestV0.prototype.contracts = $util.emptyArray; - - /** - * GetProofsRequestV0 documents. - * @member {Array.} documents - * @memberof org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0 - * @instance - */ - GetProofsRequestV0.prototype.documents = $util.emptyArray; - - /** - * GetProofsRequestV0 votes. - * @member {Array.} votes - * @memberof org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0 - * @instance - */ - GetProofsRequestV0.prototype.votes = $util.emptyArray; - - /** - * GetProofsRequestV0 identityTokenBalances. - * @member {Array.} identityTokenBalances - * @memberof org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0 - * @instance - */ - GetProofsRequestV0.prototype.identityTokenBalances = $util.emptyArray; - - /** - * GetProofsRequestV0 identityTokenInfos. - * @member {Array.} identityTokenInfos - * @memberof org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0 - * @instance - */ - GetProofsRequestV0.prototype.identityTokenInfos = $util.emptyArray; - - /** - * GetProofsRequestV0 tokenStatuses. - * @member {Array.} tokenStatuses - * @memberof org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0 - * @instance - */ - GetProofsRequestV0.prototype.tokenStatuses = $util.emptyArray; - - /** - * Creates a new GetProofsRequestV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetProofsRequest.IGetProofsRequestV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0} GetProofsRequestV0 instance - */ - GetProofsRequestV0.create = function create(properties) { - return new GetProofsRequestV0(properties); - }; - - /** - * Encodes the specified GetProofsRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetProofsRequest.IGetProofsRequestV0} message GetProofsRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetProofsRequestV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.identities != null && message.identities.length) - for (var i = 0; i < message.identities.length; ++i) - $root.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityRequest.encode(message.identities[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.contracts != null && message.contracts.length) - for (var i = 0; i < message.contracts.length; ++i) - $root.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.ContractRequest.encode(message.contracts[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.documents != null && message.documents.length) - for (var i = 0; i < message.documents.length; ++i) - $root.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest.encode(message.documents[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.votes != null && message.votes.length) - for (var i = 0; i < message.votes.length; ++i) - $root.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.encode(message.votes[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.identityTokenBalances != null && message.identityTokenBalances.length) - for (var i = 0; i < message.identityTokenBalances.length; ++i) - $root.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenBalanceRequest.encode(message.identityTokenBalances[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.identityTokenInfos != null && message.identityTokenInfos.length) - for (var i = 0; i < message.identityTokenInfos.length; ++i) - $root.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenInfoRequest.encode(message.identityTokenInfos[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.tokenStatuses != null && message.tokenStatuses.length) - for (var i = 0; i < message.tokenStatuses.length; ++i) - $root.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.TokenStatusRequest.encode(message.tokenStatuses[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetProofsRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetProofsRequest.IGetProofsRequestV0} message GetProofsRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetProofsRequestV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetProofsRequestV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0} GetProofsRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetProofsRequestV0.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.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.identities && message.identities.length)) - message.identities = []; - message.identities.push($root.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityRequest.decode(reader, reader.uint32())); - break; - case 2: - if (!(message.contracts && message.contracts.length)) - message.contracts = []; - message.contracts.push($root.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.ContractRequest.decode(reader, reader.uint32())); - break; - case 3: - if (!(message.documents && message.documents.length)) - message.documents = []; - message.documents.push($root.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest.decode(reader, reader.uint32())); - break; - case 4: - if (!(message.votes && message.votes.length)) - message.votes = []; - message.votes.push($root.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.decode(reader, reader.uint32())); - break; - case 5: - if (!(message.identityTokenBalances && message.identityTokenBalances.length)) - message.identityTokenBalances = []; - message.identityTokenBalances.push($root.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenBalanceRequest.decode(reader, reader.uint32())); - break; - case 6: - if (!(message.identityTokenInfos && message.identityTokenInfos.length)) - message.identityTokenInfos = []; - message.identityTokenInfos.push($root.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenInfoRequest.decode(reader, reader.uint32())); - break; - case 7: - if (!(message.tokenStatuses && message.tokenStatuses.length)) - message.tokenStatuses = []; - message.tokenStatuses.push($root.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.TokenStatusRequest.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetProofsRequestV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0} GetProofsRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetProofsRequestV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetProofsRequestV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetProofsRequestV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.identities != null && message.hasOwnProperty("identities")) { - if (!Array.isArray(message.identities)) - return "identities: array expected"; - for (var i = 0; i < message.identities.length; ++i) { - var error = $root.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityRequest.verify(message.identities[i]); - if (error) - return "identities." + error; - } - } - if (message.contracts != null && message.hasOwnProperty("contracts")) { - if (!Array.isArray(message.contracts)) - return "contracts: array expected"; - for (var i = 0; i < message.contracts.length; ++i) { - var error = $root.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.ContractRequest.verify(message.contracts[i]); - if (error) - return "contracts." + error; - } - } - if (message.documents != null && message.hasOwnProperty("documents")) { - if (!Array.isArray(message.documents)) - return "documents: array expected"; - for (var i = 0; i < message.documents.length; ++i) { - var error = $root.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest.verify(message.documents[i]); - if (error) - return "documents." + error; - } - } - if (message.votes != null && message.hasOwnProperty("votes")) { - if (!Array.isArray(message.votes)) - return "votes: array expected"; - for (var i = 0; i < message.votes.length; ++i) { - var error = $root.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.verify(message.votes[i]); - if (error) - return "votes." + error; - } - } - if (message.identityTokenBalances != null && message.hasOwnProperty("identityTokenBalances")) { - if (!Array.isArray(message.identityTokenBalances)) - return "identityTokenBalances: array expected"; - for (var i = 0; i < message.identityTokenBalances.length; ++i) { - var error = $root.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenBalanceRequest.verify(message.identityTokenBalances[i]); - if (error) - return "identityTokenBalances." + error; - } - } - if (message.identityTokenInfos != null && message.hasOwnProperty("identityTokenInfos")) { - if (!Array.isArray(message.identityTokenInfos)) - return "identityTokenInfos: array expected"; - for (var i = 0; i < message.identityTokenInfos.length; ++i) { - var error = $root.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenInfoRequest.verify(message.identityTokenInfos[i]); - if (error) - return "identityTokenInfos." + error; - } - } - if (message.tokenStatuses != null && message.hasOwnProperty("tokenStatuses")) { - if (!Array.isArray(message.tokenStatuses)) - return "tokenStatuses: array expected"; - for (var i = 0; i < message.tokenStatuses.length; ++i) { - var error = $root.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.TokenStatusRequest.verify(message.tokenStatuses[i]); - if (error) - return "tokenStatuses." + error; - } - } - return null; - }; - - /** - * Creates a GetProofsRequestV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0} GetProofsRequestV0 - */ - GetProofsRequestV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0(); - if (object.identities) { - if (!Array.isArray(object.identities)) - throw TypeError(".org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.identities: array expected"); - message.identities = []; - for (var i = 0; i < object.identities.length; ++i) { - if (typeof object.identities[i] !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.identities: object expected"); - message.identities[i] = $root.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityRequest.fromObject(object.identities[i]); - } - } - if (object.contracts) { - if (!Array.isArray(object.contracts)) - throw TypeError(".org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.contracts: array expected"); - message.contracts = []; - for (var i = 0; i < object.contracts.length; ++i) { - if (typeof object.contracts[i] !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.contracts: object expected"); - message.contracts[i] = $root.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.ContractRequest.fromObject(object.contracts[i]); - } - } - if (object.documents) { - if (!Array.isArray(object.documents)) - throw TypeError(".org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.documents: array expected"); - message.documents = []; - for (var i = 0; i < object.documents.length; ++i) { - if (typeof object.documents[i] !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.documents: object expected"); - message.documents[i] = $root.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest.fromObject(object.documents[i]); - } - } - if (object.votes) { - if (!Array.isArray(object.votes)) - throw TypeError(".org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.votes: array expected"); - message.votes = []; - for (var i = 0; i < object.votes.length; ++i) { - if (typeof object.votes[i] !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.votes: object expected"); - message.votes[i] = $root.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.fromObject(object.votes[i]); - } - } - if (object.identityTokenBalances) { - if (!Array.isArray(object.identityTokenBalances)) - throw TypeError(".org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.identityTokenBalances: array expected"); - message.identityTokenBalances = []; - for (var i = 0; i < object.identityTokenBalances.length; ++i) { - if (typeof object.identityTokenBalances[i] !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.identityTokenBalances: object expected"); - message.identityTokenBalances[i] = $root.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenBalanceRequest.fromObject(object.identityTokenBalances[i]); - } - } - if (object.identityTokenInfos) { - if (!Array.isArray(object.identityTokenInfos)) - throw TypeError(".org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.identityTokenInfos: array expected"); - message.identityTokenInfos = []; - for (var i = 0; i < object.identityTokenInfos.length; ++i) { - if (typeof object.identityTokenInfos[i] !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.identityTokenInfos: object expected"); - message.identityTokenInfos[i] = $root.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenInfoRequest.fromObject(object.identityTokenInfos[i]); - } - } - if (object.tokenStatuses) { - if (!Array.isArray(object.tokenStatuses)) - throw TypeError(".org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.tokenStatuses: array expected"); - message.tokenStatuses = []; - for (var i = 0; i < object.tokenStatuses.length; ++i) { - if (typeof object.tokenStatuses[i] !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.tokenStatuses: object expected"); - message.tokenStatuses[i] = $root.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.TokenStatusRequest.fromObject(object.tokenStatuses[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a GetProofsRequestV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0} message GetProofsRequestV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetProofsRequestV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.identities = []; - object.contracts = []; - object.documents = []; - object.votes = []; - object.identityTokenBalances = []; - object.identityTokenInfos = []; - object.tokenStatuses = []; - } - if (message.identities && message.identities.length) { - object.identities = []; - for (var j = 0; j < message.identities.length; ++j) - object.identities[j] = $root.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityRequest.toObject(message.identities[j], options); - } - if (message.contracts && message.contracts.length) { - object.contracts = []; - for (var j = 0; j < message.contracts.length; ++j) - object.contracts[j] = $root.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.ContractRequest.toObject(message.contracts[j], options); - } - if (message.documents && message.documents.length) { - object.documents = []; - for (var j = 0; j < message.documents.length; ++j) - object.documents[j] = $root.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest.toObject(message.documents[j], options); - } - if (message.votes && message.votes.length) { - object.votes = []; - for (var j = 0; j < message.votes.length; ++j) - object.votes[j] = $root.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.toObject(message.votes[j], options); - } - if (message.identityTokenBalances && message.identityTokenBalances.length) { - object.identityTokenBalances = []; - for (var j = 0; j < message.identityTokenBalances.length; ++j) - object.identityTokenBalances[j] = $root.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenBalanceRequest.toObject(message.identityTokenBalances[j], options); - } - if (message.identityTokenInfos && message.identityTokenInfos.length) { - object.identityTokenInfos = []; - for (var j = 0; j < message.identityTokenInfos.length; ++j) - object.identityTokenInfos[j] = $root.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenInfoRequest.toObject(message.identityTokenInfos[j], options); - } - if (message.tokenStatuses && message.tokenStatuses.length) { - object.tokenStatuses = []; - for (var j = 0; j < message.tokenStatuses.length; ++j) - object.tokenStatuses[j] = $root.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.TokenStatusRequest.toObject(message.tokenStatuses[j], options); - } - return object; - }; - - /** - * Converts this GetProofsRequestV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0 - * @instance - * @returns {Object.} JSON object - */ - GetProofsRequestV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetProofsRequestV0.DocumentRequest = (function() { - - /** - * Properties of a DocumentRequest. - * @memberof org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0 - * @interface IDocumentRequest - * @property {Uint8Array|null} [contractId] DocumentRequest contractId - * @property {string|null} [documentType] DocumentRequest documentType - * @property {boolean|null} [documentTypeKeepsHistory] DocumentRequest documentTypeKeepsHistory - * @property {Uint8Array|null} [documentId] DocumentRequest documentId - * @property {org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest.DocumentContestedStatus|null} [documentContestedStatus] DocumentRequest documentContestedStatus - */ - - /** - * Constructs a new DocumentRequest. - * @memberof org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0 - * @classdesc Represents a DocumentRequest. - * @implements IDocumentRequest - * @constructor - * @param {org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IDocumentRequest=} [properties] Properties to set - */ - function DocumentRequest(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]]; - } - - /** - * DocumentRequest contractId. - * @member {Uint8Array} contractId - * @memberof org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest - * @instance - */ - DocumentRequest.prototype.contractId = $util.newBuffer([]); - - /** - * DocumentRequest documentType. - * @member {string} documentType - * @memberof org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest - * @instance - */ - DocumentRequest.prototype.documentType = ""; - - /** - * DocumentRequest documentTypeKeepsHistory. - * @member {boolean} documentTypeKeepsHistory - * @memberof org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest - * @instance - */ - DocumentRequest.prototype.documentTypeKeepsHistory = false; - - /** - * DocumentRequest documentId. - * @member {Uint8Array} documentId - * @memberof org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest - * @instance - */ - DocumentRequest.prototype.documentId = $util.newBuffer([]); - - /** - * DocumentRequest documentContestedStatus. - * @member {org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest.DocumentContestedStatus} documentContestedStatus - * @memberof org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest - * @instance - */ - DocumentRequest.prototype.documentContestedStatus = 0; - - /** - * Creates a new DocumentRequest instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest - * @static - * @param {org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IDocumentRequest=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest} DocumentRequest instance - */ - DocumentRequest.create = function create(properties) { - return new DocumentRequest(properties); - }; - - /** - * Encodes the specified DocumentRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest - * @static - * @param {org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IDocumentRequest} message DocumentRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DocumentRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.contractId != null && Object.hasOwnProperty.call(message, "contractId")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.contractId); - if (message.documentType != null && Object.hasOwnProperty.call(message, "documentType")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.documentType); - if (message.documentTypeKeepsHistory != null && Object.hasOwnProperty.call(message, "documentTypeKeepsHistory")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.documentTypeKeepsHistory); - if (message.documentId != null && Object.hasOwnProperty.call(message, "documentId")) - writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.documentId); - if (message.documentContestedStatus != null && Object.hasOwnProperty.call(message, "documentContestedStatus")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.documentContestedStatus); - return writer; - }; - - /** - * Encodes the specified DocumentRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest - * @static - * @param {org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IDocumentRequest} message DocumentRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DocumentRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DocumentRequest message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest} DocumentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DocumentRequest.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.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.contractId = reader.bytes(); - break; - case 2: - message.documentType = reader.string(); - break; - case 3: - message.documentTypeKeepsHistory = reader.bool(); - break; - case 4: - message.documentId = reader.bytes(); - break; - case 5: - message.documentContestedStatus = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DocumentRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest} DocumentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DocumentRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DocumentRequest message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DocumentRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.contractId != null && message.hasOwnProperty("contractId")) - if (!(message.contractId && typeof message.contractId.length === "number" || $util.isString(message.contractId))) - return "contractId: buffer expected"; - if (message.documentType != null && message.hasOwnProperty("documentType")) - if (!$util.isString(message.documentType)) - return "documentType: string expected"; - if (message.documentTypeKeepsHistory != null && message.hasOwnProperty("documentTypeKeepsHistory")) - if (typeof message.documentTypeKeepsHistory !== "boolean") - return "documentTypeKeepsHistory: boolean expected"; - if (message.documentId != null && message.hasOwnProperty("documentId")) - if (!(message.documentId && typeof message.documentId.length === "number" || $util.isString(message.documentId))) - return "documentId: buffer expected"; - if (message.documentContestedStatus != null && message.hasOwnProperty("documentContestedStatus")) - switch (message.documentContestedStatus) { - default: - return "documentContestedStatus: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates a DocumentRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest} DocumentRequest - */ - DocumentRequest.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest(); - if (object.contractId != null) - if (typeof object.contractId === "string") - $util.base64.decode(object.contractId, message.contractId = $util.newBuffer($util.base64.length(object.contractId)), 0); - else if (object.contractId.length >= 0) - message.contractId = object.contractId; - if (object.documentType != null) - message.documentType = String(object.documentType); - if (object.documentTypeKeepsHistory != null) - message.documentTypeKeepsHistory = Boolean(object.documentTypeKeepsHistory); - if (object.documentId != null) - if (typeof object.documentId === "string") - $util.base64.decode(object.documentId, message.documentId = $util.newBuffer($util.base64.length(object.documentId)), 0); - else if (object.documentId.length >= 0) - message.documentId = object.documentId; - switch (object.documentContestedStatus) { - case "NOT_CONTESTED": - case 0: - message.documentContestedStatus = 0; - break; - case "MAYBE_CONTESTED": - case 1: - message.documentContestedStatus = 1; - break; - case "CONTESTED": - case 2: - message.documentContestedStatus = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from a DocumentRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest - * @static - * @param {org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest} message DocumentRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DocumentRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.contractId = ""; - else { - object.contractId = []; - if (options.bytes !== Array) - object.contractId = $util.newBuffer(object.contractId); - } - object.documentType = ""; - object.documentTypeKeepsHistory = false; - if (options.bytes === String) - object.documentId = ""; - else { - object.documentId = []; - if (options.bytes !== Array) - object.documentId = $util.newBuffer(object.documentId); - } - object.documentContestedStatus = options.enums === String ? "NOT_CONTESTED" : 0; - } - if (message.contractId != null && message.hasOwnProperty("contractId")) - object.contractId = options.bytes === String ? $util.base64.encode(message.contractId, 0, message.contractId.length) : options.bytes === Array ? Array.prototype.slice.call(message.contractId) : message.contractId; - if (message.documentType != null && message.hasOwnProperty("documentType")) - object.documentType = message.documentType; - if (message.documentTypeKeepsHistory != null && message.hasOwnProperty("documentTypeKeepsHistory")) - object.documentTypeKeepsHistory = message.documentTypeKeepsHistory; - if (message.documentId != null && message.hasOwnProperty("documentId")) - object.documentId = options.bytes === String ? $util.base64.encode(message.documentId, 0, message.documentId.length) : options.bytes === Array ? Array.prototype.slice.call(message.documentId) : message.documentId; - if (message.documentContestedStatus != null && message.hasOwnProperty("documentContestedStatus")) - object.documentContestedStatus = options.enums === String ? $root.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest.DocumentContestedStatus[message.documentContestedStatus] : message.documentContestedStatus; - return object; - }; - - /** - * Converts this DocumentRequest to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest - * @instance - * @returns {Object.} JSON object - */ - DocumentRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * DocumentContestedStatus enum. - * @name org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest.DocumentContestedStatus - * @enum {number} - * @property {number} NOT_CONTESTED=0 NOT_CONTESTED value - * @property {number} MAYBE_CONTESTED=1 MAYBE_CONTESTED value - * @property {number} CONTESTED=2 CONTESTED value - */ - DocumentRequest.DocumentContestedStatus = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "NOT_CONTESTED"] = 0; - values[valuesById[1] = "MAYBE_CONTESTED"] = 1; - values[valuesById[2] = "CONTESTED"] = 2; - return values; - })(); - - return DocumentRequest; - })(); - - GetProofsRequestV0.IdentityRequest = (function() { - - /** - * Properties of an IdentityRequest. - * @memberof org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0 - * @interface IIdentityRequest - * @property {Uint8Array|null} [identityId] IdentityRequest identityId - * @property {org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityRequest.Type|null} [requestType] IdentityRequest requestType - */ - - /** - * Constructs a new IdentityRequest. - * @memberof org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0 - * @classdesc Represents an IdentityRequest. - * @implements IIdentityRequest - * @constructor - * @param {org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IIdentityRequest=} [properties] Properties to set - */ - function IdentityRequest(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]]; - } - - /** - * IdentityRequest identityId. - * @member {Uint8Array} identityId - * @memberof org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityRequest - * @instance - */ - IdentityRequest.prototype.identityId = $util.newBuffer([]); - - /** - * IdentityRequest requestType. - * @member {org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityRequest.Type} requestType - * @memberof org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityRequest - * @instance - */ - IdentityRequest.prototype.requestType = 0; - - /** - * Creates a new IdentityRequest instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityRequest - * @static - * @param {org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IIdentityRequest=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityRequest} IdentityRequest instance - */ - IdentityRequest.create = function create(properties) { - return new IdentityRequest(properties); - }; - - /** - * Encodes the specified IdentityRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityRequest.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityRequest - * @static - * @param {org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IIdentityRequest} message IdentityRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IdentityRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.identityId != null && Object.hasOwnProperty.call(message, "identityId")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.identityId); - if (message.requestType != null && Object.hasOwnProperty.call(message, "requestType")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.requestType); - return writer; - }; - - /** - * Encodes the specified IdentityRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityRequest - * @static - * @param {org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IIdentityRequest} message IdentityRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IdentityRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an IdentityRequest message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityRequest} IdentityRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IdentityRequest.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.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.identityId = reader.bytes(); - break; - case 2: - message.requestType = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an IdentityRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityRequest} IdentityRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IdentityRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an IdentityRequest message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - IdentityRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.identityId != null && message.hasOwnProperty("identityId")) - if (!(message.identityId && typeof message.identityId.length === "number" || $util.isString(message.identityId))) - return "identityId: buffer expected"; - if (message.requestType != null && message.hasOwnProperty("requestType")) - switch (message.requestType) { - default: - return "requestType: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - return null; - }; - - /** - * Creates an IdentityRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityRequest - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityRequest} IdentityRequest - */ - IdentityRequest.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityRequest) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityRequest(); - if (object.identityId != null) - if (typeof object.identityId === "string") - $util.base64.decode(object.identityId, message.identityId = $util.newBuffer($util.base64.length(object.identityId)), 0); - else if (object.identityId.length >= 0) - message.identityId = object.identityId; - switch (object.requestType) { - case "FULL_IDENTITY": - case 0: - message.requestType = 0; - break; - case "BALANCE": - case 1: - message.requestType = 1; - break; - case "KEYS": - case 2: - message.requestType = 2; - break; - case "REVISION": - case 3: - message.requestType = 3; - break; - } - return message; - }; - - /** - * Creates a plain object from an IdentityRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityRequest - * @static - * @param {org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityRequest} message IdentityRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - IdentityRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.identityId = ""; - else { - object.identityId = []; - if (options.bytes !== Array) - object.identityId = $util.newBuffer(object.identityId); - } - object.requestType = options.enums === String ? "FULL_IDENTITY" : 0; - } - if (message.identityId != null && message.hasOwnProperty("identityId")) - object.identityId = options.bytes === String ? $util.base64.encode(message.identityId, 0, message.identityId.length) : options.bytes === Array ? Array.prototype.slice.call(message.identityId) : message.identityId; - if (message.requestType != null && message.hasOwnProperty("requestType")) - object.requestType = options.enums === String ? $root.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityRequest.Type[message.requestType] : message.requestType; - return object; - }; - - /** - * Converts this IdentityRequest to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityRequest - * @instance - * @returns {Object.} JSON object - */ - IdentityRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Type enum. - * @name org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityRequest.Type - * @enum {number} - * @property {number} FULL_IDENTITY=0 FULL_IDENTITY value - * @property {number} BALANCE=1 BALANCE value - * @property {number} KEYS=2 KEYS value - * @property {number} REVISION=3 REVISION value - */ - IdentityRequest.Type = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "FULL_IDENTITY"] = 0; - values[valuesById[1] = "BALANCE"] = 1; - values[valuesById[2] = "KEYS"] = 2; - values[valuesById[3] = "REVISION"] = 3; - return values; - })(); - - return IdentityRequest; - })(); - - GetProofsRequestV0.ContractRequest = (function() { - - /** - * Properties of a ContractRequest. - * @memberof org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0 - * @interface IContractRequest - * @property {Uint8Array|null} [contractId] ContractRequest contractId - */ - - /** - * Constructs a new ContractRequest. - * @memberof org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0 - * @classdesc Represents a ContractRequest. - * @implements IContractRequest - * @constructor - * @param {org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IContractRequest=} [properties] Properties to set - */ - function ContractRequest(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]]; - } - - /** - * ContractRequest contractId. - * @member {Uint8Array} contractId - * @memberof org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.ContractRequest - * @instance - */ - ContractRequest.prototype.contractId = $util.newBuffer([]); - - /** - * Creates a new ContractRequest instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.ContractRequest - * @static - * @param {org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IContractRequest=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.ContractRequest} ContractRequest instance - */ - ContractRequest.create = function create(properties) { - return new ContractRequest(properties); - }; - - /** - * Encodes the specified ContractRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.ContractRequest.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.ContractRequest - * @static - * @param {org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IContractRequest} message ContractRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ContractRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.contractId != null && Object.hasOwnProperty.call(message, "contractId")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.contractId); - return writer; - }; - - /** - * Encodes the specified ContractRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.ContractRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.ContractRequest - * @static - * @param {org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IContractRequest} message ContractRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ContractRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ContractRequest message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.ContractRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.ContractRequest} ContractRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ContractRequest.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.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.ContractRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.contractId = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ContractRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.ContractRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.ContractRequest} ContractRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ContractRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ContractRequest message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.ContractRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ContractRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.contractId != null && message.hasOwnProperty("contractId")) - if (!(message.contractId && typeof message.contractId.length === "number" || $util.isString(message.contractId))) - return "contractId: buffer expected"; - return null; - }; - - /** - * Creates a ContractRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.ContractRequest - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.ContractRequest} ContractRequest - */ - ContractRequest.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.ContractRequest) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.ContractRequest(); - if (object.contractId != null) - if (typeof object.contractId === "string") - $util.base64.decode(object.contractId, message.contractId = $util.newBuffer($util.base64.length(object.contractId)), 0); - else if (object.contractId.length >= 0) - message.contractId = object.contractId; - return message; - }; - - /** - * Creates a plain object from a ContractRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.ContractRequest - * @static - * @param {org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.ContractRequest} message ContractRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ContractRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - if (options.bytes === String) - object.contractId = ""; - else { - object.contractId = []; - if (options.bytes !== Array) - object.contractId = $util.newBuffer(object.contractId); - } - if (message.contractId != null && message.hasOwnProperty("contractId")) - object.contractId = options.bytes === String ? $util.base64.encode(message.contractId, 0, message.contractId.length) : options.bytes === Array ? Array.prototype.slice.call(message.contractId) : message.contractId; - return object; - }; - - /** - * Converts this ContractRequest to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.ContractRequest - * @instance - * @returns {Object.} JSON object - */ - ContractRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ContractRequest; - })(); - - GetProofsRequestV0.VoteStatusRequest = (function() { - - /** - * Properties of a VoteStatusRequest. - * @memberof org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0 - * @interface IVoteStatusRequest - * @property {org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.IContestedResourceVoteStatusRequest|null} [contestedResourceVoteStatusRequest] VoteStatusRequest contestedResourceVoteStatusRequest - */ - - /** - * Constructs a new VoteStatusRequest. - * @memberof org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0 - * @classdesc Represents a VoteStatusRequest. - * @implements IVoteStatusRequest - * @constructor - * @param {org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IVoteStatusRequest=} [properties] Properties to set - */ - function VoteStatusRequest(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]]; - } - - /** - * VoteStatusRequest contestedResourceVoteStatusRequest. - * @member {org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.IContestedResourceVoteStatusRequest|null|undefined} contestedResourceVoteStatusRequest - * @memberof org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest - * @instance - */ - VoteStatusRequest.prototype.contestedResourceVoteStatusRequest = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * VoteStatusRequest requestType. - * @member {"contestedResourceVoteStatusRequest"|undefined} requestType - * @memberof org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest - * @instance - */ - Object.defineProperty(VoteStatusRequest.prototype, "requestType", { - get: $util.oneOfGetter($oneOfFields = ["contestedResourceVoteStatusRequest"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new VoteStatusRequest instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest - * @static - * @param {org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IVoteStatusRequest=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest} VoteStatusRequest instance - */ - VoteStatusRequest.create = function create(properties) { - return new VoteStatusRequest(properties); - }; - - /** - * Encodes the specified VoteStatusRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest - * @static - * @param {org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IVoteStatusRequest} message VoteStatusRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - VoteStatusRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.contestedResourceVoteStatusRequest != null && Object.hasOwnProperty.call(message, "contestedResourceVoteStatusRequest")) - $root.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest.encode(message.contestedResourceVoteStatusRequest, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified VoteStatusRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest - * @static - * @param {org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IVoteStatusRequest} message VoteStatusRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - VoteStatusRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a VoteStatusRequest message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest} VoteStatusRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - VoteStatusRequest.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.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.contestedResourceVoteStatusRequest = $root.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a VoteStatusRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest} VoteStatusRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - VoteStatusRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a VoteStatusRequest message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - VoteStatusRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.contestedResourceVoteStatusRequest != null && message.hasOwnProperty("contestedResourceVoteStatusRequest")) { - properties.requestType = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest.verify(message.contestedResourceVoteStatusRequest); - if (error) - return "contestedResourceVoteStatusRequest." + error; - } - } - return null; - }; - - /** - * Creates a VoteStatusRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest} VoteStatusRequest - */ - VoteStatusRequest.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest(); - if (object.contestedResourceVoteStatusRequest != null) { - if (typeof object.contestedResourceVoteStatusRequest !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.contestedResourceVoteStatusRequest: object expected"); - message.contestedResourceVoteStatusRequest = $root.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest.fromObject(object.contestedResourceVoteStatusRequest); - } - return message; - }; - - /** - * Creates a plain object from a VoteStatusRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest - * @static - * @param {org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest} message VoteStatusRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - VoteStatusRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.contestedResourceVoteStatusRequest != null && message.hasOwnProperty("contestedResourceVoteStatusRequest")) { - object.contestedResourceVoteStatusRequest = $root.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest.toObject(message.contestedResourceVoteStatusRequest, options); - if (options.oneofs) - object.requestType = "contestedResourceVoteStatusRequest"; - } - return object; - }; - - /** - * Converts this VoteStatusRequest to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest - * @instance - * @returns {Object.} JSON object - */ - VoteStatusRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - VoteStatusRequest.ContestedResourceVoteStatusRequest = (function() { - - /** - * Properties of a ContestedResourceVoteStatusRequest. - * @memberof org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest - * @interface IContestedResourceVoteStatusRequest - * @property {Uint8Array|null} [contractId] ContestedResourceVoteStatusRequest contractId - * @property {string|null} [documentTypeName] ContestedResourceVoteStatusRequest documentTypeName - * @property {string|null} [indexName] ContestedResourceVoteStatusRequest indexName - * @property {Array.|null} [indexValues] ContestedResourceVoteStatusRequest indexValues - * @property {Uint8Array|null} [voterIdentifier] ContestedResourceVoteStatusRequest voterIdentifier - */ - - /** - * Constructs a new ContestedResourceVoteStatusRequest. - * @memberof org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest - * @classdesc Represents a ContestedResourceVoteStatusRequest. - * @implements IContestedResourceVoteStatusRequest - * @constructor - * @param {org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.IContestedResourceVoteStatusRequest=} [properties] Properties to set - */ - function ContestedResourceVoteStatusRequest(properties) { - this.indexValues = []; - 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]]; - } - - /** - * ContestedResourceVoteStatusRequest contractId. - * @member {Uint8Array} contractId - * @memberof org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest - * @instance - */ - ContestedResourceVoteStatusRequest.prototype.contractId = $util.newBuffer([]); - - /** - * ContestedResourceVoteStatusRequest documentTypeName. - * @member {string} documentTypeName - * @memberof org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest - * @instance - */ - ContestedResourceVoteStatusRequest.prototype.documentTypeName = ""; - - /** - * ContestedResourceVoteStatusRequest indexName. - * @member {string} indexName - * @memberof org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest - * @instance - */ - ContestedResourceVoteStatusRequest.prototype.indexName = ""; - - /** - * ContestedResourceVoteStatusRequest indexValues. - * @member {Array.} indexValues - * @memberof org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest - * @instance - */ - ContestedResourceVoteStatusRequest.prototype.indexValues = $util.emptyArray; - - /** - * ContestedResourceVoteStatusRequest voterIdentifier. - * @member {Uint8Array} voterIdentifier - * @memberof org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest - * @instance - */ - ContestedResourceVoteStatusRequest.prototype.voterIdentifier = $util.newBuffer([]); - - /** - * Creates a new ContestedResourceVoteStatusRequest instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest - * @static - * @param {org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.IContestedResourceVoteStatusRequest=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest} ContestedResourceVoteStatusRequest instance - */ - ContestedResourceVoteStatusRequest.create = function create(properties) { - return new ContestedResourceVoteStatusRequest(properties); - }; - - /** - * Encodes the specified ContestedResourceVoteStatusRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest - * @static - * @param {org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.IContestedResourceVoteStatusRequest} message ContestedResourceVoteStatusRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ContestedResourceVoteStatusRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.contractId != null && Object.hasOwnProperty.call(message, "contractId")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.contractId); - if (message.documentTypeName != null && Object.hasOwnProperty.call(message, "documentTypeName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.documentTypeName); - if (message.indexName != null && Object.hasOwnProperty.call(message, "indexName")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.indexName); - if (message.indexValues != null && message.indexValues.length) - for (var i = 0; i < message.indexValues.length; ++i) - writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.indexValues[i]); - if (message.voterIdentifier != null && Object.hasOwnProperty.call(message, "voterIdentifier")) - writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.voterIdentifier); - return writer; - }; - - /** - * Encodes the specified ContestedResourceVoteStatusRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest - * @static - * @param {org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.IContestedResourceVoteStatusRequest} message ContestedResourceVoteStatusRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ContestedResourceVoteStatusRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ContestedResourceVoteStatusRequest message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest} ContestedResourceVoteStatusRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ContestedResourceVoteStatusRequest.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.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.contractId = reader.bytes(); - break; - case 2: - message.documentTypeName = reader.string(); - break; - case 3: - message.indexName = reader.string(); - break; - case 4: - if (!(message.indexValues && message.indexValues.length)) - message.indexValues = []; - message.indexValues.push(reader.bytes()); - break; - case 5: - message.voterIdentifier = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ContestedResourceVoteStatusRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest} ContestedResourceVoteStatusRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ContestedResourceVoteStatusRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ContestedResourceVoteStatusRequest message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ContestedResourceVoteStatusRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.contractId != null && message.hasOwnProperty("contractId")) - if (!(message.contractId && typeof message.contractId.length === "number" || $util.isString(message.contractId))) - return "contractId: buffer expected"; - if (message.documentTypeName != null && message.hasOwnProperty("documentTypeName")) - if (!$util.isString(message.documentTypeName)) - return "documentTypeName: string expected"; - if (message.indexName != null && message.hasOwnProperty("indexName")) - if (!$util.isString(message.indexName)) - return "indexName: string expected"; - if (message.indexValues != null && message.hasOwnProperty("indexValues")) { - if (!Array.isArray(message.indexValues)) - return "indexValues: array expected"; - for (var i = 0; i < message.indexValues.length; ++i) - if (!(message.indexValues[i] && typeof message.indexValues[i].length === "number" || $util.isString(message.indexValues[i]))) - return "indexValues: buffer[] expected"; - } - if (message.voterIdentifier != null && message.hasOwnProperty("voterIdentifier")) - if (!(message.voterIdentifier && typeof message.voterIdentifier.length === "number" || $util.isString(message.voterIdentifier))) - return "voterIdentifier: buffer expected"; - return null; - }; - - /** - * Creates a ContestedResourceVoteStatusRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest} ContestedResourceVoteStatusRequest - */ - ContestedResourceVoteStatusRequest.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest(); - if (object.contractId != null) - if (typeof object.contractId === "string") - $util.base64.decode(object.contractId, message.contractId = $util.newBuffer($util.base64.length(object.contractId)), 0); - else if (object.contractId.length >= 0) - message.contractId = object.contractId; - if (object.documentTypeName != null) - message.documentTypeName = String(object.documentTypeName); - if (object.indexName != null) - message.indexName = String(object.indexName); - if (object.indexValues) { - if (!Array.isArray(object.indexValues)) - throw TypeError(".org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest.indexValues: array expected"); - message.indexValues = []; - for (var i = 0; i < object.indexValues.length; ++i) - if (typeof object.indexValues[i] === "string") - $util.base64.decode(object.indexValues[i], message.indexValues[i] = $util.newBuffer($util.base64.length(object.indexValues[i])), 0); - else if (object.indexValues[i].length >= 0) - message.indexValues[i] = object.indexValues[i]; - } - if (object.voterIdentifier != null) - if (typeof object.voterIdentifier === "string") - $util.base64.decode(object.voterIdentifier, message.voterIdentifier = $util.newBuffer($util.base64.length(object.voterIdentifier)), 0); - else if (object.voterIdentifier.length >= 0) - message.voterIdentifier = object.voterIdentifier; - return message; - }; - - /** - * Creates a plain object from a ContestedResourceVoteStatusRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest - * @static - * @param {org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest} message ContestedResourceVoteStatusRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ContestedResourceVoteStatusRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.indexValues = []; - if (options.defaults) { - if (options.bytes === String) - object.contractId = ""; - else { - object.contractId = []; - if (options.bytes !== Array) - object.contractId = $util.newBuffer(object.contractId); - } - object.documentTypeName = ""; - object.indexName = ""; - if (options.bytes === String) - object.voterIdentifier = ""; - else { - object.voterIdentifier = []; - if (options.bytes !== Array) - object.voterIdentifier = $util.newBuffer(object.voterIdentifier); - } - } - if (message.contractId != null && message.hasOwnProperty("contractId")) - object.contractId = options.bytes === String ? $util.base64.encode(message.contractId, 0, message.contractId.length) : options.bytes === Array ? Array.prototype.slice.call(message.contractId) : message.contractId; - if (message.documentTypeName != null && message.hasOwnProperty("documentTypeName")) - object.documentTypeName = message.documentTypeName; - if (message.indexName != null && message.hasOwnProperty("indexName")) - object.indexName = message.indexName; - if (message.indexValues && message.indexValues.length) { - object.indexValues = []; - for (var j = 0; j < message.indexValues.length; ++j) - object.indexValues[j] = options.bytes === String ? $util.base64.encode(message.indexValues[j], 0, message.indexValues[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.indexValues[j]) : message.indexValues[j]; - } - if (message.voterIdentifier != null && message.hasOwnProperty("voterIdentifier")) - object.voterIdentifier = options.bytes === String ? $util.base64.encode(message.voterIdentifier, 0, message.voterIdentifier.length) : options.bytes === Array ? Array.prototype.slice.call(message.voterIdentifier) : message.voterIdentifier; - return object; - }; - - /** - * Converts this ContestedResourceVoteStatusRequest to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest - * @instance - * @returns {Object.} JSON object - */ - ContestedResourceVoteStatusRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ContestedResourceVoteStatusRequest; - })(); - - return VoteStatusRequest; - })(); - - GetProofsRequestV0.IdentityTokenBalanceRequest = (function() { - - /** - * Properties of an IdentityTokenBalanceRequest. - * @memberof org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0 - * @interface IIdentityTokenBalanceRequest - * @property {Uint8Array|null} [tokenId] IdentityTokenBalanceRequest tokenId - * @property {Uint8Array|null} [identityId] IdentityTokenBalanceRequest identityId - */ - - /** - * Constructs a new IdentityTokenBalanceRequest. - * @memberof org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0 - * @classdesc Represents an IdentityTokenBalanceRequest. - * @implements IIdentityTokenBalanceRequest - * @constructor - * @param {org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IIdentityTokenBalanceRequest=} [properties] Properties to set - */ - function IdentityTokenBalanceRequest(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]]; - } - - /** - * IdentityTokenBalanceRequest tokenId. - * @member {Uint8Array} tokenId - * @memberof org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenBalanceRequest - * @instance - */ - IdentityTokenBalanceRequest.prototype.tokenId = $util.newBuffer([]); - - /** - * IdentityTokenBalanceRequest identityId. - * @member {Uint8Array} identityId - * @memberof org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenBalanceRequest - * @instance - */ - IdentityTokenBalanceRequest.prototype.identityId = $util.newBuffer([]); - - /** - * Creates a new IdentityTokenBalanceRequest instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenBalanceRequest - * @static - * @param {org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IIdentityTokenBalanceRequest=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenBalanceRequest} IdentityTokenBalanceRequest instance - */ - IdentityTokenBalanceRequest.create = function create(properties) { - return new IdentityTokenBalanceRequest(properties); - }; - - /** - * Encodes the specified IdentityTokenBalanceRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenBalanceRequest.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenBalanceRequest - * @static - * @param {org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IIdentityTokenBalanceRequest} message IdentityTokenBalanceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IdentityTokenBalanceRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.tokenId != null && Object.hasOwnProperty.call(message, "tokenId")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.tokenId); - if (message.identityId != null && Object.hasOwnProperty.call(message, "identityId")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.identityId); - return writer; - }; - - /** - * Encodes the specified IdentityTokenBalanceRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenBalanceRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenBalanceRequest - * @static - * @param {org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IIdentityTokenBalanceRequest} message IdentityTokenBalanceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IdentityTokenBalanceRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an IdentityTokenBalanceRequest message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenBalanceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenBalanceRequest} IdentityTokenBalanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IdentityTokenBalanceRequest.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.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenBalanceRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.tokenId = reader.bytes(); - break; - case 2: - message.identityId = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an IdentityTokenBalanceRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenBalanceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenBalanceRequest} IdentityTokenBalanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IdentityTokenBalanceRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an IdentityTokenBalanceRequest message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenBalanceRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - IdentityTokenBalanceRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.tokenId != null && message.hasOwnProperty("tokenId")) - if (!(message.tokenId && typeof message.tokenId.length === "number" || $util.isString(message.tokenId))) - return "tokenId: buffer expected"; - if (message.identityId != null && message.hasOwnProperty("identityId")) - if (!(message.identityId && typeof message.identityId.length === "number" || $util.isString(message.identityId))) - return "identityId: buffer expected"; - return null; - }; - - /** - * Creates an IdentityTokenBalanceRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenBalanceRequest - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenBalanceRequest} IdentityTokenBalanceRequest - */ - IdentityTokenBalanceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenBalanceRequest) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenBalanceRequest(); - if (object.tokenId != null) - if (typeof object.tokenId === "string") - $util.base64.decode(object.tokenId, message.tokenId = $util.newBuffer($util.base64.length(object.tokenId)), 0); - else if (object.tokenId.length >= 0) - message.tokenId = object.tokenId; - if (object.identityId != null) - if (typeof object.identityId === "string") - $util.base64.decode(object.identityId, message.identityId = $util.newBuffer($util.base64.length(object.identityId)), 0); - else if (object.identityId.length >= 0) - message.identityId = object.identityId; - return message; - }; - - /** - * Creates a plain object from an IdentityTokenBalanceRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenBalanceRequest - * @static - * @param {org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenBalanceRequest} message IdentityTokenBalanceRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - IdentityTokenBalanceRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.tokenId = ""; - else { - object.tokenId = []; - if (options.bytes !== Array) - object.tokenId = $util.newBuffer(object.tokenId); - } - if (options.bytes === String) - object.identityId = ""; - else { - object.identityId = []; - if (options.bytes !== Array) - object.identityId = $util.newBuffer(object.identityId); - } - } - if (message.tokenId != null && message.hasOwnProperty("tokenId")) - object.tokenId = options.bytes === String ? $util.base64.encode(message.tokenId, 0, message.tokenId.length) : options.bytes === Array ? Array.prototype.slice.call(message.tokenId) : message.tokenId; - if (message.identityId != null && message.hasOwnProperty("identityId")) - object.identityId = options.bytes === String ? $util.base64.encode(message.identityId, 0, message.identityId.length) : options.bytes === Array ? Array.prototype.slice.call(message.identityId) : message.identityId; - return object; - }; - - /** - * Converts this IdentityTokenBalanceRequest to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenBalanceRequest - * @instance - * @returns {Object.} JSON object - */ - IdentityTokenBalanceRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return IdentityTokenBalanceRequest; - })(); - - GetProofsRequestV0.IdentityTokenInfoRequest = (function() { - - /** - * Properties of an IdentityTokenInfoRequest. - * @memberof org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0 - * @interface IIdentityTokenInfoRequest - * @property {Uint8Array|null} [tokenId] IdentityTokenInfoRequest tokenId - * @property {Uint8Array|null} [identityId] IdentityTokenInfoRequest identityId - */ - - /** - * Constructs a new IdentityTokenInfoRequest. - * @memberof org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0 - * @classdesc Represents an IdentityTokenInfoRequest. - * @implements IIdentityTokenInfoRequest - * @constructor - * @param {org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IIdentityTokenInfoRequest=} [properties] Properties to set - */ - function IdentityTokenInfoRequest(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]]; - } - - /** - * IdentityTokenInfoRequest tokenId. - * @member {Uint8Array} tokenId - * @memberof org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenInfoRequest - * @instance - */ - IdentityTokenInfoRequest.prototype.tokenId = $util.newBuffer([]); - - /** - * IdentityTokenInfoRequest identityId. - * @member {Uint8Array} identityId - * @memberof org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenInfoRequest - * @instance - */ - IdentityTokenInfoRequest.prototype.identityId = $util.newBuffer([]); - - /** - * Creates a new IdentityTokenInfoRequest instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenInfoRequest - * @static - * @param {org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IIdentityTokenInfoRequest=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenInfoRequest} IdentityTokenInfoRequest instance - */ - IdentityTokenInfoRequest.create = function create(properties) { - return new IdentityTokenInfoRequest(properties); - }; - - /** - * Encodes the specified IdentityTokenInfoRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenInfoRequest.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenInfoRequest - * @static - * @param {org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IIdentityTokenInfoRequest} message IdentityTokenInfoRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IdentityTokenInfoRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.tokenId != null && Object.hasOwnProperty.call(message, "tokenId")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.tokenId); - if (message.identityId != null && Object.hasOwnProperty.call(message, "identityId")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.identityId); - return writer; - }; - - /** - * Encodes the specified IdentityTokenInfoRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenInfoRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenInfoRequest - * @static - * @param {org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IIdentityTokenInfoRequest} message IdentityTokenInfoRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IdentityTokenInfoRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an IdentityTokenInfoRequest message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenInfoRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenInfoRequest} IdentityTokenInfoRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IdentityTokenInfoRequest.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.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenInfoRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.tokenId = reader.bytes(); - break; - case 2: - message.identityId = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an IdentityTokenInfoRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenInfoRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenInfoRequest} IdentityTokenInfoRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IdentityTokenInfoRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an IdentityTokenInfoRequest message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenInfoRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - IdentityTokenInfoRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.tokenId != null && message.hasOwnProperty("tokenId")) - if (!(message.tokenId && typeof message.tokenId.length === "number" || $util.isString(message.tokenId))) - return "tokenId: buffer expected"; - if (message.identityId != null && message.hasOwnProperty("identityId")) - if (!(message.identityId && typeof message.identityId.length === "number" || $util.isString(message.identityId))) - return "identityId: buffer expected"; - return null; - }; - - /** - * Creates an IdentityTokenInfoRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenInfoRequest - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenInfoRequest} IdentityTokenInfoRequest - */ - IdentityTokenInfoRequest.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenInfoRequest) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenInfoRequest(); - if (object.tokenId != null) - if (typeof object.tokenId === "string") - $util.base64.decode(object.tokenId, message.tokenId = $util.newBuffer($util.base64.length(object.tokenId)), 0); - else if (object.tokenId.length >= 0) - message.tokenId = object.tokenId; - if (object.identityId != null) - if (typeof object.identityId === "string") - $util.base64.decode(object.identityId, message.identityId = $util.newBuffer($util.base64.length(object.identityId)), 0); - else if (object.identityId.length >= 0) - message.identityId = object.identityId; - return message; - }; - - /** - * Creates a plain object from an IdentityTokenInfoRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenInfoRequest - * @static - * @param {org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenInfoRequest} message IdentityTokenInfoRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - IdentityTokenInfoRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.tokenId = ""; - else { - object.tokenId = []; - if (options.bytes !== Array) - object.tokenId = $util.newBuffer(object.tokenId); - } - if (options.bytes === String) - object.identityId = ""; - else { - object.identityId = []; - if (options.bytes !== Array) - object.identityId = $util.newBuffer(object.identityId); - } - } - if (message.tokenId != null && message.hasOwnProperty("tokenId")) - object.tokenId = options.bytes === String ? $util.base64.encode(message.tokenId, 0, message.tokenId.length) : options.bytes === Array ? Array.prototype.slice.call(message.tokenId) : message.tokenId; - if (message.identityId != null && message.hasOwnProperty("identityId")) - object.identityId = options.bytes === String ? $util.base64.encode(message.identityId, 0, message.identityId.length) : options.bytes === Array ? Array.prototype.slice.call(message.identityId) : message.identityId; - return object; - }; - - /** - * Converts this IdentityTokenInfoRequest to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenInfoRequest - * @instance - * @returns {Object.} JSON object - */ - IdentityTokenInfoRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return IdentityTokenInfoRequest; - })(); - - GetProofsRequestV0.TokenStatusRequest = (function() { - - /** - * Properties of a TokenStatusRequest. - * @memberof org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0 - * @interface ITokenStatusRequest - * @property {Uint8Array|null} [tokenId] TokenStatusRequest tokenId - */ - - /** - * Constructs a new TokenStatusRequest. - * @memberof org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0 - * @classdesc Represents a TokenStatusRequest. - * @implements ITokenStatusRequest - * @constructor - * @param {org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.ITokenStatusRequest=} [properties] Properties to set - */ - function TokenStatusRequest(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]]; - } - - /** - * TokenStatusRequest tokenId. - * @member {Uint8Array} tokenId - * @memberof org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.TokenStatusRequest - * @instance - */ - TokenStatusRequest.prototype.tokenId = $util.newBuffer([]); - - /** - * Creates a new TokenStatusRequest instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.TokenStatusRequest - * @static - * @param {org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.ITokenStatusRequest=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.TokenStatusRequest} TokenStatusRequest instance - */ - TokenStatusRequest.create = function create(properties) { - return new TokenStatusRequest(properties); - }; - - /** - * Encodes the specified TokenStatusRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.TokenStatusRequest.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.TokenStatusRequest - * @static - * @param {org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.ITokenStatusRequest} message TokenStatusRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TokenStatusRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.tokenId != null && Object.hasOwnProperty.call(message, "tokenId")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.tokenId); - return writer; - }; - - /** - * Encodes the specified TokenStatusRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.TokenStatusRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.TokenStatusRequest - * @static - * @param {org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.ITokenStatusRequest} message TokenStatusRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TokenStatusRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TokenStatusRequest message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.TokenStatusRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.TokenStatusRequest} TokenStatusRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TokenStatusRequest.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.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.TokenStatusRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.tokenId = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TokenStatusRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.TokenStatusRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.TokenStatusRequest} TokenStatusRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TokenStatusRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TokenStatusRequest message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.TokenStatusRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TokenStatusRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.tokenId != null && message.hasOwnProperty("tokenId")) - if (!(message.tokenId && typeof message.tokenId.length === "number" || $util.isString(message.tokenId))) - return "tokenId: buffer expected"; - return null; - }; - - /** - * Creates a TokenStatusRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.TokenStatusRequest - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.TokenStatusRequest} TokenStatusRequest - */ - TokenStatusRequest.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.TokenStatusRequest) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.TokenStatusRequest(); - if (object.tokenId != null) - if (typeof object.tokenId === "string") - $util.base64.decode(object.tokenId, message.tokenId = $util.newBuffer($util.base64.length(object.tokenId)), 0); - else if (object.tokenId.length >= 0) - message.tokenId = object.tokenId; - return message; - }; - - /** - * Creates a plain object from a TokenStatusRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.TokenStatusRequest - * @static - * @param {org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.TokenStatusRequest} message TokenStatusRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TokenStatusRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - if (options.bytes === String) - object.tokenId = ""; - else { - object.tokenId = []; - if (options.bytes !== Array) - object.tokenId = $util.newBuffer(object.tokenId); - } - if (message.tokenId != null && message.hasOwnProperty("tokenId")) - object.tokenId = options.bytes === String ? $util.base64.encode(message.tokenId, 0, message.tokenId.length) : options.bytes === Array ? Array.prototype.slice.call(message.tokenId) : message.tokenId; - return object; - }; - - /** - * Converts this TokenStatusRequest to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.TokenStatusRequest - * @instance - * @returns {Object.} JSON object - */ - TokenStatusRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return TokenStatusRequest; - })(); - - return GetProofsRequestV0; - })(); - - return GetProofsRequest; - })(); - - v0.GetProofsResponse = (function() { - - /** - * Properties of a GetProofsResponse. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetProofsResponse - * @property {org.dash.platform.dapi.v0.GetProofsResponse.IGetProofsResponseV0|null} [v0] GetProofsResponse v0 - */ - - /** - * Constructs a new GetProofsResponse. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetProofsResponse. - * @implements IGetProofsResponse - * @constructor - * @param {org.dash.platform.dapi.v0.IGetProofsResponse=} [properties] Properties to set - */ - function GetProofsResponse(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]]; - } - - /** - * GetProofsResponse v0. - * @member {org.dash.platform.dapi.v0.GetProofsResponse.IGetProofsResponseV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetProofsResponse - * @instance - */ - GetProofsResponse.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetProofsResponse version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetProofsResponse - * @instance - */ - Object.defineProperty(GetProofsResponse.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetProofsResponse instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetProofsResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetProofsResponse=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetProofsResponse} GetProofsResponse instance - */ - GetProofsResponse.create = function create(properties) { - return new GetProofsResponse(properties); - }; - - /** - * Encodes the specified GetProofsResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetProofsResponse.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetProofsResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetProofsResponse} message GetProofsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetProofsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetProofsResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetProofsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetProofsResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetProofsResponse} message GetProofsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetProofsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetProofsResponse message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetProofsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetProofsResponse} GetProofsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetProofsResponse.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.org.dash.platform.dapi.v0.GetProofsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetProofsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetProofsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetProofsResponse} GetProofsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetProofsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetProofsResponse message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetProofsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetProofsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetProofsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetProofsResponse - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetProofsResponse} GetProofsResponse - */ - GetProofsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetProofsResponse) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetProofsResponse(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetProofsResponse.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetProofsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetProofsResponse - * @static - * @param {org.dash.platform.dapi.v0.GetProofsResponse} message GetProofsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetProofsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetProofsResponse to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetProofsResponse - * @instance - * @returns {Object.} JSON object - */ - GetProofsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetProofsResponse.GetProofsResponseV0 = (function() { - - /** - * Properties of a GetProofsResponseV0. - * @memberof org.dash.platform.dapi.v0.GetProofsResponse - * @interface IGetProofsResponseV0 - * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetProofsResponseV0 proof - * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetProofsResponseV0 metadata - */ - - /** - * Constructs a new GetProofsResponseV0. - * @memberof org.dash.platform.dapi.v0.GetProofsResponse - * @classdesc Represents a GetProofsResponseV0. - * @implements IGetProofsResponseV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetProofsResponse.IGetProofsResponseV0=} [properties] Properties to set - */ - function GetProofsResponseV0(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]]; - } - - /** - * GetProofsResponseV0 proof. - * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof - * @memberof org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0 - * @instance - */ - GetProofsResponseV0.prototype.proof = null; - - /** - * GetProofsResponseV0 metadata. - * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata - * @memberof org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0 - * @instance - */ - GetProofsResponseV0.prototype.metadata = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetProofsResponseV0 result. - * @member {"proof"|undefined} result - * @memberof org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0 - * @instance - */ - Object.defineProperty(GetProofsResponseV0.prototype, "result", { - get: $util.oneOfGetter($oneOfFields = ["proof"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetProofsResponseV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetProofsResponse.IGetProofsResponseV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0} GetProofsResponseV0 instance - */ - GetProofsResponseV0.create = function create(properties) { - return new GetProofsResponseV0(properties); - }; - - /** - * Encodes the specified GetProofsResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetProofsResponse.IGetProofsResponseV0} message GetProofsResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetProofsResponseV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) - $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetProofsResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetProofsResponse.IGetProofsResponseV0} message GetProofsResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetProofsResponseV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetProofsResponseV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0} GetProofsResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetProofsResponseV0.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.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); - break; - case 2: - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetProofsResponseV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0} GetProofsResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetProofsResponseV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetProofsResponseV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetProofsResponseV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.proof != null && message.hasOwnProperty("proof")) { - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); - if (error) - return "proof." + error; - } - } - if (message.metadata != null && message.hasOwnProperty("metadata")) { - var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); - if (error) - return "metadata." + error; - } - return null; - }; - - /** - * Creates a GetProofsResponseV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0} GetProofsResponseV0 - */ - GetProofsResponseV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0(); - if (object.proof != null) { - if (typeof object.proof !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0.proof: object expected"); - message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); - } - if (object.metadata != null) { - if (typeof object.metadata !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0.metadata: object expected"); - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); - } - return message; - }; - - /** - * Creates a plain object from a GetProofsResponseV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0} message GetProofsResponseV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetProofsResponseV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.metadata = null; - if (message.proof != null && message.hasOwnProperty("proof")) { - object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); - if (options.oneofs) - object.result = "proof"; - } - if (message.metadata != null && message.hasOwnProperty("metadata")) - object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); - return object; - }; - - /** - * Converts this GetProofsResponseV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0 - * @instance - * @returns {Object.} JSON object - */ - GetProofsResponseV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GetProofsResponseV0; - })(); - - return GetProofsResponse; - })(); - v0.GetDataContractRequest = (function() { /** diff --git a/packages/dapi-grpc/clients/platform/v0/nodejs/platform_protoc.js b/packages/dapi-grpc/clients/platform/v0/nodejs/platform_protoc.js index db423372350..dacdc9f126d 100644 --- a/packages/dapi-grpc/clients/platform/v0/nodejs/platform_protoc.js +++ b/packages/dapi-grpc/clients/platform/v0/nodejs/platform_protoc.js @@ -324,24 +324,6 @@ goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanc goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0', null, { proto }); goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0.ResultCase', null, { proto }); goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.VersionCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetProofsRequest', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.ContractRequest', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest.DocumentContestedStatus', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityRequest', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityRequest.Type', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenBalanceRequest', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenInfoRequest', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.TokenStatusRequest', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.RequestTypeCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetProofsRequest.VersionCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetProofsResponse', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0.ResultCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetProofsResponse.VersionCase', null, { proto }); goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest', null, { proto }); goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0', null, { proto }); goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.VersionCase', null, { proto }); @@ -1636,258 +1618,6 @@ if (goog.DEBUG && !COMPILED) { */ proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances.displayName = 'proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances'; } -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, proto.org.dash.platform.dapi.v0.GetProofsRequest.oneofGroups_); -}; -goog.inherits(proto.org.dash.platform.dapi.v0.GetProofsRequest, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.org.dash.platform.dapi.v0.GetProofsRequest.displayName = 'proto.org.dash.platform.dapi.v0.GetProofsRequest'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0 = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.repeatedFields_, null); -}; -goog.inherits(proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.displayName = 'proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest.displayName = 'proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityRequest = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityRequest, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityRequest.displayName = 'proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityRequest'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.ContractRequest = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.ContractRequest, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.ContractRequest.displayName = 'proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.ContractRequest'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.oneofGroups_); -}; -goog.inherits(proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.displayName = 'proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest.repeatedFields_, null); -}; -goog.inherits(proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest.displayName = 'proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenBalanceRequest = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenBalanceRequest, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenBalanceRequest.displayName = 'proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenBalanceRequest'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenInfoRequest = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenInfoRequest, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenInfoRequest.displayName = 'proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenInfoRequest'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.TokenStatusRequest = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.TokenStatusRequest, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.TokenStatusRequest.displayName = 'proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.TokenStatusRequest'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.org.dash.platform.dapi.v0.GetProofsResponse = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, proto.org.dash.platform.dapi.v0.GetProofsResponse.oneofGroups_); -}; -goog.inherits(proto.org.dash.platform.dapi.v0.GetProofsResponse, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.org.dash.platform.dapi.v0.GetProofsResponse.displayName = 'proto.org.dash.platform.dapi.v0.GetProofsResponse'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0 = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, proto.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0.oneofGroups_); -}; -goog.inherits(proto.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0.displayName = 'proto.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0'; -} /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a @@ -18272,2812 +18002,6 @@ proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.prototype.hasV0 = -/** - * Oneof group definitions for this message. Each group defines the field - * numbers belonging to that group. When of these fields' value is set, all - * other fields in the group are cleared. During deserialization, if multiple - * fields are encountered for a group, only the last value seen will be kept. - * @private {!Array>} - * @const - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.oneofGroups_ = [[1]]; - -/** - * @enum {number} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.VersionCase = { - VERSION_NOT_SET: 0, - V0: 1 -}; - -/** - * @return {proto.org.dash.platform.dapi.v0.GetProofsRequest.VersionCase} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.prototype.getVersionCase = function() { - return /** @type {proto.org.dash.platform.dapi.v0.GetProofsRequest.VersionCase} */(jspb.Message.computeOneofCase(this, proto.org.dash.platform.dapi.v0.GetProofsRequest.oneofGroups_[0])); -}; - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.prototype.toObject = function(opt_includeInstance) { - return proto.org.dash.platform.dapi.v0.GetProofsRequest.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.org.dash.platform.dapi.v0.GetProofsRequest} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.toObject = function(includeInstance, msg) { - var f, obj = { - v0: (f = msg.getV0()) && proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.toObject(includeInstance, f) - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.org.dash.platform.dapi.v0.GetProofsRequest} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.org.dash.platform.dapi.v0.GetProofsRequest; - return proto.org.dash.platform.dapi.v0.GetProofsRequest.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.org.dash.platform.dapi.v0.GetProofsRequest} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.org.dash.platform.dapi.v0.GetProofsRequest} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = new proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0; - reader.readMessage(value,proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.deserializeBinaryFromReader); - msg.setV0(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.org.dash.platform.dapi.v0.GetProofsRequest.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.org.dash.platform.dapi.v0.GetProofsRequest} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getV0(); - if (f != null) { - writer.writeMessage( - 1, - f, - proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.serializeBinaryToWriter - ); - } -}; - - - -/** - * List of repeated fields within this message type. - * @private {!Array} - * @const - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.repeatedFields_ = [1,2,3,4,5,6,7]; - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.prototype.toObject = function(opt_includeInstance) { - return proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.toObject = function(includeInstance, msg) { - var f, obj = { - identitiesList: jspb.Message.toObjectList(msg.getIdentitiesList(), - proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityRequest.toObject, includeInstance), - contractsList: jspb.Message.toObjectList(msg.getContractsList(), - proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.ContractRequest.toObject, includeInstance), - documentsList: jspb.Message.toObjectList(msg.getDocumentsList(), - proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest.toObject, includeInstance), - votesList: jspb.Message.toObjectList(msg.getVotesList(), - proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.toObject, includeInstance), - identityTokenBalancesList: jspb.Message.toObjectList(msg.getIdentityTokenBalancesList(), - proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenBalanceRequest.toObject, includeInstance), - identityTokenInfosList: jspb.Message.toObjectList(msg.getIdentityTokenInfosList(), - proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenInfoRequest.toObject, includeInstance), - tokenStatusesList: jspb.Message.toObjectList(msg.getTokenStatusesList(), - proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.TokenStatusRequest.toObject, includeInstance) - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0; - return proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = new proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityRequest; - reader.readMessage(value,proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityRequest.deserializeBinaryFromReader); - msg.addIdentities(value); - break; - case 2: - var value = new proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.ContractRequest; - reader.readMessage(value,proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.ContractRequest.deserializeBinaryFromReader); - msg.addContracts(value); - break; - case 3: - var value = new proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest; - reader.readMessage(value,proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest.deserializeBinaryFromReader); - msg.addDocuments(value); - break; - case 4: - var value = new proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest; - reader.readMessage(value,proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.deserializeBinaryFromReader); - msg.addVotes(value); - break; - case 5: - var value = new proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenBalanceRequest; - reader.readMessage(value,proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenBalanceRequest.deserializeBinaryFromReader); - msg.addIdentityTokenBalances(value); - break; - case 6: - var value = new proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenInfoRequest; - reader.readMessage(value,proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenInfoRequest.deserializeBinaryFromReader); - msg.addIdentityTokenInfos(value); - break; - case 7: - var value = new proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.TokenStatusRequest; - reader.readMessage(value,proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.TokenStatusRequest.deserializeBinaryFromReader); - msg.addTokenStatuses(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getIdentitiesList(); - if (f.length > 0) { - writer.writeRepeatedMessage( - 1, - f, - proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityRequest.serializeBinaryToWriter - ); - } - f = message.getContractsList(); - if (f.length > 0) { - writer.writeRepeatedMessage( - 2, - f, - proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.ContractRequest.serializeBinaryToWriter - ); - } - f = message.getDocumentsList(); - if (f.length > 0) { - writer.writeRepeatedMessage( - 3, - f, - proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest.serializeBinaryToWriter - ); - } - f = message.getVotesList(); - if (f.length > 0) { - writer.writeRepeatedMessage( - 4, - f, - proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.serializeBinaryToWriter - ); - } - f = message.getIdentityTokenBalancesList(); - if (f.length > 0) { - writer.writeRepeatedMessage( - 5, - f, - proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenBalanceRequest.serializeBinaryToWriter - ); - } - f = message.getIdentityTokenInfosList(); - if (f.length > 0) { - writer.writeRepeatedMessage( - 6, - f, - proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenInfoRequest.serializeBinaryToWriter - ); - } - f = message.getTokenStatusesList(); - if (f.length > 0) { - writer.writeRepeatedMessage( - 7, - f, - proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.TokenStatusRequest.serializeBinaryToWriter - ); - } -}; - - - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest.prototype.toObject = function(opt_includeInstance) { - return proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest.toObject = function(includeInstance, msg) { - var f, obj = { - contractId: msg.getContractId_asB64(), - documentType: jspb.Message.getFieldWithDefault(msg, 2, ""), - documentTypeKeepsHistory: jspb.Message.getBooleanFieldWithDefault(msg, 3, false), - documentId: msg.getDocumentId_asB64(), - documentContestedStatus: jspb.Message.getFieldWithDefault(msg, 5, 0) - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest; - return proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.setContractId(value); - break; - case 2: - var value = /** @type {string} */ (reader.readString()); - msg.setDocumentType(value); - break; - case 3: - var value = /** @type {boolean} */ (reader.readBool()); - msg.setDocumentTypeKeepsHistory(value); - break; - case 4: - var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.setDocumentId(value); - break; - case 5: - var value = /** @type {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest.DocumentContestedStatus} */ (reader.readEnum()); - msg.setDocumentContestedStatus(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getContractId_asU8(); - if (f.length > 0) { - writer.writeBytes( - 1, - f - ); - } - f = message.getDocumentType(); - if (f.length > 0) { - writer.writeString( - 2, - f - ); - } - f = message.getDocumentTypeKeepsHistory(); - if (f) { - writer.writeBool( - 3, - f - ); - } - f = message.getDocumentId_asU8(); - if (f.length > 0) { - writer.writeBytes( - 4, - f - ); - } - f = message.getDocumentContestedStatus(); - if (f !== 0.0) { - writer.writeEnum( - 5, - f - ); - } -}; - - -/** - * @enum {number} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest.DocumentContestedStatus = { - NOT_CONTESTED: 0, - MAYBE_CONTESTED: 1, - CONTESTED: 2 -}; - -/** - * optional bytes contract_id = 1; - * @return {string} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest.prototype.getContractId = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * optional bytes contract_id = 1; - * This is a type-conversion wrapper around `getContractId()` - * @return {string} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest.prototype.getContractId_asB64 = function() { - return /** @type {string} */ (jspb.Message.bytesAsB64( - this.getContractId())); -}; - - -/** - * optional bytes contract_id = 1; - * Note that Uint8Array is not supported on all browsers. - * @see http://caniuse.com/Uint8Array - * This is a type-conversion wrapper around `getContractId()` - * @return {!Uint8Array} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest.prototype.getContractId_asU8 = function() { - return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( - this.getContractId())); -}; - - -/** - * @param {!(string|Uint8Array)} value - * @return {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest} returns this - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest.prototype.setContractId = function(value) { - return jspb.Message.setProto3BytesField(this, 1, value); -}; - - -/** - * optional string document_type = 2; - * @return {string} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest.prototype.getDocumentType = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); -}; - - -/** - * @param {string} value - * @return {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest} returns this - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest.prototype.setDocumentType = function(value) { - return jspb.Message.setProto3StringField(this, 2, value); -}; - - -/** - * optional bool document_type_keeps_history = 3; - * @return {boolean} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest.prototype.getDocumentTypeKeepsHistory = function() { - return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 3, false)); -}; - - -/** - * @param {boolean} value - * @return {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest} returns this - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest.prototype.setDocumentTypeKeepsHistory = function(value) { - return jspb.Message.setProto3BooleanField(this, 3, value); -}; - - -/** - * optional bytes document_id = 4; - * @return {string} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest.prototype.getDocumentId = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")); -}; - - -/** - * optional bytes document_id = 4; - * This is a type-conversion wrapper around `getDocumentId()` - * @return {string} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest.prototype.getDocumentId_asB64 = function() { - return /** @type {string} */ (jspb.Message.bytesAsB64( - this.getDocumentId())); -}; - - -/** - * optional bytes document_id = 4; - * Note that Uint8Array is not supported on all browsers. - * @see http://caniuse.com/Uint8Array - * This is a type-conversion wrapper around `getDocumentId()` - * @return {!Uint8Array} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest.prototype.getDocumentId_asU8 = function() { - return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( - this.getDocumentId())); -}; - - -/** - * @param {!(string|Uint8Array)} value - * @return {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest} returns this - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest.prototype.setDocumentId = function(value) { - return jspb.Message.setProto3BytesField(this, 4, value); -}; - - -/** - * optional DocumentContestedStatus document_contested_status = 5; - * @return {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest.DocumentContestedStatus} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest.prototype.getDocumentContestedStatus = function() { - return /** @type {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest.DocumentContestedStatus} */ (jspb.Message.getFieldWithDefault(this, 5, 0)); -}; - - -/** - * @param {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest.DocumentContestedStatus} value - * @return {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest} returns this - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest.prototype.setDocumentContestedStatus = function(value) { - return jspb.Message.setProto3EnumField(this, 5, value); -}; - - - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityRequest.prototype.toObject = function(opt_includeInstance) { - return proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityRequest.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityRequest} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityRequest.toObject = function(includeInstance, msg) { - var f, obj = { - identityId: msg.getIdentityId_asB64(), - requestType: jspb.Message.getFieldWithDefault(msg, 2, 0) - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityRequest} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityRequest.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityRequest; - return proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityRequest.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityRequest} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityRequest} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityRequest.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.setIdentityId(value); - break; - case 2: - var value = /** @type {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityRequest.Type} */ (reader.readEnum()); - msg.setRequestType(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityRequest.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityRequest.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityRequest} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityRequest.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getIdentityId_asU8(); - if (f.length > 0) { - writer.writeBytes( - 1, - f - ); - } - f = message.getRequestType(); - if (f !== 0.0) { - writer.writeEnum( - 2, - f - ); - } -}; - - -/** - * @enum {number} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityRequest.Type = { - FULL_IDENTITY: 0, - BALANCE: 1, - KEYS: 2, - REVISION: 3 -}; - -/** - * optional bytes identity_id = 1; - * @return {string} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityRequest.prototype.getIdentityId = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * optional bytes identity_id = 1; - * This is a type-conversion wrapper around `getIdentityId()` - * @return {string} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityRequest.prototype.getIdentityId_asB64 = function() { - return /** @type {string} */ (jspb.Message.bytesAsB64( - this.getIdentityId())); -}; - - -/** - * optional bytes identity_id = 1; - * Note that Uint8Array is not supported on all browsers. - * @see http://caniuse.com/Uint8Array - * This is a type-conversion wrapper around `getIdentityId()` - * @return {!Uint8Array} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityRequest.prototype.getIdentityId_asU8 = function() { - return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( - this.getIdentityId())); -}; - - -/** - * @param {!(string|Uint8Array)} value - * @return {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityRequest} returns this - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityRequest.prototype.setIdentityId = function(value) { - return jspb.Message.setProto3BytesField(this, 1, value); -}; - - -/** - * optional Type request_type = 2; - * @return {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityRequest.Type} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityRequest.prototype.getRequestType = function() { - return /** @type {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityRequest.Type} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); -}; - - -/** - * @param {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityRequest.Type} value - * @return {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityRequest} returns this - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityRequest.prototype.setRequestType = function(value) { - return jspb.Message.setProto3EnumField(this, 2, value); -}; - - - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.ContractRequest.prototype.toObject = function(opt_includeInstance) { - return proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.ContractRequest.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.ContractRequest} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.ContractRequest.toObject = function(includeInstance, msg) { - var f, obj = { - contractId: msg.getContractId_asB64() - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.ContractRequest} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.ContractRequest.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.ContractRequest; - return proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.ContractRequest.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.ContractRequest} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.ContractRequest} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.ContractRequest.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.setContractId(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.ContractRequest.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.ContractRequest.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.ContractRequest} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.ContractRequest.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getContractId_asU8(); - if (f.length > 0) { - writer.writeBytes( - 1, - f - ); - } -}; - - -/** - * optional bytes contract_id = 1; - * @return {string} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.ContractRequest.prototype.getContractId = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * optional bytes contract_id = 1; - * This is a type-conversion wrapper around `getContractId()` - * @return {string} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.ContractRequest.prototype.getContractId_asB64 = function() { - return /** @type {string} */ (jspb.Message.bytesAsB64( - this.getContractId())); -}; - - -/** - * optional bytes contract_id = 1; - * Note that Uint8Array is not supported on all browsers. - * @see http://caniuse.com/Uint8Array - * This is a type-conversion wrapper around `getContractId()` - * @return {!Uint8Array} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.ContractRequest.prototype.getContractId_asU8 = function() { - return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( - this.getContractId())); -}; - - -/** - * @param {!(string|Uint8Array)} value - * @return {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.ContractRequest} returns this - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.ContractRequest.prototype.setContractId = function(value) { - return jspb.Message.setProto3BytesField(this, 1, value); -}; - - - -/** - * Oneof group definitions for this message. Each group defines the field - * numbers belonging to that group. When of these fields' value is set, all - * other fields in the group are cleared. During deserialization, if multiple - * fields are encountered for a group, only the last value seen will be kept. - * @private {!Array>} - * @const - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.oneofGroups_ = [[1]]; - -/** - * @enum {number} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.RequestTypeCase = { - REQUEST_TYPE_NOT_SET: 0, - CONTESTED_RESOURCE_VOTE_STATUS_REQUEST: 1 -}; - -/** - * @return {proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.RequestTypeCase} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.prototype.getRequestTypeCase = function() { - return /** @type {proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.RequestTypeCase} */(jspb.Message.computeOneofCase(this, proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.oneofGroups_[0])); -}; - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.prototype.toObject = function(opt_includeInstance) { - return proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.toObject = function(includeInstance, msg) { - var f, obj = { - contestedResourceVoteStatusRequest: (f = msg.getContestedResourceVoteStatusRequest()) && proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest.toObject(includeInstance, f) - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest; - return proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = new proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest; - reader.readMessage(value,proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest.deserializeBinaryFromReader); - msg.setContestedResourceVoteStatusRequest(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getContestedResourceVoteStatusRequest(); - if (f != null) { - writer.writeMessage( - 1, - f, - proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest.serializeBinaryToWriter - ); - } -}; - - - -/** - * List of repeated fields within this message type. - * @private {!Array} - * @const - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest.repeatedFields_ = [4]; - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest.prototype.toObject = function(opt_includeInstance) { - return proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest.toObject = function(includeInstance, msg) { - var f, obj = { - contractId: msg.getContractId_asB64(), - documentTypeName: jspb.Message.getFieldWithDefault(msg, 2, ""), - indexName: jspb.Message.getFieldWithDefault(msg, 3, ""), - indexValuesList: msg.getIndexValuesList_asB64(), - voterIdentifier: msg.getVoterIdentifier_asB64() - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest; - return proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.setContractId(value); - break; - case 2: - var value = /** @type {string} */ (reader.readString()); - msg.setDocumentTypeName(value); - break; - case 3: - var value = /** @type {string} */ (reader.readString()); - msg.setIndexName(value); - break; - case 4: - var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.addIndexValues(value); - break; - case 5: - var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.setVoterIdentifier(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getContractId_asU8(); - if (f.length > 0) { - writer.writeBytes( - 1, - f - ); - } - f = message.getDocumentTypeName(); - if (f.length > 0) { - writer.writeString( - 2, - f - ); - } - f = message.getIndexName(); - if (f.length > 0) { - writer.writeString( - 3, - f - ); - } - f = message.getIndexValuesList_asU8(); - if (f.length > 0) { - writer.writeRepeatedBytes( - 4, - f - ); - } - f = message.getVoterIdentifier_asU8(); - if (f.length > 0) { - writer.writeBytes( - 5, - f - ); - } -}; - - -/** - * optional bytes contract_id = 1; - * @return {string} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest.prototype.getContractId = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * optional bytes contract_id = 1; - * This is a type-conversion wrapper around `getContractId()` - * @return {string} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest.prototype.getContractId_asB64 = function() { - return /** @type {string} */ (jspb.Message.bytesAsB64( - this.getContractId())); -}; - - -/** - * optional bytes contract_id = 1; - * Note that Uint8Array is not supported on all browsers. - * @see http://caniuse.com/Uint8Array - * This is a type-conversion wrapper around `getContractId()` - * @return {!Uint8Array} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest.prototype.getContractId_asU8 = function() { - return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( - this.getContractId())); -}; - - -/** - * @param {!(string|Uint8Array)} value - * @return {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest} returns this - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest.prototype.setContractId = function(value) { - return jspb.Message.setProto3BytesField(this, 1, value); -}; - - -/** - * optional string document_type_name = 2; - * @return {string} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest.prototype.getDocumentTypeName = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); -}; - - -/** - * @param {string} value - * @return {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest} returns this - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest.prototype.setDocumentTypeName = function(value) { - return jspb.Message.setProto3StringField(this, 2, value); -}; - - -/** - * optional string index_name = 3; - * @return {string} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest.prototype.getIndexName = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); -}; - - -/** - * @param {string} value - * @return {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest} returns this - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest.prototype.setIndexName = function(value) { - return jspb.Message.setProto3StringField(this, 3, value); -}; - - -/** - * repeated bytes index_values = 4; - * @return {!Array} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest.prototype.getIndexValuesList = function() { - return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 4)); -}; - - -/** - * repeated bytes index_values = 4; - * This is a type-conversion wrapper around `getIndexValuesList()` - * @return {!Array} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest.prototype.getIndexValuesList_asB64 = function() { - return /** @type {!Array} */ (jspb.Message.bytesListAsB64( - this.getIndexValuesList())); -}; - - -/** - * repeated bytes index_values = 4; - * Note that Uint8Array is not supported on all browsers. - * @see http://caniuse.com/Uint8Array - * This is a type-conversion wrapper around `getIndexValuesList()` - * @return {!Array} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest.prototype.getIndexValuesList_asU8 = function() { - return /** @type {!Array} */ (jspb.Message.bytesListAsU8( - this.getIndexValuesList())); -}; - - -/** - * @param {!(Array|Array)} value - * @return {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest} returns this - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest.prototype.setIndexValuesList = function(value) { - return jspb.Message.setField(this, 4, value || []); -}; - - -/** - * @param {!(string|Uint8Array)} value - * @param {number=} opt_index - * @return {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest} returns this - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest.prototype.addIndexValues = function(value, opt_index) { - return jspb.Message.addToRepeatedField(this, 4, value, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - * @return {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest} returns this - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest.prototype.clearIndexValuesList = function() { - return this.setIndexValuesList([]); -}; - - -/** - * optional bytes voter_identifier = 5; - * @return {string} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest.prototype.getVoterIdentifier = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 5, "")); -}; - - -/** - * optional bytes voter_identifier = 5; - * This is a type-conversion wrapper around `getVoterIdentifier()` - * @return {string} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest.prototype.getVoterIdentifier_asB64 = function() { - return /** @type {string} */ (jspb.Message.bytesAsB64( - this.getVoterIdentifier())); -}; - - -/** - * optional bytes voter_identifier = 5; - * Note that Uint8Array is not supported on all browsers. - * @see http://caniuse.com/Uint8Array - * This is a type-conversion wrapper around `getVoterIdentifier()` - * @return {!Uint8Array} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest.prototype.getVoterIdentifier_asU8 = function() { - return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( - this.getVoterIdentifier())); -}; - - -/** - * @param {!(string|Uint8Array)} value - * @return {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest} returns this - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest.prototype.setVoterIdentifier = function(value) { - return jspb.Message.setProto3BytesField(this, 5, value); -}; - - -/** - * optional ContestedResourceVoteStatusRequest contested_resource_vote_status_request = 1; - * @return {?proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.prototype.getContestedResourceVoteStatusRequest = function() { - return /** @type{?proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest} */ ( - jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest, 1)); -}; - - -/** - * @param {?proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest|undefined} value - * @return {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest} returns this -*/ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.prototype.setContestedResourceVoteStatusRequest = function(value) { - return jspb.Message.setOneofWrapperField(this, 1, proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.oneofGroups_[0], value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest} returns this - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.prototype.clearContestedResourceVoteStatusRequest = function() { - return this.setContestedResourceVoteStatusRequest(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.prototype.hasContestedResourceVoteStatusRequest = function() { - return jspb.Message.getField(this, 1) != null; -}; - - - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenBalanceRequest.prototype.toObject = function(opt_includeInstance) { - return proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenBalanceRequest.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenBalanceRequest} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenBalanceRequest.toObject = function(includeInstance, msg) { - var f, obj = { - tokenId: msg.getTokenId_asB64(), - identityId: msg.getIdentityId_asB64() - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenBalanceRequest} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenBalanceRequest.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenBalanceRequest; - return proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenBalanceRequest.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenBalanceRequest} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenBalanceRequest} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenBalanceRequest.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.setTokenId(value); - break; - case 2: - var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.setIdentityId(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenBalanceRequest.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenBalanceRequest.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenBalanceRequest} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenBalanceRequest.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getTokenId_asU8(); - if (f.length > 0) { - writer.writeBytes( - 1, - f - ); - } - f = message.getIdentityId_asU8(); - if (f.length > 0) { - writer.writeBytes( - 2, - f - ); - } -}; - - -/** - * optional bytes token_id = 1; - * @return {string} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenBalanceRequest.prototype.getTokenId = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * optional bytes token_id = 1; - * This is a type-conversion wrapper around `getTokenId()` - * @return {string} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenBalanceRequest.prototype.getTokenId_asB64 = function() { - return /** @type {string} */ (jspb.Message.bytesAsB64( - this.getTokenId())); -}; - - -/** - * optional bytes token_id = 1; - * Note that Uint8Array is not supported on all browsers. - * @see http://caniuse.com/Uint8Array - * This is a type-conversion wrapper around `getTokenId()` - * @return {!Uint8Array} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenBalanceRequest.prototype.getTokenId_asU8 = function() { - return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( - this.getTokenId())); -}; - - -/** - * @param {!(string|Uint8Array)} value - * @return {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenBalanceRequest} returns this - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenBalanceRequest.prototype.setTokenId = function(value) { - return jspb.Message.setProto3BytesField(this, 1, value); -}; - - -/** - * optional bytes identity_id = 2; - * @return {string} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenBalanceRequest.prototype.getIdentityId = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); -}; - - -/** - * optional bytes identity_id = 2; - * This is a type-conversion wrapper around `getIdentityId()` - * @return {string} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenBalanceRequest.prototype.getIdentityId_asB64 = function() { - return /** @type {string} */ (jspb.Message.bytesAsB64( - this.getIdentityId())); -}; - - -/** - * optional bytes identity_id = 2; - * Note that Uint8Array is not supported on all browsers. - * @see http://caniuse.com/Uint8Array - * This is a type-conversion wrapper around `getIdentityId()` - * @return {!Uint8Array} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenBalanceRequest.prototype.getIdentityId_asU8 = function() { - return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( - this.getIdentityId())); -}; - - -/** - * @param {!(string|Uint8Array)} value - * @return {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenBalanceRequest} returns this - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenBalanceRequest.prototype.setIdentityId = function(value) { - return jspb.Message.setProto3BytesField(this, 2, value); -}; - - - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenInfoRequest.prototype.toObject = function(opt_includeInstance) { - return proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenInfoRequest.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenInfoRequest} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenInfoRequest.toObject = function(includeInstance, msg) { - var f, obj = { - tokenId: msg.getTokenId_asB64(), - identityId: msg.getIdentityId_asB64() - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenInfoRequest} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenInfoRequest.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenInfoRequest; - return proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenInfoRequest.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenInfoRequest} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenInfoRequest} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenInfoRequest.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.setTokenId(value); - break; - case 2: - var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.setIdentityId(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenInfoRequest.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenInfoRequest.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenInfoRequest} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenInfoRequest.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getTokenId_asU8(); - if (f.length > 0) { - writer.writeBytes( - 1, - f - ); - } - f = message.getIdentityId_asU8(); - if (f.length > 0) { - writer.writeBytes( - 2, - f - ); - } -}; - - -/** - * optional bytes token_id = 1; - * @return {string} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenInfoRequest.prototype.getTokenId = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * optional bytes token_id = 1; - * This is a type-conversion wrapper around `getTokenId()` - * @return {string} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenInfoRequest.prototype.getTokenId_asB64 = function() { - return /** @type {string} */ (jspb.Message.bytesAsB64( - this.getTokenId())); -}; - - -/** - * optional bytes token_id = 1; - * Note that Uint8Array is not supported on all browsers. - * @see http://caniuse.com/Uint8Array - * This is a type-conversion wrapper around `getTokenId()` - * @return {!Uint8Array} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenInfoRequest.prototype.getTokenId_asU8 = function() { - return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( - this.getTokenId())); -}; - - -/** - * @param {!(string|Uint8Array)} value - * @return {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenInfoRequest} returns this - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenInfoRequest.prototype.setTokenId = function(value) { - return jspb.Message.setProto3BytesField(this, 1, value); -}; - - -/** - * optional bytes identity_id = 2; - * @return {string} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenInfoRequest.prototype.getIdentityId = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); -}; - - -/** - * optional bytes identity_id = 2; - * This is a type-conversion wrapper around `getIdentityId()` - * @return {string} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenInfoRequest.prototype.getIdentityId_asB64 = function() { - return /** @type {string} */ (jspb.Message.bytesAsB64( - this.getIdentityId())); -}; - - -/** - * optional bytes identity_id = 2; - * Note that Uint8Array is not supported on all browsers. - * @see http://caniuse.com/Uint8Array - * This is a type-conversion wrapper around `getIdentityId()` - * @return {!Uint8Array} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenInfoRequest.prototype.getIdentityId_asU8 = function() { - return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( - this.getIdentityId())); -}; - - -/** - * @param {!(string|Uint8Array)} value - * @return {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenInfoRequest} returns this - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenInfoRequest.prototype.setIdentityId = function(value) { - return jspb.Message.setProto3BytesField(this, 2, value); -}; - - - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.TokenStatusRequest.prototype.toObject = function(opt_includeInstance) { - return proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.TokenStatusRequest.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.TokenStatusRequest} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.TokenStatusRequest.toObject = function(includeInstance, msg) { - var f, obj = { - tokenId: msg.getTokenId_asB64() - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.TokenStatusRequest} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.TokenStatusRequest.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.TokenStatusRequest; - return proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.TokenStatusRequest.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.TokenStatusRequest} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.TokenStatusRequest} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.TokenStatusRequest.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.setTokenId(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.TokenStatusRequest.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.TokenStatusRequest.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.TokenStatusRequest} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.TokenStatusRequest.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getTokenId_asU8(); - if (f.length > 0) { - writer.writeBytes( - 1, - f - ); - } -}; - - -/** - * optional bytes token_id = 1; - * @return {string} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.TokenStatusRequest.prototype.getTokenId = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * optional bytes token_id = 1; - * This is a type-conversion wrapper around `getTokenId()` - * @return {string} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.TokenStatusRequest.prototype.getTokenId_asB64 = function() { - return /** @type {string} */ (jspb.Message.bytesAsB64( - this.getTokenId())); -}; - - -/** - * optional bytes token_id = 1; - * Note that Uint8Array is not supported on all browsers. - * @see http://caniuse.com/Uint8Array - * This is a type-conversion wrapper around `getTokenId()` - * @return {!Uint8Array} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.TokenStatusRequest.prototype.getTokenId_asU8 = function() { - return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( - this.getTokenId())); -}; - - -/** - * @param {!(string|Uint8Array)} value - * @return {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.TokenStatusRequest} returns this - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.TokenStatusRequest.prototype.setTokenId = function(value) { - return jspb.Message.setProto3BytesField(this, 1, value); -}; - - -/** - * repeated IdentityRequest identities = 1; - * @return {!Array} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.prototype.getIdentitiesList = function() { - return /** @type{!Array} */ ( - jspb.Message.getRepeatedWrapperField(this, proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityRequest, 1)); -}; - - -/** - * @param {!Array} value - * @return {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0} returns this -*/ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.prototype.setIdentitiesList = function(value) { - return jspb.Message.setRepeatedWrapperField(this, 1, value); -}; - - -/** - * @param {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityRequest=} opt_value - * @param {number=} opt_index - * @return {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityRequest} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.prototype.addIdentities = function(opt_value, opt_index) { - return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityRequest, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - * @return {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0} returns this - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.prototype.clearIdentitiesList = function() { - return this.setIdentitiesList([]); -}; - - -/** - * repeated ContractRequest contracts = 2; - * @return {!Array} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.prototype.getContractsList = function() { - return /** @type{!Array} */ ( - jspb.Message.getRepeatedWrapperField(this, proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.ContractRequest, 2)); -}; - - -/** - * @param {!Array} value - * @return {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0} returns this -*/ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.prototype.setContractsList = function(value) { - return jspb.Message.setRepeatedWrapperField(this, 2, value); -}; - - -/** - * @param {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.ContractRequest=} opt_value - * @param {number=} opt_index - * @return {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.ContractRequest} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.prototype.addContracts = function(opt_value, opt_index) { - return jspb.Message.addToRepeatedWrapperField(this, 2, opt_value, proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.ContractRequest, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - * @return {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0} returns this - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.prototype.clearContractsList = function() { - return this.setContractsList([]); -}; - - -/** - * repeated DocumentRequest documents = 3; - * @return {!Array} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.prototype.getDocumentsList = function() { - return /** @type{!Array} */ ( - jspb.Message.getRepeatedWrapperField(this, proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest, 3)); -}; - - -/** - * @param {!Array} value - * @return {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0} returns this -*/ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.prototype.setDocumentsList = function(value) { - return jspb.Message.setRepeatedWrapperField(this, 3, value); -}; - - -/** - * @param {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest=} opt_value - * @param {number=} opt_index - * @return {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.prototype.addDocuments = function(opt_value, opt_index) { - return jspb.Message.addToRepeatedWrapperField(this, 3, opt_value, proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - * @return {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0} returns this - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.prototype.clearDocumentsList = function() { - return this.setDocumentsList([]); -}; - - -/** - * repeated VoteStatusRequest votes = 4; - * @return {!Array} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.prototype.getVotesList = function() { - return /** @type{!Array} */ ( - jspb.Message.getRepeatedWrapperField(this, proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest, 4)); -}; - - -/** - * @param {!Array} value - * @return {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0} returns this -*/ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.prototype.setVotesList = function(value) { - return jspb.Message.setRepeatedWrapperField(this, 4, value); -}; - - -/** - * @param {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest=} opt_value - * @param {number=} opt_index - * @return {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.prototype.addVotes = function(opt_value, opt_index) { - return jspb.Message.addToRepeatedWrapperField(this, 4, opt_value, proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - * @return {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0} returns this - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.prototype.clearVotesList = function() { - return this.setVotesList([]); -}; - - -/** - * repeated IdentityTokenBalanceRequest identity_token_balances = 5; - * @return {!Array} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.prototype.getIdentityTokenBalancesList = function() { - return /** @type{!Array} */ ( - jspb.Message.getRepeatedWrapperField(this, proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenBalanceRequest, 5)); -}; - - -/** - * @param {!Array} value - * @return {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0} returns this -*/ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.prototype.setIdentityTokenBalancesList = function(value) { - return jspb.Message.setRepeatedWrapperField(this, 5, value); -}; - - -/** - * @param {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenBalanceRequest=} opt_value - * @param {number=} opt_index - * @return {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenBalanceRequest} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.prototype.addIdentityTokenBalances = function(opt_value, opt_index) { - return jspb.Message.addToRepeatedWrapperField(this, 5, opt_value, proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenBalanceRequest, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - * @return {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0} returns this - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.prototype.clearIdentityTokenBalancesList = function() { - return this.setIdentityTokenBalancesList([]); -}; - - -/** - * repeated IdentityTokenInfoRequest identity_token_infos = 6; - * @return {!Array} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.prototype.getIdentityTokenInfosList = function() { - return /** @type{!Array} */ ( - jspb.Message.getRepeatedWrapperField(this, proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenInfoRequest, 6)); -}; - - -/** - * @param {!Array} value - * @return {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0} returns this -*/ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.prototype.setIdentityTokenInfosList = function(value) { - return jspb.Message.setRepeatedWrapperField(this, 6, value); -}; - - -/** - * @param {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenInfoRequest=} opt_value - * @param {number=} opt_index - * @return {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenInfoRequest} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.prototype.addIdentityTokenInfos = function(opt_value, opt_index) { - return jspb.Message.addToRepeatedWrapperField(this, 6, opt_value, proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenInfoRequest, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - * @return {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0} returns this - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.prototype.clearIdentityTokenInfosList = function() { - return this.setIdentityTokenInfosList([]); -}; - - -/** - * repeated TokenStatusRequest token_statuses = 7; - * @return {!Array} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.prototype.getTokenStatusesList = function() { - return /** @type{!Array} */ ( - jspb.Message.getRepeatedWrapperField(this, proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.TokenStatusRequest, 7)); -}; - - -/** - * @param {!Array} value - * @return {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0} returns this -*/ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.prototype.setTokenStatusesList = function(value) { - return jspb.Message.setRepeatedWrapperField(this, 7, value); -}; - - -/** - * @param {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.TokenStatusRequest=} opt_value - * @param {number=} opt_index - * @return {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.TokenStatusRequest} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.prototype.addTokenStatuses = function(opt_value, opt_index) { - return jspb.Message.addToRepeatedWrapperField(this, 7, opt_value, proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.TokenStatusRequest, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - * @return {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0} returns this - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.prototype.clearTokenStatusesList = function() { - return this.setTokenStatusesList([]); -}; - - -/** - * optional GetProofsRequestV0 v0 = 1; - * @return {?proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.prototype.getV0 = function() { - return /** @type{?proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0} */ ( - jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0, 1)); -}; - - -/** - * @param {?proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0|undefined} value - * @return {!proto.org.dash.platform.dapi.v0.GetProofsRequest} returns this -*/ -proto.org.dash.platform.dapi.v0.GetProofsRequest.prototype.setV0 = function(value) { - return jspb.Message.setOneofWrapperField(this, 1, proto.org.dash.platform.dapi.v0.GetProofsRequest.oneofGroups_[0], value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.org.dash.platform.dapi.v0.GetProofsRequest} returns this - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.prototype.clearV0 = function() { - return this.setV0(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.prototype.hasV0 = function() { - return jspb.Message.getField(this, 1) != null; -}; - - - -/** - * Oneof group definitions for this message. Each group defines the field - * numbers belonging to that group. When of these fields' value is set, all - * other fields in the group are cleared. During deserialization, if multiple - * fields are encountered for a group, only the last value seen will be kept. - * @private {!Array>} - * @const - */ -proto.org.dash.platform.dapi.v0.GetProofsResponse.oneofGroups_ = [[1]]; - -/** - * @enum {number} - */ -proto.org.dash.platform.dapi.v0.GetProofsResponse.VersionCase = { - VERSION_NOT_SET: 0, - V0: 1 -}; - -/** - * @return {proto.org.dash.platform.dapi.v0.GetProofsResponse.VersionCase} - */ -proto.org.dash.platform.dapi.v0.GetProofsResponse.prototype.getVersionCase = function() { - return /** @type {proto.org.dash.platform.dapi.v0.GetProofsResponse.VersionCase} */(jspb.Message.computeOneofCase(this, proto.org.dash.platform.dapi.v0.GetProofsResponse.oneofGroups_[0])); -}; - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.org.dash.platform.dapi.v0.GetProofsResponse.prototype.toObject = function(opt_includeInstance) { - return proto.org.dash.platform.dapi.v0.GetProofsResponse.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.org.dash.platform.dapi.v0.GetProofsResponse} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.org.dash.platform.dapi.v0.GetProofsResponse.toObject = function(includeInstance, msg) { - var f, obj = { - v0: (f = msg.getV0()) && proto.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0.toObject(includeInstance, f) - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.org.dash.platform.dapi.v0.GetProofsResponse} - */ -proto.org.dash.platform.dapi.v0.GetProofsResponse.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.org.dash.platform.dapi.v0.GetProofsResponse; - return proto.org.dash.platform.dapi.v0.GetProofsResponse.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.org.dash.platform.dapi.v0.GetProofsResponse} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.org.dash.platform.dapi.v0.GetProofsResponse} - */ -proto.org.dash.platform.dapi.v0.GetProofsResponse.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = new proto.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0; - reader.readMessage(value,proto.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0.deserializeBinaryFromReader); - msg.setV0(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.org.dash.platform.dapi.v0.GetProofsResponse.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.org.dash.platform.dapi.v0.GetProofsResponse.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.org.dash.platform.dapi.v0.GetProofsResponse} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.org.dash.platform.dapi.v0.GetProofsResponse.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getV0(); - if (f != null) { - writer.writeMessage( - 1, - f, - proto.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0.serializeBinaryToWriter - ); - } -}; - - - -/** - * Oneof group definitions for this message. Each group defines the field - * numbers belonging to that group. When of these fields' value is set, all - * other fields in the group are cleared. During deserialization, if multiple - * fields are encountered for a group, only the last value seen will be kept. - * @private {!Array>} - * @const - */ -proto.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0.oneofGroups_ = [[1]]; - -/** - * @enum {number} - */ -proto.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0.ResultCase = { - RESULT_NOT_SET: 0, - PROOF: 1 -}; - -/** - * @return {proto.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0.ResultCase} - */ -proto.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0.prototype.getResultCase = function() { - return /** @type {proto.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0.ResultCase} */(jspb.Message.computeOneofCase(this, proto.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0.oneofGroups_[0])); -}; - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0.prototype.toObject = function(opt_includeInstance) { - return proto.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0.toObject = function(includeInstance, msg) { - var f, obj = { - proof: (f = msg.getProof()) && proto.org.dash.platform.dapi.v0.Proof.toObject(includeInstance, f), - metadata: (f = msg.getMetadata()) && proto.org.dash.platform.dapi.v0.ResponseMetadata.toObject(includeInstance, f) - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0} - */ -proto.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0; - return proto.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0} - */ -proto.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = new proto.org.dash.platform.dapi.v0.Proof; - reader.readMessage(value,proto.org.dash.platform.dapi.v0.Proof.deserializeBinaryFromReader); - msg.setProof(value); - break; - case 2: - var value = new proto.org.dash.platform.dapi.v0.ResponseMetadata; - reader.readMessage(value,proto.org.dash.platform.dapi.v0.ResponseMetadata.deserializeBinaryFromReader); - msg.setMetadata(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getProof(); - if (f != null) { - writer.writeMessage( - 1, - f, - proto.org.dash.platform.dapi.v0.Proof.serializeBinaryToWriter - ); - } - f = message.getMetadata(); - if (f != null) { - writer.writeMessage( - 2, - f, - proto.org.dash.platform.dapi.v0.ResponseMetadata.serializeBinaryToWriter - ); - } -}; - - -/** - * optional Proof proof = 1; - * @return {?proto.org.dash.platform.dapi.v0.Proof} - */ -proto.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0.prototype.getProof = function() { - return /** @type{?proto.org.dash.platform.dapi.v0.Proof} */ ( - jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.Proof, 1)); -}; - - -/** - * @param {?proto.org.dash.platform.dapi.v0.Proof|undefined} value - * @return {!proto.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0} returns this -*/ -proto.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0.prototype.setProof = function(value) { - return jspb.Message.setOneofWrapperField(this, 1, proto.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0.oneofGroups_[0], value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0} returns this - */ -proto.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0.prototype.clearProof = function() { - return this.setProof(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0.prototype.hasProof = function() { - return jspb.Message.getField(this, 1) != null; -}; - - -/** - * optional ResponseMetadata metadata = 2; - * @return {?proto.org.dash.platform.dapi.v0.ResponseMetadata} - */ -proto.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0.prototype.getMetadata = function() { - return /** @type{?proto.org.dash.platform.dapi.v0.ResponseMetadata} */ ( - jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.ResponseMetadata, 2)); -}; - - -/** - * @param {?proto.org.dash.platform.dapi.v0.ResponseMetadata|undefined} value - * @return {!proto.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0} returns this -*/ -proto.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0.prototype.setMetadata = function(value) { - return jspb.Message.setWrapperField(this, 2, value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0} returns this - */ -proto.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0.prototype.clearMetadata = function() { - return this.setMetadata(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0.prototype.hasMetadata = function() { - return jspb.Message.getField(this, 2) != null; -}; - - -/** - * optional GetProofsResponseV0 v0 = 1; - * @return {?proto.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0} - */ -proto.org.dash.platform.dapi.v0.GetProofsResponse.prototype.getV0 = function() { - return /** @type{?proto.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0} */ ( - jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0, 1)); -}; - - -/** - * @param {?proto.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0|undefined} value - * @return {!proto.org.dash.platform.dapi.v0.GetProofsResponse} returns this -*/ -proto.org.dash.platform.dapi.v0.GetProofsResponse.prototype.setV0 = function(value) { - return jspb.Message.setOneofWrapperField(this, 1, proto.org.dash.platform.dapi.v0.GetProofsResponse.oneofGroups_[0], value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.org.dash.platform.dapi.v0.GetProofsResponse} returns this - */ -proto.org.dash.platform.dapi.v0.GetProofsResponse.prototype.clearV0 = function() { - return this.setV0(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.org.dash.platform.dapi.v0.GetProofsResponse.prototype.hasV0 = function() { - return jspb.Message.getField(this, 1) != null; -}; - - - /** * Oneof group definitions for this message. Each group defines the field * numbers belonging to that group. When of these fields' value is set, all diff --git a/packages/dapi-grpc/clients/platform/v0/objective-c/Platform.pbobjc.h b/packages/dapi-grpc/clients/platform/v0/objective-c/Platform.pbobjc.h index 88b3f2576d5..a6b460444f1 100644 --- a/packages/dapi-grpc/clients/platform/v0/objective-c/Platform.pbobjc.h +++ b/packages/dapi-grpc/clients/platform/v0/objective-c/Platform.pbobjc.h @@ -161,16 +161,6 @@ CF_EXTERN_C_BEGIN @class GetPathElementsResponse_GetPathElementsResponseV0_Elements; @class GetPrefundedSpecializedBalanceRequest_GetPrefundedSpecializedBalanceRequestV0; @class GetPrefundedSpecializedBalanceResponse_GetPrefundedSpecializedBalanceResponseV0; -@class GetProofsRequest_GetProofsRequestV0; -@class GetProofsRequest_GetProofsRequestV0_ContractRequest; -@class GetProofsRequest_GetProofsRequestV0_DocumentRequest; -@class GetProofsRequest_GetProofsRequestV0_IdentityRequest; -@class GetProofsRequest_GetProofsRequestV0_IdentityTokenBalanceRequest; -@class GetProofsRequest_GetProofsRequestV0_IdentityTokenInfoRequest; -@class GetProofsRequest_GetProofsRequestV0_TokenStatusRequest; -@class GetProofsRequest_GetProofsRequestV0_VoteStatusRequest; -@class GetProofsRequest_GetProofsRequestV0_VoteStatusRequest_ContestedResourceVoteStatusRequest; -@class GetProofsResponse_GetProofsResponseV0; @class GetProtocolVersionUpgradeStateRequest_GetProtocolVersionUpgradeStateRequestV0; @class GetProtocolVersionUpgradeStateResponse_GetProtocolVersionUpgradeStateResponseV0; @class GetProtocolVersionUpgradeStateResponse_GetProtocolVersionUpgradeStateResponseV0_VersionEntry; @@ -272,58 +262,6 @@ GPBEnumDescriptor *SecurityLevelMap_KeyKindRequestType_EnumDescriptor(void); **/ BOOL SecurityLevelMap_KeyKindRequestType_IsValidValue(int32_t value); -#pragma mark - Enum GetProofsRequest_GetProofsRequestV0_DocumentRequest_DocumentContestedStatus - -typedef GPB_ENUM(GetProofsRequest_GetProofsRequestV0_DocumentRequest_DocumentContestedStatus) { - /** - * Value used if any message's field encounters a value that is not defined - * by this enum. The message will also have C functions to get/set the rawValue - * of the field. - **/ - GetProofsRequest_GetProofsRequestV0_DocumentRequest_DocumentContestedStatus_GPBUnrecognizedEnumeratorValue = kGPBUnrecognizedEnumeratorValue, - GetProofsRequest_GetProofsRequestV0_DocumentRequest_DocumentContestedStatus_NotContested = 0, - GetProofsRequest_GetProofsRequestV0_DocumentRequest_DocumentContestedStatus_MaybeContested = 1, - GetProofsRequest_GetProofsRequestV0_DocumentRequest_DocumentContestedStatus_Contested = 2, -}; - -GPBEnumDescriptor *GetProofsRequest_GetProofsRequestV0_DocumentRequest_DocumentContestedStatus_EnumDescriptor(void); - -/** - * Checks to see if the given value is defined by the enum or was not known at - * the time this source was generated. - **/ -BOOL GetProofsRequest_GetProofsRequestV0_DocumentRequest_DocumentContestedStatus_IsValidValue(int32_t value); - -#pragma mark - Enum GetProofsRequest_GetProofsRequestV0_IdentityRequest_Type - -typedef GPB_ENUM(GetProofsRequest_GetProofsRequestV0_IdentityRequest_Type) { - /** - * Value used if any message's field encounters a value that is not defined - * by this enum. The message will also have C functions to get/set the rawValue - * of the field. - **/ - GetProofsRequest_GetProofsRequestV0_IdentityRequest_Type_GPBUnrecognizedEnumeratorValue = kGPBUnrecognizedEnumeratorValue, - /** Request for the full identity */ - GetProofsRequest_GetProofsRequestV0_IdentityRequest_Type_FullIdentity = 0, - - /** Request for the identity's balance */ - GetProofsRequest_GetProofsRequestV0_IdentityRequest_Type_Balance = 1, - - /** Request for the identity's keys */ - GetProofsRequest_GetProofsRequestV0_IdentityRequest_Type_Keys = 2, - - /** Request for the identity's revision */ - GetProofsRequest_GetProofsRequestV0_IdentityRequest_Type_Revision = 3, -}; - -GPBEnumDescriptor *GetProofsRequest_GetProofsRequestV0_IdentityRequest_Type_EnumDescriptor(void); - -/** - * Checks to see if the given value is defined by the enum or was not known at - * the time this source was generated. - **/ -BOOL GetProofsRequest_GetProofsRequestV0_IdentityRequest_Type_IsValidValue(int32_t value); - #pragma mark - Enum GetContestedResourceVoteStateRequest_GetContestedResourceVoteStateRequestV0_ResultType typedef GPB_ENUM(GetContestedResourceVoteStateRequest_GetContestedResourceVoteStateRequestV0_ResultType) { @@ -1838,314 +1776,6 @@ GPB_FINAL @interface GetIdentitiesBalancesResponse_GetIdentitiesBalancesResponse @end -#pragma mark - GetProofsRequest - -typedef GPB_ENUM(GetProofsRequest_FieldNumber) { - GetProofsRequest_FieldNumber_V0 = 1, -}; - -typedef GPB_ENUM(GetProofsRequest_Version_OneOfCase) { - GetProofsRequest_Version_OneOfCase_GPBUnsetOneOfCase = 0, - GetProofsRequest_Version_OneOfCase_V0 = 1, -}; - -GPB_FINAL @interface GetProofsRequest : GPBMessage - -@property(nonatomic, readonly) GetProofsRequest_Version_OneOfCase versionOneOfCase; - -@property(nonatomic, readwrite, strong, null_resettable) GetProofsRequest_GetProofsRequestV0 *v0; - -@end - -/** - * Clears whatever value was set for the oneof 'version'. - **/ -void GetProofsRequest_ClearVersionOneOfCase(GetProofsRequest *message); - -#pragma mark - GetProofsRequest_GetProofsRequestV0 - -typedef GPB_ENUM(GetProofsRequest_GetProofsRequestV0_FieldNumber) { - GetProofsRequest_GetProofsRequestV0_FieldNumber_IdentitiesArray = 1, - GetProofsRequest_GetProofsRequestV0_FieldNumber_ContractsArray = 2, - GetProofsRequest_GetProofsRequestV0_FieldNumber_DocumentsArray = 3, - GetProofsRequest_GetProofsRequestV0_FieldNumber_VotesArray = 4, - GetProofsRequest_GetProofsRequestV0_FieldNumber_IdentityTokenBalancesArray = 5, - GetProofsRequest_GetProofsRequestV0_FieldNumber_IdentityTokenInfosArray = 6, - GetProofsRequest_GetProofsRequestV0_FieldNumber_TokenStatusesArray = 7, -}; - -GPB_FINAL @interface GetProofsRequest_GetProofsRequestV0 : GPBMessage - -/** List of identity requests */ -@property(nonatomic, readwrite, strong, null_resettable) NSMutableArray *identitiesArray; -/** The number of items in @c identitiesArray without causing the array to be created. */ -@property(nonatomic, readonly) NSUInteger identitiesArray_Count; - -/** List of contract requests */ -@property(nonatomic, readwrite, strong, null_resettable) NSMutableArray *contractsArray; -/** The number of items in @c contractsArray without causing the array to be created. */ -@property(nonatomic, readonly) NSUInteger contractsArray_Count; - -/** List of document requests */ -@property(nonatomic, readwrite, strong, null_resettable) NSMutableArray *documentsArray; -/** The number of items in @c documentsArray without causing the array to be created. */ -@property(nonatomic, readonly) NSUInteger documentsArray_Count; - -@property(nonatomic, readwrite, strong, null_resettable) NSMutableArray *votesArray; -/** The number of items in @c votesArray without causing the array to be created. */ -@property(nonatomic, readonly) NSUInteger votesArray_Count; - -@property(nonatomic, readwrite, strong, null_resettable) NSMutableArray *identityTokenBalancesArray; -/** The number of items in @c identityTokenBalancesArray without causing the array to be created. */ -@property(nonatomic, readonly) NSUInteger identityTokenBalancesArray_Count; - -@property(nonatomic, readwrite, strong, null_resettable) NSMutableArray *identityTokenInfosArray; -/** The number of items in @c identityTokenInfosArray without causing the array to be created. */ -@property(nonatomic, readonly) NSUInteger identityTokenInfosArray_Count; - -@property(nonatomic, readwrite, strong, null_resettable) NSMutableArray *tokenStatusesArray; -/** The number of items in @c tokenStatusesArray without causing the array to be created. */ -@property(nonatomic, readonly) NSUInteger tokenStatusesArray_Count; - -@end - -#pragma mark - GetProofsRequest_GetProofsRequestV0_DocumentRequest - -typedef GPB_ENUM(GetProofsRequest_GetProofsRequestV0_DocumentRequest_FieldNumber) { - GetProofsRequest_GetProofsRequestV0_DocumentRequest_FieldNumber_ContractId = 1, - GetProofsRequest_GetProofsRequestV0_DocumentRequest_FieldNumber_DocumentType = 2, - GetProofsRequest_GetProofsRequestV0_DocumentRequest_FieldNumber_DocumentTypeKeepsHistory = 3, - GetProofsRequest_GetProofsRequestV0_DocumentRequest_FieldNumber_DocumentId = 4, - GetProofsRequest_GetProofsRequestV0_DocumentRequest_FieldNumber_DocumentContestedStatus = 5, -}; - -/** - * DocumentRequest specifies a request for a document proof - **/ -GPB_FINAL @interface GetProofsRequest_GetProofsRequestV0_DocumentRequest : GPBMessage - -/** ID of the contract the document belongs to */ -@property(nonatomic, readwrite, copy, null_resettable) NSData *contractId; - -/** Type of document being requested */ -@property(nonatomic, readwrite, copy, null_resettable) NSString *documentType; - -/** Indicates if the document type keeps a history of changes */ -@property(nonatomic, readwrite) BOOL documentTypeKeepsHistory; - -/** ID of the specific document being requested */ -@property(nonatomic, readwrite, copy, null_resettable) NSData *documentId; - -@property(nonatomic, readwrite) GetProofsRequest_GetProofsRequestV0_DocumentRequest_DocumentContestedStatus documentContestedStatus; - -@end - -/** - * Fetches the raw value of a @c GetProofsRequest_GetProofsRequestV0_DocumentRequest's @c documentContestedStatus property, even - * if the value was not defined by the enum at the time the code was generated. - **/ -int32_t GetProofsRequest_GetProofsRequestV0_DocumentRequest_DocumentContestedStatus_RawValue(GetProofsRequest_GetProofsRequestV0_DocumentRequest *message); -/** - * Sets the raw value of an @c GetProofsRequest_GetProofsRequestV0_DocumentRequest's @c documentContestedStatus property, allowing - * it to be set to a value that was not defined by the enum at the time the code - * was generated. - **/ -void SetGetProofsRequest_GetProofsRequestV0_DocumentRequest_DocumentContestedStatus_RawValue(GetProofsRequest_GetProofsRequestV0_DocumentRequest *message, int32_t value); - -#pragma mark - GetProofsRequest_GetProofsRequestV0_IdentityRequest - -typedef GPB_ENUM(GetProofsRequest_GetProofsRequestV0_IdentityRequest_FieldNumber) { - GetProofsRequest_GetProofsRequestV0_IdentityRequest_FieldNumber_IdentityId = 1, - GetProofsRequest_GetProofsRequestV0_IdentityRequest_FieldNumber_RequestType = 2, -}; - -/** - * IdentityRequest specifies a request for an identity proof - **/ -GPB_FINAL @interface GetProofsRequest_GetProofsRequestV0_IdentityRequest : GPBMessage - -/** ID of the identity for which the proof is requested */ -@property(nonatomic, readwrite, copy, null_resettable) NSData *identityId; - -/** Type of identity request */ -@property(nonatomic, readwrite) GetProofsRequest_GetProofsRequestV0_IdentityRequest_Type requestType; - -@end - -/** - * Fetches the raw value of a @c GetProofsRequest_GetProofsRequestV0_IdentityRequest's @c requestType property, even - * if the value was not defined by the enum at the time the code was generated. - **/ -int32_t GetProofsRequest_GetProofsRequestV0_IdentityRequest_RequestType_RawValue(GetProofsRequest_GetProofsRequestV0_IdentityRequest *message); -/** - * Sets the raw value of an @c GetProofsRequest_GetProofsRequestV0_IdentityRequest's @c requestType property, allowing - * it to be set to a value that was not defined by the enum at the time the code - * was generated. - **/ -void SetGetProofsRequest_GetProofsRequestV0_IdentityRequest_RequestType_RawValue(GetProofsRequest_GetProofsRequestV0_IdentityRequest *message, int32_t value); - -#pragma mark - GetProofsRequest_GetProofsRequestV0_ContractRequest - -typedef GPB_ENUM(GetProofsRequest_GetProofsRequestV0_ContractRequest_FieldNumber) { - GetProofsRequest_GetProofsRequestV0_ContractRequest_FieldNumber_ContractId = 1, -}; - -/** - * ContractRequest specifies a request for a data contract proof. - **/ -GPB_FINAL @interface GetProofsRequest_GetProofsRequestV0_ContractRequest : GPBMessage - -@property(nonatomic, readwrite, copy, null_resettable) NSData *contractId; - -@end - -#pragma mark - GetProofsRequest_GetProofsRequestV0_VoteStatusRequest - -typedef GPB_ENUM(GetProofsRequest_GetProofsRequestV0_VoteStatusRequest_FieldNumber) { - GetProofsRequest_GetProofsRequestV0_VoteStatusRequest_FieldNumber_ContestedResourceVoteStatusRequest = 1, -}; - -typedef GPB_ENUM(GetProofsRequest_GetProofsRequestV0_VoteStatusRequest_RequestType_OneOfCase) { - GetProofsRequest_GetProofsRequestV0_VoteStatusRequest_RequestType_OneOfCase_GPBUnsetOneOfCase = 0, - GetProofsRequest_GetProofsRequestV0_VoteStatusRequest_RequestType_OneOfCase_ContestedResourceVoteStatusRequest = 1, -}; - -GPB_FINAL @interface GetProofsRequest_GetProofsRequestV0_VoteStatusRequest : GPBMessage - -@property(nonatomic, readonly) GetProofsRequest_GetProofsRequestV0_VoteStatusRequest_RequestType_OneOfCase requestTypeOneOfCase; - -@property(nonatomic, readwrite, strong, null_resettable) GetProofsRequest_GetProofsRequestV0_VoteStatusRequest_ContestedResourceVoteStatusRequest *contestedResourceVoteStatusRequest; - -@end - -/** - * Clears whatever value was set for the oneof 'requestType'. - **/ -void GetProofsRequest_GetProofsRequestV0_VoteStatusRequest_ClearRequestTypeOneOfCase(GetProofsRequest_GetProofsRequestV0_VoteStatusRequest *message); - -#pragma mark - GetProofsRequest_GetProofsRequestV0_VoteStatusRequest_ContestedResourceVoteStatusRequest - -typedef GPB_ENUM(GetProofsRequest_GetProofsRequestV0_VoteStatusRequest_ContestedResourceVoteStatusRequest_FieldNumber) { - GetProofsRequest_GetProofsRequestV0_VoteStatusRequest_ContestedResourceVoteStatusRequest_FieldNumber_ContractId = 1, - GetProofsRequest_GetProofsRequestV0_VoteStatusRequest_ContestedResourceVoteStatusRequest_FieldNumber_DocumentTypeName = 2, - GetProofsRequest_GetProofsRequestV0_VoteStatusRequest_ContestedResourceVoteStatusRequest_FieldNumber_IndexName = 3, - GetProofsRequest_GetProofsRequestV0_VoteStatusRequest_ContestedResourceVoteStatusRequest_FieldNumber_IndexValuesArray = 4, - GetProofsRequest_GetProofsRequestV0_VoteStatusRequest_ContestedResourceVoteStatusRequest_FieldNumber_VoterIdentifier = 5, -}; - -GPB_FINAL @interface GetProofsRequest_GetProofsRequestV0_VoteStatusRequest_ContestedResourceVoteStatusRequest : GPBMessage - -@property(nonatomic, readwrite, copy, null_resettable) NSData *contractId; - -@property(nonatomic, readwrite, copy, null_resettable) NSString *documentTypeName; - -@property(nonatomic, readwrite, copy, null_resettable) NSString *indexName; - -@property(nonatomic, readwrite, strong, null_resettable) NSMutableArray *indexValuesArray; -/** The number of items in @c indexValuesArray without causing the array to be created. */ -@property(nonatomic, readonly) NSUInteger indexValuesArray_Count; - -@property(nonatomic, readwrite, copy, null_resettable) NSData *voterIdentifier; - -@end - -#pragma mark - GetProofsRequest_GetProofsRequestV0_IdentityTokenBalanceRequest - -typedef GPB_ENUM(GetProofsRequest_GetProofsRequestV0_IdentityTokenBalanceRequest_FieldNumber) { - GetProofsRequest_GetProofsRequestV0_IdentityTokenBalanceRequest_FieldNumber_TokenId = 1, - GetProofsRequest_GetProofsRequestV0_IdentityTokenBalanceRequest_FieldNumber_IdentityId = 2, -}; - -GPB_FINAL @interface GetProofsRequest_GetProofsRequestV0_IdentityTokenBalanceRequest : GPBMessage - -@property(nonatomic, readwrite, copy, null_resettable) NSData *tokenId; - -@property(nonatomic, readwrite, copy, null_resettable) NSData *identityId; - -@end - -#pragma mark - GetProofsRequest_GetProofsRequestV0_IdentityTokenInfoRequest - -typedef GPB_ENUM(GetProofsRequest_GetProofsRequestV0_IdentityTokenInfoRequest_FieldNumber) { - GetProofsRequest_GetProofsRequestV0_IdentityTokenInfoRequest_FieldNumber_TokenId = 1, - GetProofsRequest_GetProofsRequestV0_IdentityTokenInfoRequest_FieldNumber_IdentityId = 2, -}; - -GPB_FINAL @interface GetProofsRequest_GetProofsRequestV0_IdentityTokenInfoRequest : GPBMessage - -@property(nonatomic, readwrite, copy, null_resettable) NSData *tokenId; - -@property(nonatomic, readwrite, copy, null_resettable) NSData *identityId; - -@end - -#pragma mark - GetProofsRequest_GetProofsRequestV0_TokenStatusRequest - -typedef GPB_ENUM(GetProofsRequest_GetProofsRequestV0_TokenStatusRequest_FieldNumber) { - GetProofsRequest_GetProofsRequestV0_TokenStatusRequest_FieldNumber_TokenId = 1, -}; - -GPB_FINAL @interface GetProofsRequest_GetProofsRequestV0_TokenStatusRequest : GPBMessage - -@property(nonatomic, readwrite, copy, null_resettable) NSData *tokenId; - -@end - -#pragma mark - GetProofsResponse - -typedef GPB_ENUM(GetProofsResponse_FieldNumber) { - GetProofsResponse_FieldNumber_V0 = 1, -}; - -typedef GPB_ENUM(GetProofsResponse_Version_OneOfCase) { - GetProofsResponse_Version_OneOfCase_GPBUnsetOneOfCase = 0, - GetProofsResponse_Version_OneOfCase_V0 = 1, -}; - -GPB_FINAL @interface GetProofsResponse : GPBMessage - -@property(nonatomic, readonly) GetProofsResponse_Version_OneOfCase versionOneOfCase; - -@property(nonatomic, readwrite, strong, null_resettable) GetProofsResponse_GetProofsResponseV0 *v0; - -@end - -/** - * Clears whatever value was set for the oneof 'version'. - **/ -void GetProofsResponse_ClearVersionOneOfCase(GetProofsResponse *message); - -#pragma mark - GetProofsResponse_GetProofsResponseV0 - -typedef GPB_ENUM(GetProofsResponse_GetProofsResponseV0_FieldNumber) { - GetProofsResponse_GetProofsResponseV0_FieldNumber_Proof = 1, - GetProofsResponse_GetProofsResponseV0_FieldNumber_Metadata = 2, -}; - -typedef GPB_ENUM(GetProofsResponse_GetProofsResponseV0_Result_OneOfCase) { - GetProofsResponse_GetProofsResponseV0_Result_OneOfCase_GPBUnsetOneOfCase = 0, - GetProofsResponse_GetProofsResponseV0_Result_OneOfCase_Proof = 1, -}; - -GPB_FINAL @interface GetProofsResponse_GetProofsResponseV0 : GPBMessage - -@property(nonatomic, readonly) GetProofsResponse_GetProofsResponseV0_Result_OneOfCase resultOneOfCase; - -/** Cryptographic proof for the requested data */ -@property(nonatomic, readwrite, strong, null_resettable) Proof *proof; - -/** Metadata about the blockchain state */ -@property(nonatomic, readwrite, strong, null_resettable) ResponseMetadata *metadata; -/** Test to see if @c metadata has been set. */ -@property(nonatomic, readwrite) BOOL hasMetadata; - -@end - -/** - * Clears whatever value was set for the oneof 'result'. - **/ -void GetProofsResponse_GetProofsResponseV0_ClearResultOneOfCase(GetProofsResponse_GetProofsResponseV0 *message); - #pragma mark - GetDataContractRequest typedef GPB_ENUM(GetDataContractRequest_FieldNumber) { diff --git a/packages/dapi-grpc/clients/platform/v0/objective-c/Platform.pbobjc.m b/packages/dapi-grpc/clients/platform/v0/objective-c/Platform.pbobjc.m index bc611b4ac7a..889a653fbc2 100644 --- a/packages/dapi-grpc/clients/platform/v0/objective-c/Platform.pbobjc.m +++ b/packages/dapi-grpc/clients/platform/v0/objective-c/Platform.pbobjc.m @@ -224,18 +224,6 @@ GPBObjCClassDeclaration(GetPrefundedSpecializedBalanceRequest_GetPrefundedSpecializedBalanceRequestV0); GPBObjCClassDeclaration(GetPrefundedSpecializedBalanceResponse); GPBObjCClassDeclaration(GetPrefundedSpecializedBalanceResponse_GetPrefundedSpecializedBalanceResponseV0); -GPBObjCClassDeclaration(GetProofsRequest); -GPBObjCClassDeclaration(GetProofsRequest_GetProofsRequestV0); -GPBObjCClassDeclaration(GetProofsRequest_GetProofsRequestV0_ContractRequest); -GPBObjCClassDeclaration(GetProofsRequest_GetProofsRequestV0_DocumentRequest); -GPBObjCClassDeclaration(GetProofsRequest_GetProofsRequestV0_IdentityRequest); -GPBObjCClassDeclaration(GetProofsRequest_GetProofsRequestV0_IdentityTokenBalanceRequest); -GPBObjCClassDeclaration(GetProofsRequest_GetProofsRequestV0_IdentityTokenInfoRequest); -GPBObjCClassDeclaration(GetProofsRequest_GetProofsRequestV0_TokenStatusRequest); -GPBObjCClassDeclaration(GetProofsRequest_GetProofsRequestV0_VoteStatusRequest); -GPBObjCClassDeclaration(GetProofsRequest_GetProofsRequestV0_VoteStatusRequest_ContestedResourceVoteStatusRequest); -GPBObjCClassDeclaration(GetProofsResponse); -GPBObjCClassDeclaration(GetProofsResponse_GetProofsResponseV0); GPBObjCClassDeclaration(GetProtocolVersionUpgradeStateRequest); GPBObjCClassDeclaration(GetProtocolVersionUpgradeStateRequest_GetProtocolVersionUpgradeStateRequestV0); GPBObjCClassDeclaration(GetProtocolVersionUpgradeStateResponse); @@ -3973,901 +3961,6 @@ + (GPBDescriptor *)descriptor { @end -#pragma mark - GetProofsRequest - -@implementation GetProofsRequest - -@dynamic versionOneOfCase; -@dynamic v0; - -typedef struct GetProofsRequest__storage_ { - uint32_t _has_storage_[2]; - GetProofsRequest_GetProofsRequestV0 *v0; -} GetProofsRequest__storage_; - -// This method is threadsafe because it is initially called -// in +initialize for each subclass. -+ (GPBDescriptor *)descriptor { - static GPBDescriptor *descriptor = nil; - if (!descriptor) { - static GPBMessageFieldDescription fields[] = { - { - .name = "v0", - .dataTypeSpecific.clazz = GPBObjCClass(GetProofsRequest_GetProofsRequestV0), - .number = GetProofsRequest_FieldNumber_V0, - .hasIndex = -1, - .offset = (uint32_t)offsetof(GetProofsRequest__storage_, v0), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeMessage, - }, - }; - GPBDescriptor *localDescriptor = - [GPBDescriptor allocDescriptorForClass:[GetProofsRequest class] - rootClass:[PlatformRoot class] - file:PlatformRoot_FileDescriptor() - fields:fields - fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) - storageSize:sizeof(GetProofsRequest__storage_) - flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown)]; - static const char *oneofs[] = { - "version", - }; - [localDescriptor setupOneofs:oneofs - count:(uint32_t)(sizeof(oneofs) / sizeof(char*)) - firstHasIndex:-1]; - #if defined(DEBUG) && DEBUG - NSAssert(descriptor == nil, @"Startup recursed!"); - #endif // DEBUG - descriptor = localDescriptor; - } - return descriptor; -} - -@end - -void GetProofsRequest_ClearVersionOneOfCase(GetProofsRequest *message) { - GPBDescriptor *descriptor = [GetProofsRequest descriptor]; - GPBOneofDescriptor *oneof = [descriptor.oneofs objectAtIndex:0]; - GPBClearOneof(message, oneof); -} -#pragma mark - GetProofsRequest_GetProofsRequestV0 - -@implementation GetProofsRequest_GetProofsRequestV0 - -@dynamic identitiesArray, identitiesArray_Count; -@dynamic contractsArray, contractsArray_Count; -@dynamic documentsArray, documentsArray_Count; -@dynamic votesArray, votesArray_Count; -@dynamic identityTokenBalancesArray, identityTokenBalancesArray_Count; -@dynamic identityTokenInfosArray, identityTokenInfosArray_Count; -@dynamic tokenStatusesArray, tokenStatusesArray_Count; - -typedef struct GetProofsRequest_GetProofsRequestV0__storage_ { - uint32_t _has_storage_[1]; - NSMutableArray *identitiesArray; - NSMutableArray *contractsArray; - NSMutableArray *documentsArray; - NSMutableArray *votesArray; - NSMutableArray *identityTokenBalancesArray; - NSMutableArray *identityTokenInfosArray; - NSMutableArray *tokenStatusesArray; -} GetProofsRequest_GetProofsRequestV0__storage_; - -// This method is threadsafe because it is initially called -// in +initialize for each subclass. -+ (GPBDescriptor *)descriptor { - static GPBDescriptor *descriptor = nil; - if (!descriptor) { - static GPBMessageFieldDescription fields[] = { - { - .name = "identitiesArray", - .dataTypeSpecific.clazz = GPBObjCClass(GetProofsRequest_GetProofsRequestV0_IdentityRequest), - .number = GetProofsRequest_GetProofsRequestV0_FieldNumber_IdentitiesArray, - .hasIndex = GPBNoHasBit, - .offset = (uint32_t)offsetof(GetProofsRequest_GetProofsRequestV0__storage_, identitiesArray), - .flags = GPBFieldRepeated, - .dataType = GPBDataTypeMessage, - }, - { - .name = "contractsArray", - .dataTypeSpecific.clazz = GPBObjCClass(GetProofsRequest_GetProofsRequestV0_ContractRequest), - .number = GetProofsRequest_GetProofsRequestV0_FieldNumber_ContractsArray, - .hasIndex = GPBNoHasBit, - .offset = (uint32_t)offsetof(GetProofsRequest_GetProofsRequestV0__storage_, contractsArray), - .flags = GPBFieldRepeated, - .dataType = GPBDataTypeMessage, - }, - { - .name = "documentsArray", - .dataTypeSpecific.clazz = GPBObjCClass(GetProofsRequest_GetProofsRequestV0_DocumentRequest), - .number = GetProofsRequest_GetProofsRequestV0_FieldNumber_DocumentsArray, - .hasIndex = GPBNoHasBit, - .offset = (uint32_t)offsetof(GetProofsRequest_GetProofsRequestV0__storage_, documentsArray), - .flags = GPBFieldRepeated, - .dataType = GPBDataTypeMessage, - }, - { - .name = "votesArray", - .dataTypeSpecific.clazz = GPBObjCClass(GetProofsRequest_GetProofsRequestV0_VoteStatusRequest), - .number = GetProofsRequest_GetProofsRequestV0_FieldNumber_VotesArray, - .hasIndex = GPBNoHasBit, - .offset = (uint32_t)offsetof(GetProofsRequest_GetProofsRequestV0__storage_, votesArray), - .flags = GPBFieldRepeated, - .dataType = GPBDataTypeMessage, - }, - { - .name = "identityTokenBalancesArray", - .dataTypeSpecific.clazz = GPBObjCClass(GetProofsRequest_GetProofsRequestV0_IdentityTokenBalanceRequest), - .number = GetProofsRequest_GetProofsRequestV0_FieldNumber_IdentityTokenBalancesArray, - .hasIndex = GPBNoHasBit, - .offset = (uint32_t)offsetof(GetProofsRequest_GetProofsRequestV0__storage_, identityTokenBalancesArray), - .flags = GPBFieldRepeated, - .dataType = GPBDataTypeMessage, - }, - { - .name = "identityTokenInfosArray", - .dataTypeSpecific.clazz = GPBObjCClass(GetProofsRequest_GetProofsRequestV0_IdentityTokenInfoRequest), - .number = GetProofsRequest_GetProofsRequestV0_FieldNumber_IdentityTokenInfosArray, - .hasIndex = GPBNoHasBit, - .offset = (uint32_t)offsetof(GetProofsRequest_GetProofsRequestV0__storage_, identityTokenInfosArray), - .flags = GPBFieldRepeated, - .dataType = GPBDataTypeMessage, - }, - { - .name = "tokenStatusesArray", - .dataTypeSpecific.clazz = GPBObjCClass(GetProofsRequest_GetProofsRequestV0_TokenStatusRequest), - .number = GetProofsRequest_GetProofsRequestV0_FieldNumber_TokenStatusesArray, - .hasIndex = GPBNoHasBit, - .offset = (uint32_t)offsetof(GetProofsRequest_GetProofsRequestV0__storage_, tokenStatusesArray), - .flags = GPBFieldRepeated, - .dataType = GPBDataTypeMessage, - }, - }; - GPBDescriptor *localDescriptor = - [GPBDescriptor allocDescriptorForClass:[GetProofsRequest_GetProofsRequestV0 class] - rootClass:[PlatformRoot class] - file:PlatformRoot_FileDescriptor() - fields:fields - fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) - storageSize:sizeof(GetProofsRequest_GetProofsRequestV0__storage_) - flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown)]; - [localDescriptor setupContainingMessageClass:GPBObjCClass(GetProofsRequest)]; - #if defined(DEBUG) && DEBUG - NSAssert(descriptor == nil, @"Startup recursed!"); - #endif // DEBUG - descriptor = localDescriptor; - } - return descriptor; -} - -@end - -#pragma mark - GetProofsRequest_GetProofsRequestV0_DocumentRequest - -@implementation GetProofsRequest_GetProofsRequestV0_DocumentRequest - -@dynamic contractId; -@dynamic documentType; -@dynamic documentTypeKeepsHistory; -@dynamic documentId; -@dynamic documentContestedStatus; - -typedef struct GetProofsRequest_GetProofsRequestV0_DocumentRequest__storage_ { - uint32_t _has_storage_[1]; - GetProofsRequest_GetProofsRequestV0_DocumentRequest_DocumentContestedStatus documentContestedStatus; - NSData *contractId; - NSString *documentType; - NSData *documentId; -} GetProofsRequest_GetProofsRequestV0_DocumentRequest__storage_; - -// This method is threadsafe because it is initially called -// in +initialize for each subclass. -+ (GPBDescriptor *)descriptor { - static GPBDescriptor *descriptor = nil; - if (!descriptor) { - static GPBMessageFieldDescription fields[] = { - { - .name = "contractId", - .dataTypeSpecific.clazz = Nil, - .number = GetProofsRequest_GetProofsRequestV0_DocumentRequest_FieldNumber_ContractId, - .hasIndex = 0, - .offset = (uint32_t)offsetof(GetProofsRequest_GetProofsRequestV0_DocumentRequest__storage_, contractId), - .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), - .dataType = GPBDataTypeBytes, - }, - { - .name = "documentType", - .dataTypeSpecific.clazz = Nil, - .number = GetProofsRequest_GetProofsRequestV0_DocumentRequest_FieldNumber_DocumentType, - .hasIndex = 1, - .offset = (uint32_t)offsetof(GetProofsRequest_GetProofsRequestV0_DocumentRequest__storage_, documentType), - .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), - .dataType = GPBDataTypeString, - }, - { - .name = "documentTypeKeepsHistory", - .dataTypeSpecific.clazz = Nil, - .number = GetProofsRequest_GetProofsRequestV0_DocumentRequest_FieldNumber_DocumentTypeKeepsHistory, - .hasIndex = 2, - .offset = 3, // Stored in _has_storage_ to save space. - .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), - .dataType = GPBDataTypeBool, - }, - { - .name = "documentId", - .dataTypeSpecific.clazz = Nil, - .number = GetProofsRequest_GetProofsRequestV0_DocumentRequest_FieldNumber_DocumentId, - .hasIndex = 4, - .offset = (uint32_t)offsetof(GetProofsRequest_GetProofsRequestV0_DocumentRequest__storage_, documentId), - .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), - .dataType = GPBDataTypeBytes, - }, - { - .name = "documentContestedStatus", - .dataTypeSpecific.enumDescFunc = GetProofsRequest_GetProofsRequestV0_DocumentRequest_DocumentContestedStatus_EnumDescriptor, - .number = GetProofsRequest_GetProofsRequestV0_DocumentRequest_FieldNumber_DocumentContestedStatus, - .hasIndex = 5, - .offset = (uint32_t)offsetof(GetProofsRequest_GetProofsRequestV0_DocumentRequest__storage_, documentContestedStatus), - .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldHasEnumDescriptor | GPBFieldClearHasIvarOnZero), - .dataType = GPBDataTypeEnum, - }, - }; - GPBDescriptor *localDescriptor = - [GPBDescriptor allocDescriptorForClass:[GetProofsRequest_GetProofsRequestV0_DocumentRequest class] - rootClass:[PlatformRoot class] - file:PlatformRoot_FileDescriptor() - fields:fields - fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) - storageSize:sizeof(GetProofsRequest_GetProofsRequestV0_DocumentRequest__storage_) - flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown)]; - [localDescriptor setupContainingMessageClass:GPBObjCClass(GetProofsRequest_GetProofsRequestV0)]; - #if defined(DEBUG) && DEBUG - NSAssert(descriptor == nil, @"Startup recursed!"); - #endif // DEBUG - descriptor = localDescriptor; - } - return descriptor; -} - -@end - -int32_t GetProofsRequest_GetProofsRequestV0_DocumentRequest_DocumentContestedStatus_RawValue(GetProofsRequest_GetProofsRequestV0_DocumentRequest *message) { - GPBDescriptor *descriptor = [GetProofsRequest_GetProofsRequestV0_DocumentRequest descriptor]; - GPBFieldDescriptor *field = [descriptor fieldWithNumber:GetProofsRequest_GetProofsRequestV0_DocumentRequest_FieldNumber_DocumentContestedStatus]; - return GPBGetMessageRawEnumField(message, field); -} - -void SetGetProofsRequest_GetProofsRequestV0_DocumentRequest_DocumentContestedStatus_RawValue(GetProofsRequest_GetProofsRequestV0_DocumentRequest *message, int32_t value) { - GPBDescriptor *descriptor = [GetProofsRequest_GetProofsRequestV0_DocumentRequest descriptor]; - GPBFieldDescriptor *field = [descriptor fieldWithNumber:GetProofsRequest_GetProofsRequestV0_DocumentRequest_FieldNumber_DocumentContestedStatus]; - GPBSetMessageRawEnumField(message, field, value); -} - -#pragma mark - Enum GetProofsRequest_GetProofsRequestV0_DocumentRequest_DocumentContestedStatus - -GPBEnumDescriptor *GetProofsRequest_GetProofsRequestV0_DocumentRequest_DocumentContestedStatus_EnumDescriptor(void) { - static _Atomic(GPBEnumDescriptor*) descriptor = nil; - if (!descriptor) { - static const char *valueNames = - "NotContested\000MaybeContested\000Contested\000"; - static const int32_t values[] = { - GetProofsRequest_GetProofsRequestV0_DocumentRequest_DocumentContestedStatus_NotContested, - GetProofsRequest_GetProofsRequestV0_DocumentRequest_DocumentContestedStatus_MaybeContested, - GetProofsRequest_GetProofsRequestV0_DocumentRequest_DocumentContestedStatus_Contested, - }; - GPBEnumDescriptor *worker = - [GPBEnumDescriptor allocDescriptorForName:GPBNSStringifySymbol(GetProofsRequest_GetProofsRequestV0_DocumentRequest_DocumentContestedStatus) - valueNames:valueNames - values:values - count:(uint32_t)(sizeof(values) / sizeof(int32_t)) - enumVerifier:GetProofsRequest_GetProofsRequestV0_DocumentRequest_DocumentContestedStatus_IsValidValue]; - GPBEnumDescriptor *expected = nil; - if (!atomic_compare_exchange_strong(&descriptor, &expected, worker)) { - [worker release]; - } - } - return descriptor; -} - -BOOL GetProofsRequest_GetProofsRequestV0_DocumentRequest_DocumentContestedStatus_IsValidValue(int32_t value__) { - switch (value__) { - case GetProofsRequest_GetProofsRequestV0_DocumentRequest_DocumentContestedStatus_NotContested: - case GetProofsRequest_GetProofsRequestV0_DocumentRequest_DocumentContestedStatus_MaybeContested: - case GetProofsRequest_GetProofsRequestV0_DocumentRequest_DocumentContestedStatus_Contested: - return YES; - default: - return NO; - } -} - -#pragma mark - GetProofsRequest_GetProofsRequestV0_IdentityRequest - -@implementation GetProofsRequest_GetProofsRequestV0_IdentityRequest - -@dynamic identityId; -@dynamic requestType; - -typedef struct GetProofsRequest_GetProofsRequestV0_IdentityRequest__storage_ { - uint32_t _has_storage_[1]; - GetProofsRequest_GetProofsRequestV0_IdentityRequest_Type requestType; - NSData *identityId; -} GetProofsRequest_GetProofsRequestV0_IdentityRequest__storage_; - -// This method is threadsafe because it is initially called -// in +initialize for each subclass. -+ (GPBDescriptor *)descriptor { - static GPBDescriptor *descriptor = nil; - if (!descriptor) { - static GPBMessageFieldDescription fields[] = { - { - .name = "identityId", - .dataTypeSpecific.clazz = Nil, - .number = GetProofsRequest_GetProofsRequestV0_IdentityRequest_FieldNumber_IdentityId, - .hasIndex = 0, - .offset = (uint32_t)offsetof(GetProofsRequest_GetProofsRequestV0_IdentityRequest__storage_, identityId), - .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), - .dataType = GPBDataTypeBytes, - }, - { - .name = "requestType", - .dataTypeSpecific.enumDescFunc = GetProofsRequest_GetProofsRequestV0_IdentityRequest_Type_EnumDescriptor, - .number = GetProofsRequest_GetProofsRequestV0_IdentityRequest_FieldNumber_RequestType, - .hasIndex = 1, - .offset = (uint32_t)offsetof(GetProofsRequest_GetProofsRequestV0_IdentityRequest__storage_, requestType), - .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldHasEnumDescriptor | GPBFieldClearHasIvarOnZero), - .dataType = GPBDataTypeEnum, - }, - }; - GPBDescriptor *localDescriptor = - [GPBDescriptor allocDescriptorForClass:[GetProofsRequest_GetProofsRequestV0_IdentityRequest class] - rootClass:[PlatformRoot class] - file:PlatformRoot_FileDescriptor() - fields:fields - fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) - storageSize:sizeof(GetProofsRequest_GetProofsRequestV0_IdentityRequest__storage_) - flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown)]; - [localDescriptor setupContainingMessageClass:GPBObjCClass(GetProofsRequest_GetProofsRequestV0)]; - #if defined(DEBUG) && DEBUG - NSAssert(descriptor == nil, @"Startup recursed!"); - #endif // DEBUG - descriptor = localDescriptor; - } - return descriptor; -} - -@end - -int32_t GetProofsRequest_GetProofsRequestV0_IdentityRequest_RequestType_RawValue(GetProofsRequest_GetProofsRequestV0_IdentityRequest *message) { - GPBDescriptor *descriptor = [GetProofsRequest_GetProofsRequestV0_IdentityRequest descriptor]; - GPBFieldDescriptor *field = [descriptor fieldWithNumber:GetProofsRequest_GetProofsRequestV0_IdentityRequest_FieldNumber_RequestType]; - return GPBGetMessageRawEnumField(message, field); -} - -void SetGetProofsRequest_GetProofsRequestV0_IdentityRequest_RequestType_RawValue(GetProofsRequest_GetProofsRequestV0_IdentityRequest *message, int32_t value) { - GPBDescriptor *descriptor = [GetProofsRequest_GetProofsRequestV0_IdentityRequest descriptor]; - GPBFieldDescriptor *field = [descriptor fieldWithNumber:GetProofsRequest_GetProofsRequestV0_IdentityRequest_FieldNumber_RequestType]; - GPBSetMessageRawEnumField(message, field, value); -} - -#pragma mark - Enum GetProofsRequest_GetProofsRequestV0_IdentityRequest_Type - -GPBEnumDescriptor *GetProofsRequest_GetProofsRequestV0_IdentityRequest_Type_EnumDescriptor(void) { - static _Atomic(GPBEnumDescriptor*) descriptor = nil; - if (!descriptor) { - static const char *valueNames = - "FullIdentity\000Balance\000Keys\000Revision\000"; - static const int32_t values[] = { - GetProofsRequest_GetProofsRequestV0_IdentityRequest_Type_FullIdentity, - GetProofsRequest_GetProofsRequestV0_IdentityRequest_Type_Balance, - GetProofsRequest_GetProofsRequestV0_IdentityRequest_Type_Keys, - GetProofsRequest_GetProofsRequestV0_IdentityRequest_Type_Revision, - }; - GPBEnumDescriptor *worker = - [GPBEnumDescriptor allocDescriptorForName:GPBNSStringifySymbol(GetProofsRequest_GetProofsRequestV0_IdentityRequest_Type) - valueNames:valueNames - values:values - count:(uint32_t)(sizeof(values) / sizeof(int32_t)) - enumVerifier:GetProofsRequest_GetProofsRequestV0_IdentityRequest_Type_IsValidValue]; - GPBEnumDescriptor *expected = nil; - if (!atomic_compare_exchange_strong(&descriptor, &expected, worker)) { - [worker release]; - } - } - return descriptor; -} - -BOOL GetProofsRequest_GetProofsRequestV0_IdentityRequest_Type_IsValidValue(int32_t value__) { - switch (value__) { - case GetProofsRequest_GetProofsRequestV0_IdentityRequest_Type_FullIdentity: - case GetProofsRequest_GetProofsRequestV0_IdentityRequest_Type_Balance: - case GetProofsRequest_GetProofsRequestV0_IdentityRequest_Type_Keys: - case GetProofsRequest_GetProofsRequestV0_IdentityRequest_Type_Revision: - return YES; - default: - return NO; - } -} - -#pragma mark - GetProofsRequest_GetProofsRequestV0_ContractRequest - -@implementation GetProofsRequest_GetProofsRequestV0_ContractRequest - -@dynamic contractId; - -typedef struct GetProofsRequest_GetProofsRequestV0_ContractRequest__storage_ { - uint32_t _has_storage_[1]; - NSData *contractId; -} GetProofsRequest_GetProofsRequestV0_ContractRequest__storage_; - -// This method is threadsafe because it is initially called -// in +initialize for each subclass. -+ (GPBDescriptor *)descriptor { - static GPBDescriptor *descriptor = nil; - if (!descriptor) { - static GPBMessageFieldDescription fields[] = { - { - .name = "contractId", - .dataTypeSpecific.clazz = Nil, - .number = GetProofsRequest_GetProofsRequestV0_ContractRequest_FieldNumber_ContractId, - .hasIndex = 0, - .offset = (uint32_t)offsetof(GetProofsRequest_GetProofsRequestV0_ContractRequest__storage_, contractId), - .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), - .dataType = GPBDataTypeBytes, - }, - }; - GPBDescriptor *localDescriptor = - [GPBDescriptor allocDescriptorForClass:[GetProofsRequest_GetProofsRequestV0_ContractRequest class] - rootClass:[PlatformRoot class] - file:PlatformRoot_FileDescriptor() - fields:fields - fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) - storageSize:sizeof(GetProofsRequest_GetProofsRequestV0_ContractRequest__storage_) - flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown)]; - [localDescriptor setupContainingMessageClass:GPBObjCClass(GetProofsRequest_GetProofsRequestV0)]; - #if defined(DEBUG) && DEBUG - NSAssert(descriptor == nil, @"Startup recursed!"); - #endif // DEBUG - descriptor = localDescriptor; - } - return descriptor; -} - -@end - -#pragma mark - GetProofsRequest_GetProofsRequestV0_VoteStatusRequest - -@implementation GetProofsRequest_GetProofsRequestV0_VoteStatusRequest - -@dynamic requestTypeOneOfCase; -@dynamic contestedResourceVoteStatusRequest; - -typedef struct GetProofsRequest_GetProofsRequestV0_VoteStatusRequest__storage_ { - uint32_t _has_storage_[2]; - GetProofsRequest_GetProofsRequestV0_VoteStatusRequest_ContestedResourceVoteStatusRequest *contestedResourceVoteStatusRequest; -} GetProofsRequest_GetProofsRequestV0_VoteStatusRequest__storage_; - -// This method is threadsafe because it is initially called -// in +initialize for each subclass. -+ (GPBDescriptor *)descriptor { - static GPBDescriptor *descriptor = nil; - if (!descriptor) { - static GPBMessageFieldDescription fields[] = { - { - .name = "contestedResourceVoteStatusRequest", - .dataTypeSpecific.clazz = GPBObjCClass(GetProofsRequest_GetProofsRequestV0_VoteStatusRequest_ContestedResourceVoteStatusRequest), - .number = GetProofsRequest_GetProofsRequestV0_VoteStatusRequest_FieldNumber_ContestedResourceVoteStatusRequest, - .hasIndex = -1, - .offset = (uint32_t)offsetof(GetProofsRequest_GetProofsRequestV0_VoteStatusRequest__storage_, contestedResourceVoteStatusRequest), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeMessage, - }, - }; - GPBDescriptor *localDescriptor = - [GPBDescriptor allocDescriptorForClass:[GetProofsRequest_GetProofsRequestV0_VoteStatusRequest class] - rootClass:[PlatformRoot class] - file:PlatformRoot_FileDescriptor() - fields:fields - fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) - storageSize:sizeof(GetProofsRequest_GetProofsRequestV0_VoteStatusRequest__storage_) - flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown)]; - static const char *oneofs[] = { - "requestType", - }; - [localDescriptor setupOneofs:oneofs - count:(uint32_t)(sizeof(oneofs) / sizeof(char*)) - firstHasIndex:-1]; - [localDescriptor setupContainingMessageClass:GPBObjCClass(GetProofsRequest_GetProofsRequestV0)]; - #if defined(DEBUG) && DEBUG - NSAssert(descriptor == nil, @"Startup recursed!"); - #endif // DEBUG - descriptor = localDescriptor; - } - return descriptor; -} - -@end - -void GetProofsRequest_GetProofsRequestV0_VoteStatusRequest_ClearRequestTypeOneOfCase(GetProofsRequest_GetProofsRequestV0_VoteStatusRequest *message) { - GPBDescriptor *descriptor = [GetProofsRequest_GetProofsRequestV0_VoteStatusRequest descriptor]; - GPBOneofDescriptor *oneof = [descriptor.oneofs objectAtIndex:0]; - GPBClearOneof(message, oneof); -} -#pragma mark - GetProofsRequest_GetProofsRequestV0_VoteStatusRequest_ContestedResourceVoteStatusRequest - -@implementation GetProofsRequest_GetProofsRequestV0_VoteStatusRequest_ContestedResourceVoteStatusRequest - -@dynamic contractId; -@dynamic documentTypeName; -@dynamic indexName; -@dynamic indexValuesArray, indexValuesArray_Count; -@dynamic voterIdentifier; - -typedef struct GetProofsRequest_GetProofsRequestV0_VoteStatusRequest_ContestedResourceVoteStatusRequest__storage_ { - uint32_t _has_storage_[1]; - NSData *contractId; - NSString *documentTypeName; - NSString *indexName; - NSMutableArray *indexValuesArray; - NSData *voterIdentifier; -} GetProofsRequest_GetProofsRequestV0_VoteStatusRequest_ContestedResourceVoteStatusRequest__storage_; - -// This method is threadsafe because it is initially called -// in +initialize for each subclass. -+ (GPBDescriptor *)descriptor { - static GPBDescriptor *descriptor = nil; - if (!descriptor) { - static GPBMessageFieldDescription fields[] = { - { - .name = "contractId", - .dataTypeSpecific.clazz = Nil, - .number = GetProofsRequest_GetProofsRequestV0_VoteStatusRequest_ContestedResourceVoteStatusRequest_FieldNumber_ContractId, - .hasIndex = 0, - .offset = (uint32_t)offsetof(GetProofsRequest_GetProofsRequestV0_VoteStatusRequest_ContestedResourceVoteStatusRequest__storage_, contractId), - .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), - .dataType = GPBDataTypeBytes, - }, - { - .name = "documentTypeName", - .dataTypeSpecific.clazz = Nil, - .number = GetProofsRequest_GetProofsRequestV0_VoteStatusRequest_ContestedResourceVoteStatusRequest_FieldNumber_DocumentTypeName, - .hasIndex = 1, - .offset = (uint32_t)offsetof(GetProofsRequest_GetProofsRequestV0_VoteStatusRequest_ContestedResourceVoteStatusRequest__storage_, documentTypeName), - .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), - .dataType = GPBDataTypeString, - }, - { - .name = "indexName", - .dataTypeSpecific.clazz = Nil, - .number = GetProofsRequest_GetProofsRequestV0_VoteStatusRequest_ContestedResourceVoteStatusRequest_FieldNumber_IndexName, - .hasIndex = 2, - .offset = (uint32_t)offsetof(GetProofsRequest_GetProofsRequestV0_VoteStatusRequest_ContestedResourceVoteStatusRequest__storage_, indexName), - .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), - .dataType = GPBDataTypeString, - }, - { - .name = "indexValuesArray", - .dataTypeSpecific.clazz = Nil, - .number = GetProofsRequest_GetProofsRequestV0_VoteStatusRequest_ContestedResourceVoteStatusRequest_FieldNumber_IndexValuesArray, - .hasIndex = GPBNoHasBit, - .offset = (uint32_t)offsetof(GetProofsRequest_GetProofsRequestV0_VoteStatusRequest_ContestedResourceVoteStatusRequest__storage_, indexValuesArray), - .flags = GPBFieldRepeated, - .dataType = GPBDataTypeBytes, - }, - { - .name = "voterIdentifier", - .dataTypeSpecific.clazz = Nil, - .number = GetProofsRequest_GetProofsRequestV0_VoteStatusRequest_ContestedResourceVoteStatusRequest_FieldNumber_VoterIdentifier, - .hasIndex = 3, - .offset = (uint32_t)offsetof(GetProofsRequest_GetProofsRequestV0_VoteStatusRequest_ContestedResourceVoteStatusRequest__storage_, voterIdentifier), - .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), - .dataType = GPBDataTypeBytes, - }, - }; - GPBDescriptor *localDescriptor = - [GPBDescriptor allocDescriptorForClass:[GetProofsRequest_GetProofsRequestV0_VoteStatusRequest_ContestedResourceVoteStatusRequest class] - rootClass:[PlatformRoot class] - file:PlatformRoot_FileDescriptor() - fields:fields - fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) - storageSize:sizeof(GetProofsRequest_GetProofsRequestV0_VoteStatusRequest_ContestedResourceVoteStatusRequest__storage_) - flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown)]; - [localDescriptor setupContainingMessageClass:GPBObjCClass(GetProofsRequest_GetProofsRequestV0_VoteStatusRequest)]; - #if defined(DEBUG) && DEBUG - NSAssert(descriptor == nil, @"Startup recursed!"); - #endif // DEBUG - descriptor = localDescriptor; - } - return descriptor; -} - -@end - -#pragma mark - GetProofsRequest_GetProofsRequestV0_IdentityTokenBalanceRequest - -@implementation GetProofsRequest_GetProofsRequestV0_IdentityTokenBalanceRequest - -@dynamic tokenId; -@dynamic identityId; - -typedef struct GetProofsRequest_GetProofsRequestV0_IdentityTokenBalanceRequest__storage_ { - uint32_t _has_storage_[1]; - NSData *tokenId; - NSData *identityId; -} GetProofsRequest_GetProofsRequestV0_IdentityTokenBalanceRequest__storage_; - -// This method is threadsafe because it is initially called -// in +initialize for each subclass. -+ (GPBDescriptor *)descriptor { - static GPBDescriptor *descriptor = nil; - if (!descriptor) { - static GPBMessageFieldDescription fields[] = { - { - .name = "tokenId", - .dataTypeSpecific.clazz = Nil, - .number = GetProofsRequest_GetProofsRequestV0_IdentityTokenBalanceRequest_FieldNumber_TokenId, - .hasIndex = 0, - .offset = (uint32_t)offsetof(GetProofsRequest_GetProofsRequestV0_IdentityTokenBalanceRequest__storage_, tokenId), - .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), - .dataType = GPBDataTypeBytes, - }, - { - .name = "identityId", - .dataTypeSpecific.clazz = Nil, - .number = GetProofsRequest_GetProofsRequestV0_IdentityTokenBalanceRequest_FieldNumber_IdentityId, - .hasIndex = 1, - .offset = (uint32_t)offsetof(GetProofsRequest_GetProofsRequestV0_IdentityTokenBalanceRequest__storage_, identityId), - .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), - .dataType = GPBDataTypeBytes, - }, - }; - GPBDescriptor *localDescriptor = - [GPBDescriptor allocDescriptorForClass:[GetProofsRequest_GetProofsRequestV0_IdentityTokenBalanceRequest class] - rootClass:[PlatformRoot class] - file:PlatformRoot_FileDescriptor() - fields:fields - fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) - storageSize:sizeof(GetProofsRequest_GetProofsRequestV0_IdentityTokenBalanceRequest__storage_) - flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown)]; - [localDescriptor setupContainingMessageClass:GPBObjCClass(GetProofsRequest_GetProofsRequestV0)]; - #if defined(DEBUG) && DEBUG - NSAssert(descriptor == nil, @"Startup recursed!"); - #endif // DEBUG - descriptor = localDescriptor; - } - return descriptor; -} - -@end - -#pragma mark - GetProofsRequest_GetProofsRequestV0_IdentityTokenInfoRequest - -@implementation GetProofsRequest_GetProofsRequestV0_IdentityTokenInfoRequest - -@dynamic tokenId; -@dynamic identityId; - -typedef struct GetProofsRequest_GetProofsRequestV0_IdentityTokenInfoRequest__storage_ { - uint32_t _has_storage_[1]; - NSData *tokenId; - NSData *identityId; -} GetProofsRequest_GetProofsRequestV0_IdentityTokenInfoRequest__storage_; - -// This method is threadsafe because it is initially called -// in +initialize for each subclass. -+ (GPBDescriptor *)descriptor { - static GPBDescriptor *descriptor = nil; - if (!descriptor) { - static GPBMessageFieldDescription fields[] = { - { - .name = "tokenId", - .dataTypeSpecific.clazz = Nil, - .number = GetProofsRequest_GetProofsRequestV0_IdentityTokenInfoRequest_FieldNumber_TokenId, - .hasIndex = 0, - .offset = (uint32_t)offsetof(GetProofsRequest_GetProofsRequestV0_IdentityTokenInfoRequest__storage_, tokenId), - .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), - .dataType = GPBDataTypeBytes, - }, - { - .name = "identityId", - .dataTypeSpecific.clazz = Nil, - .number = GetProofsRequest_GetProofsRequestV0_IdentityTokenInfoRequest_FieldNumber_IdentityId, - .hasIndex = 1, - .offset = (uint32_t)offsetof(GetProofsRequest_GetProofsRequestV0_IdentityTokenInfoRequest__storage_, identityId), - .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), - .dataType = GPBDataTypeBytes, - }, - }; - GPBDescriptor *localDescriptor = - [GPBDescriptor allocDescriptorForClass:[GetProofsRequest_GetProofsRequestV0_IdentityTokenInfoRequest class] - rootClass:[PlatformRoot class] - file:PlatformRoot_FileDescriptor() - fields:fields - fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) - storageSize:sizeof(GetProofsRequest_GetProofsRequestV0_IdentityTokenInfoRequest__storage_) - flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown)]; - [localDescriptor setupContainingMessageClass:GPBObjCClass(GetProofsRequest_GetProofsRequestV0)]; - #if defined(DEBUG) && DEBUG - NSAssert(descriptor == nil, @"Startup recursed!"); - #endif // DEBUG - descriptor = localDescriptor; - } - return descriptor; -} - -@end - -#pragma mark - GetProofsRequest_GetProofsRequestV0_TokenStatusRequest - -@implementation GetProofsRequest_GetProofsRequestV0_TokenStatusRequest - -@dynamic tokenId; - -typedef struct GetProofsRequest_GetProofsRequestV0_TokenStatusRequest__storage_ { - uint32_t _has_storage_[1]; - NSData *tokenId; -} GetProofsRequest_GetProofsRequestV0_TokenStatusRequest__storage_; - -// This method is threadsafe because it is initially called -// in +initialize for each subclass. -+ (GPBDescriptor *)descriptor { - static GPBDescriptor *descriptor = nil; - if (!descriptor) { - static GPBMessageFieldDescription fields[] = { - { - .name = "tokenId", - .dataTypeSpecific.clazz = Nil, - .number = GetProofsRequest_GetProofsRequestV0_TokenStatusRequest_FieldNumber_TokenId, - .hasIndex = 0, - .offset = (uint32_t)offsetof(GetProofsRequest_GetProofsRequestV0_TokenStatusRequest__storage_, tokenId), - .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), - .dataType = GPBDataTypeBytes, - }, - }; - GPBDescriptor *localDescriptor = - [GPBDescriptor allocDescriptorForClass:[GetProofsRequest_GetProofsRequestV0_TokenStatusRequest class] - rootClass:[PlatformRoot class] - file:PlatformRoot_FileDescriptor() - fields:fields - fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) - storageSize:sizeof(GetProofsRequest_GetProofsRequestV0_TokenStatusRequest__storage_) - flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown)]; - [localDescriptor setupContainingMessageClass:GPBObjCClass(GetProofsRequest_GetProofsRequestV0)]; - #if defined(DEBUG) && DEBUG - NSAssert(descriptor == nil, @"Startup recursed!"); - #endif // DEBUG - descriptor = localDescriptor; - } - return descriptor; -} - -@end - -#pragma mark - GetProofsResponse - -@implementation GetProofsResponse - -@dynamic versionOneOfCase; -@dynamic v0; - -typedef struct GetProofsResponse__storage_ { - uint32_t _has_storage_[2]; - GetProofsResponse_GetProofsResponseV0 *v0; -} GetProofsResponse__storage_; - -// This method is threadsafe because it is initially called -// in +initialize for each subclass. -+ (GPBDescriptor *)descriptor { - static GPBDescriptor *descriptor = nil; - if (!descriptor) { - static GPBMessageFieldDescription fields[] = { - { - .name = "v0", - .dataTypeSpecific.clazz = GPBObjCClass(GetProofsResponse_GetProofsResponseV0), - .number = GetProofsResponse_FieldNumber_V0, - .hasIndex = -1, - .offset = (uint32_t)offsetof(GetProofsResponse__storage_, v0), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeMessage, - }, - }; - GPBDescriptor *localDescriptor = - [GPBDescriptor allocDescriptorForClass:[GetProofsResponse class] - rootClass:[PlatformRoot class] - file:PlatformRoot_FileDescriptor() - fields:fields - fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) - storageSize:sizeof(GetProofsResponse__storage_) - flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown)]; - static const char *oneofs[] = { - "version", - }; - [localDescriptor setupOneofs:oneofs - count:(uint32_t)(sizeof(oneofs) / sizeof(char*)) - firstHasIndex:-1]; - #if defined(DEBUG) && DEBUG - NSAssert(descriptor == nil, @"Startup recursed!"); - #endif // DEBUG - descriptor = localDescriptor; - } - return descriptor; -} - -@end - -void GetProofsResponse_ClearVersionOneOfCase(GetProofsResponse *message) { - GPBDescriptor *descriptor = [GetProofsResponse descriptor]; - GPBOneofDescriptor *oneof = [descriptor.oneofs objectAtIndex:0]; - GPBClearOneof(message, oneof); -} -#pragma mark - GetProofsResponse_GetProofsResponseV0 - -@implementation GetProofsResponse_GetProofsResponseV0 - -@dynamic resultOneOfCase; -@dynamic proof; -@dynamic hasMetadata, metadata; - -typedef struct GetProofsResponse_GetProofsResponseV0__storage_ { - uint32_t _has_storage_[2]; - Proof *proof; - ResponseMetadata *metadata; -} GetProofsResponse_GetProofsResponseV0__storage_; - -// This method is threadsafe because it is initially called -// in +initialize for each subclass. -+ (GPBDescriptor *)descriptor { - static GPBDescriptor *descriptor = nil; - if (!descriptor) { - static GPBMessageFieldDescription fields[] = { - { - .name = "proof", - .dataTypeSpecific.clazz = GPBObjCClass(Proof), - .number = GetProofsResponse_GetProofsResponseV0_FieldNumber_Proof, - .hasIndex = -1, - .offset = (uint32_t)offsetof(GetProofsResponse_GetProofsResponseV0__storage_, proof), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeMessage, - }, - { - .name = "metadata", - .dataTypeSpecific.clazz = GPBObjCClass(ResponseMetadata), - .number = GetProofsResponse_GetProofsResponseV0_FieldNumber_Metadata, - .hasIndex = 0, - .offset = (uint32_t)offsetof(GetProofsResponse_GetProofsResponseV0__storage_, metadata), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeMessage, - }, - }; - GPBDescriptor *localDescriptor = - [GPBDescriptor allocDescriptorForClass:[GetProofsResponse_GetProofsResponseV0 class] - rootClass:[PlatformRoot class] - file:PlatformRoot_FileDescriptor() - fields:fields - fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) - storageSize:sizeof(GetProofsResponse_GetProofsResponseV0__storage_) - flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown)]; - static const char *oneofs[] = { - "result", - }; - [localDescriptor setupOneofs:oneofs - count:(uint32_t)(sizeof(oneofs) / sizeof(char*)) - firstHasIndex:-1]; - [localDescriptor setupContainingMessageClass:GPBObjCClass(GetProofsResponse)]; - #if defined(DEBUG) && DEBUG - NSAssert(descriptor == nil, @"Startup recursed!"); - #endif // DEBUG - descriptor = localDescriptor; - } - return descriptor; -} - -@end - -void GetProofsResponse_GetProofsResponseV0_ClearResultOneOfCase(GetProofsResponse_GetProofsResponseV0 *message) { - GPBDescriptor *descriptor = [GetProofsResponse_GetProofsResponseV0 descriptor]; - GPBOneofDescriptor *oneof = [descriptor.oneofs objectAtIndex:0]; - GPBClearOneof(message, oneof); -} #pragma mark - GetDataContractRequest @implementation GetDataContractRequest diff --git a/packages/dapi-grpc/clients/platform/v0/objective-c/Platform.pbrpc.h b/packages/dapi-grpc/clients/platform/v0/objective-c/Platform.pbrpc.h index daff9fedb43..50abdc1f7d4 100644 --- a/packages/dapi-grpc/clients/platform/v0/objective-c/Platform.pbrpc.h +++ b/packages/dapi-grpc/clients/platform/v0/objective-c/Platform.pbrpc.h @@ -79,8 +79,6 @@ @class GetPathElementsResponse; @class GetPrefundedSpecializedBalanceRequest; @class GetPrefundedSpecializedBalanceResponse; -@class GetProofsRequest; -@class GetProofsResponse; @class GetProtocolVersionUpgradeStateRequest; @class GetProtocolVersionUpgradeStateResponse; @class GetProtocolVersionUpgradeVoteStatusRequest; @@ -173,10 +171,6 @@ NS_ASSUME_NONNULL_BEGIN - (GRPCUnaryProtoCall *)getEvonodesProposedEpochBlocksByRangeWithMessage:(GetEvonodesProposedEpochBlocksByRangeRequest *)message responseHandler:(id)handler callOptions:(GRPCCallOptions *_Nullable)callOptions; -#pragma mark getProofs(GetProofsRequest) returns (GetProofsResponse) - -- (GRPCUnaryProtoCall *)getProofsWithMessage:(GetProofsRequest *)message responseHandler:(id)handler callOptions:(GRPCCallOptions *_Nullable)callOptions; - #pragma mark getDataContract(GetDataContractRequest) returns (GetDataContractResponse) - (GRPCUnaryProtoCall *)getDataContractWithMessage:(GetDataContractRequest *)message responseHandler:(id)handler callOptions:(GRPCCallOptions *_Nullable)callOptions; @@ -401,13 +395,6 @@ NS_ASSUME_NONNULL_BEGIN - (GRPCProtoCall *)RPCTogetEvonodesProposedEpochBlocksByRangeWithRequest:(GetEvonodesProposedEpochBlocksByRangeRequest *)request handler:(void(^)(GetEvonodesProposedEpochBlocksResponse *_Nullable response, NSError *_Nullable error))handler; -#pragma mark getProofs(GetProofsRequest) returns (GetProofsResponse) - -- (void)getProofsWithRequest:(GetProofsRequest *)request handler:(void(^)(GetProofsResponse *_Nullable response, NSError *_Nullable error))handler; - -- (GRPCProtoCall *)RPCTogetProofsWithRequest:(GetProofsRequest *)request handler:(void(^)(GetProofsResponse *_Nullable response, NSError *_Nullable error))handler; - - #pragma mark getDataContract(GetDataContractRequest) returns (GetDataContractResponse) - (void)getDataContractWithRequest:(GetDataContractRequest *)request handler:(void(^)(GetDataContractResponse *_Nullable response, NSError *_Nullable error))handler; diff --git a/packages/dapi-grpc/clients/platform/v0/objective-c/Platform.pbrpc.m b/packages/dapi-grpc/clients/platform/v0/objective-c/Platform.pbrpc.m index 9f91540f655..dd658f80617 100644 --- a/packages/dapi-grpc/clients/platform/v0/objective-c/Platform.pbrpc.m +++ b/packages/dapi-grpc/clients/platform/v0/objective-c/Platform.pbrpc.m @@ -290,26 +290,6 @@ - (GRPCUnaryProtoCall *)getEvonodesProposedEpochBlocksByRangeWithMessage:(GetEvo responseClass:[GetEvonodesProposedEpochBlocksResponse class]]; } -#pragma mark getProofs(GetProofsRequest) returns (GetProofsResponse) - -- (void)getProofsWithRequest:(GetProofsRequest *)request handler:(void(^)(GetProofsResponse *_Nullable response, NSError *_Nullable error))handler{ - [[self RPCTogetProofsWithRequest:request handler:handler] start]; -} -// Returns a not-yet-started RPC object. -- (GRPCProtoCall *)RPCTogetProofsWithRequest:(GetProofsRequest *)request handler:(void(^)(GetProofsResponse *_Nullable response, NSError *_Nullable error))handler{ - return [self RPCToMethod:@"getProofs" - requestsWriter:[GRXWriter writerWithValue:request] - responseClass:[GetProofsResponse class] - responsesWriteable:[GRXWriteable writeableWithSingleHandler:handler]]; -} -- (GRPCUnaryProtoCall *)getProofsWithMessage:(GetProofsRequest *)message responseHandler:(id)handler callOptions:(GRPCCallOptions *_Nullable)callOptions { - return [self RPCToMethod:@"getProofs" - message:message - responseHandler:handler - callOptions:callOptions - responseClass:[GetProofsResponse class]]; -} - #pragma mark getDataContract(GetDataContractRequest) returns (GetDataContractResponse) - (void)getDataContractWithRequest:(GetDataContractRequest *)request handler:(void(^)(GetDataContractResponse *_Nullable response, NSError *_Nullable error))handler{ diff --git a/packages/dapi-grpc/clients/platform/v0/python/platform_pb2.py b/packages/dapi-grpc/clients/platform/v0/python/platform_pb2.py index 2d51403b537..8f80e58d93b 100644 --- a/packages/dapi-grpc/clients/platform/v0/python/platform_pb2.py +++ b/packages/dapi-grpc/clients/platform/v0/python/platform_pb2.py @@ -23,7 +23,7 @@ syntax='proto3', serialized_options=None, create_key=_descriptor._internal_create_key, - serialized_pb=b'\n\x0eplatform.proto\x12\x19org.dash.platform.dapi.v0\x1a\x1egoogle/protobuf/wrappers.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x81\x01\n\x05Proof\x12\x15\n\rgrovedb_proof\x18\x01 \x01(\x0c\x12\x13\n\x0bquorum_hash\x18\x02 \x01(\x0c\x12\x11\n\tsignature\x18\x03 \x01(\x0c\x12\r\n\x05round\x18\x04 \x01(\r\x12\x15\n\rblock_id_hash\x18\x05 \x01(\x0c\x12\x13\n\x0bquorum_type\x18\x06 \x01(\r\"\x98\x01\n\x10ResponseMetadata\x12\x12\n\x06height\x18\x01 \x01(\x04\x42\x02\x30\x01\x12 \n\x18\x63ore_chain_locked_height\x18\x02 \x01(\r\x12\r\n\x05\x65poch\x18\x03 \x01(\r\x12\x13\n\x07time_ms\x18\x04 \x01(\x04\x42\x02\x30\x01\x12\x18\n\x10protocol_version\x18\x05 \x01(\r\x12\x10\n\x08\x63hain_id\x18\x06 \x01(\t\"L\n\x1dStateTransitionBroadcastError\x12\x0c\n\x04\x63ode\x18\x01 \x01(\r\x12\x0f\n\x07message\x18\x02 \x01(\t\x12\x0c\n\x04\x64\x61ta\x18\x03 \x01(\x0c\";\n\x1f\x42roadcastStateTransitionRequest\x12\x18\n\x10state_transition\x18\x01 \x01(\x0c\"\"\n BroadcastStateTransitionResponse\"\xa4\x01\n\x12GetIdentityRequest\x12P\n\x02v0\x18\x01 \x01(\x0b\x32\x42.org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0H\x00\x1a\x31\n\x14GetIdentityRequestV0\x12\n\n\x02id\x18\x01 \x01(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\xc1\x01\n\x17GetIdentityNonceRequest\x12Z\n\x02v0\x18\x01 \x01(\x0b\x32L.org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0H\x00\x1a?\n\x19GetIdentityNonceRequestV0\x12\x13\n\x0bidentity_id\x18\x01 \x01(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\xf6\x01\n\x1fGetIdentityContractNonceRequest\x12j\n\x02v0\x18\x01 \x01(\x0b\x32\\.org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0H\x00\x1a\\\n!GetIdentityContractNonceRequestV0\x12\x13\n\x0bidentity_id\x18\x01 \x01(\x0c\x12\x13\n\x0b\x63ontract_id\x18\x02 \x01(\x0c\x12\r\n\x05prove\x18\x03 \x01(\x08\x42\t\n\x07version\"\xc0\x01\n\x19GetIdentityBalanceRequest\x12^\n\x02v0\x18\x01 \x01(\x0b\x32P.org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0H\x00\x1a\x38\n\x1bGetIdentityBalanceRequestV0\x12\n\n\x02id\x18\x01 \x01(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\xec\x01\n$GetIdentityBalanceAndRevisionRequest\x12t\n\x02v0\x18\x01 \x01(\x0b\x32\x66.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0H\x00\x1a\x43\n&GetIdentityBalanceAndRevisionRequestV0\x12\n\n\x02id\x18\x01 \x01(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\x9e\x02\n\x13GetIdentityResponse\x12R\n\x02v0\x18\x01 \x01(\x0b\x32\x44.org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0H\x00\x1a\xa7\x01\n\x15GetIdentityResponseV0\x12\x12\n\x08identity\x18\x01 \x01(\x0cH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadataB\x08\n\x06resultB\t\n\x07version\"\xbc\x02\n\x18GetIdentityNonceResponse\x12\\\n\x02v0\x18\x01 \x01(\x0b\x32N.org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0H\x00\x1a\xb6\x01\n\x1aGetIdentityNonceResponseV0\x12\x1c\n\x0eidentity_nonce\x18\x01 \x01(\x04\x42\x02\x30\x01H\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadataB\x08\n\x06resultB\t\n\x07version\"\xe5\x02\n GetIdentityContractNonceResponse\x12l\n\x02v0\x18\x01 \x01(\x0b\x32^.org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0H\x00\x1a\xc7\x01\n\"GetIdentityContractNonceResponseV0\x12%\n\x17identity_contract_nonce\x18\x01 \x01(\x04\x42\x02\x30\x01H\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadataB\x08\n\x06resultB\t\n\x07version\"\xbd\x02\n\x1aGetIdentityBalanceResponse\x12`\n\x02v0\x18\x01 \x01(\x0b\x32R.org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0H\x00\x1a\xb1\x01\n\x1cGetIdentityBalanceResponseV0\x12\x15\n\x07\x62\x61lance\x18\x01 \x01(\x04\x42\x02\x30\x01H\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadataB\x08\n\x06resultB\t\n\x07version\"\xb1\x04\n%GetIdentityBalanceAndRevisionResponse\x12v\n\x02v0\x18\x01 \x01(\x0b\x32h.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0H\x00\x1a\x84\x03\n\'GetIdentityBalanceAndRevisionResponseV0\x12\x9b\x01\n\x14\x62\x61lance_and_revision\x18\x01 \x01(\x0b\x32{.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevisionH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a?\n\x12\x42\x61lanceAndRevision\x12\x13\n\x07\x62\x61lance\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\x14\n\x08revision\x18\x02 \x01(\x04\x42\x02\x30\x01\x42\x08\n\x06resultB\t\n\x07version\"\xd1\x01\n\x0eKeyRequestType\x12\x36\n\x08\x61ll_keys\x18\x01 \x01(\x0b\x32\".org.dash.platform.dapi.v0.AllKeysH\x00\x12@\n\rspecific_keys\x18\x02 \x01(\x0b\x32\'.org.dash.platform.dapi.v0.SpecificKeysH\x00\x12:\n\nsearch_key\x18\x03 \x01(\x0b\x32$.org.dash.platform.dapi.v0.SearchKeyH\x00\x42\t\n\x07request\"\t\n\x07\x41llKeys\"\x1f\n\x0cSpecificKeys\x12\x0f\n\x07key_ids\x18\x01 \x03(\r\"\xb6\x01\n\tSearchKey\x12I\n\x0bpurpose_map\x18\x01 \x03(\x0b\x32\x34.org.dash.platform.dapi.v0.SearchKey.PurposeMapEntry\x1a^\n\x0fPurposeMapEntry\x12\x0b\n\x03key\x18\x01 \x01(\r\x12:\n\x05value\x18\x02 \x01(\x0b\x32+.org.dash.platform.dapi.v0.SecurityLevelMap:\x02\x38\x01\"\xbf\x02\n\x10SecurityLevelMap\x12]\n\x12security_level_map\x18\x01 \x03(\x0b\x32\x41.org.dash.platform.dapi.v0.SecurityLevelMap.SecurityLevelMapEntry\x1aw\n\x15SecurityLevelMapEntry\x12\x0b\n\x03key\x18\x01 \x01(\r\x12M\n\x05value\x18\x02 \x01(\x0e\x32>.org.dash.platform.dapi.v0.SecurityLevelMap.KeyKindRequestType:\x02\x38\x01\"S\n\x12KeyKindRequestType\x12\x1f\n\x1b\x43URRENT_KEY_OF_KIND_REQUEST\x10\x00\x12\x1c\n\x18\x41LL_KEYS_OF_KIND_REQUEST\x10\x01\"\xda\x02\n\x16GetIdentityKeysRequest\x12X\n\x02v0\x18\x01 \x01(\x0b\x32J.org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0H\x00\x1a\xda\x01\n\x18GetIdentityKeysRequestV0\x12\x13\n\x0bidentity_id\x18\x01 \x01(\x0c\x12?\n\x0crequest_type\x18\x02 \x01(\x0b\x32).org.dash.platform.dapi.v0.KeyRequestType\x12+\n\x05limit\x18\x03 \x01(\x0b\x32\x1c.google.protobuf.UInt32Value\x12,\n\x06offset\x18\x04 \x01(\x0b\x32\x1c.google.protobuf.UInt32Value\x12\r\n\x05prove\x18\x05 \x01(\x08\x42\t\n\x07version\"\x99\x03\n\x17GetIdentityKeysResponse\x12Z\n\x02v0\x18\x01 \x01(\x0b\x32L.org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0H\x00\x1a\x96\x02\n\x19GetIdentityKeysResponseV0\x12\x61\n\x04keys\x18\x01 \x01(\x0b\x32Q.org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.KeysH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a\x1a\n\x04Keys\x12\x12\n\nkeys_bytes\x18\x01 \x03(\x0c\x42\x08\n\x06resultB\t\n\x07version\"\xef\x02\n GetIdentitiesContractKeysRequest\x12l\n\x02v0\x18\x01 \x01(\x0b\x32^.org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0H\x00\x1a\xd1\x01\n\"GetIdentitiesContractKeysRequestV0\x12\x16\n\x0eidentities_ids\x18\x01 \x03(\x0c\x12\x13\n\x0b\x63ontract_id\x18\x02 \x01(\x0c\x12\x1f\n\x12\x64ocument_type_name\x18\x03 \x01(\tH\x00\x88\x01\x01\x12\x37\n\x08purposes\x18\x04 \x03(\x0e\x32%.org.dash.platform.dapi.v0.KeyPurpose\x12\r\n\x05prove\x18\x05 \x01(\x08\x42\x15\n\x13_document_type_nameB\t\n\x07version\"\xdf\x06\n!GetIdentitiesContractKeysResponse\x12n\n\x02v0\x18\x01 \x01(\x0b\x32`.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0H\x00\x1a\xbe\x05\n#GetIdentitiesContractKeysResponseV0\x12\x8a\x01\n\x0fidentities_keys\x18\x01 \x01(\x0b\x32o.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeysH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1aY\n\x0bPurposeKeys\x12\x36\n\x07purpose\x18\x01 \x01(\x0e\x32%.org.dash.platform.dapi.v0.KeyPurpose\x12\x12\n\nkeys_bytes\x18\x02 \x03(\x0c\x1a\x9f\x01\n\x0cIdentityKeys\x12\x13\n\x0bidentity_id\x18\x01 \x01(\x0c\x12z\n\x04keys\x18\x02 \x03(\x0b\x32l.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys\x1a\x90\x01\n\x0eIdentitiesKeys\x12~\n\x07\x65ntries\x18\x01 \x03(\x0b\x32m.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeysB\x08\n\x06resultB\t\n\x07version\"\xa4\x02\n*GetEvonodesProposedEpochBlocksByIdsRequest\x12\x80\x01\n\x02v0\x18\x01 \x01(\x0b\x32r.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0H\x00\x1ah\n,GetEvonodesProposedEpochBlocksByIdsRequestV0\x12\x12\n\x05\x65poch\x18\x01 \x01(\rH\x00\x88\x01\x01\x12\x0b\n\x03ids\x18\x02 \x03(\x0c\x12\r\n\x05prove\x18\x03 \x01(\x08\x42\x08\n\x06_epochB\t\n\x07version\"\x92\x06\n&GetEvonodesProposedEpochBlocksResponse\x12x\n\x02v0\x18\x01 \x01(\x0b\x32j.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0H\x00\x1a\xe2\x04\n(GetEvonodesProposedEpochBlocksResponseV0\x12\xb1\x01\n#evonodes_proposed_block_counts_info\x18\x01 \x01(\x0b\x32\x81\x01.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocksH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a?\n\x15\x45vonodeProposedBlocks\x12\x13\n\x0bpro_tx_hash\x18\x01 \x01(\x0c\x12\x11\n\x05\x63ount\x18\x02 \x01(\x04\x42\x02\x30\x01\x1a\xc4\x01\n\x16\x45vonodesProposedBlocks\x12\xa9\x01\n\x1e\x65vonodes_proposed_block_counts\x18\x01 \x03(\x0b\x32\x80\x01.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocksB\x08\n\x06resultB\t\n\x07version\"\xf2\x02\n,GetEvonodesProposedEpochBlocksByRangeRequest\x12\x84\x01\n\x02v0\x18\x01 \x01(\x0b\x32v.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0H\x00\x1a\xaf\x01\n.GetEvonodesProposedEpochBlocksByRangeRequestV0\x12\x12\n\x05\x65poch\x18\x01 \x01(\rH\x01\x88\x01\x01\x12\x12\n\x05limit\x18\x02 \x01(\rH\x02\x88\x01\x01\x12\x15\n\x0bstart_after\x18\x03 \x01(\x0cH\x00\x12\x12\n\x08start_at\x18\x04 \x01(\x0cH\x00\x12\r\n\x05prove\x18\x05 \x01(\x08\x42\x07\n\x05startB\x08\n\x06_epochB\x08\n\x06_limitB\t\n\x07version\"\xcd\x01\n\x1cGetIdentitiesBalancesRequest\x12\x64\n\x02v0\x18\x01 \x01(\x0b\x32V.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0H\x00\x1a<\n\x1eGetIdentitiesBalancesRequestV0\x12\x0b\n\x03ids\x18\x01 \x03(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\x9f\x05\n\x1dGetIdentitiesBalancesResponse\x12\x66\n\x02v0\x18\x01 \x01(\x0b\x32X.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0H\x00\x1a\x8a\x04\n\x1fGetIdentitiesBalancesResponseV0\x12\x8a\x01\n\x13identities_balances\x18\x01 \x01(\x0b\x32k.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalancesH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1aL\n\x0fIdentityBalance\x12\x13\n\x0bidentity_id\x18\x01 \x01(\x0c\x12\x18\n\x07\x62\x61lance\x18\x02 \x01(\x04\x42\x02\x30\x01H\x00\x88\x01\x01\x42\n\n\x08_balance\x1a\x8f\x01\n\x12IdentitiesBalances\x12y\n\x07\x65ntries\x18\x01 \x03(\x0b\x32h.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalanceB\x08\n\x06resultB\t\n\x07version\"\xdb\x0f\n\x10GetProofsRequest\x12L\n\x02v0\x18\x01 \x01(\x0b\x32>.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0H\x00\x1a\xed\x0e\n\x12GetProofsRequestV0\x12\x62\n\nidentities\x18\x01 \x03(\x0b\x32N.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityRequest\x12\x61\n\tcontracts\x18\x02 \x03(\x0b\x32N.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.ContractRequest\x12\x61\n\tdocuments\x18\x03 \x03(\x0b\x32N.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest\x12_\n\x05votes\x18\x04 \x03(\x0b\x32P.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest\x12{\n\x17identity_token_balances\x18\x05 \x03(\x0b\x32Z.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenBalanceRequest\x12u\n\x14identity_token_infos\x18\x06 \x03(\x0b\x32W.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenInfoRequest\x12i\n\x0etoken_statuses\x18\x07 \x03(\x0b\x32Q.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.TokenStatusRequest\x1a\xd5\x02\n\x0f\x44ocumentRequest\x12\x13\n\x0b\x63ontract_id\x18\x01 \x01(\x0c\x12\x15\n\rdocument_type\x18\x02 \x01(\t\x12#\n\x1b\x64ocument_type_keeps_history\x18\x03 \x01(\x08\x12\x13\n\x0b\x64ocument_id\x18\x04 \x01(\x0c\x12\x89\x01\n\x19\x64ocument_contested_status\x18\x05 \x01(\x0e\x32\x66.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest.DocumentContestedStatus\"P\n\x17\x44ocumentContestedStatus\x12\x11\n\rNOT_CONTESTED\x10\x00\x12\x13\n\x0fMAYBE_CONTESTED\x10\x01\x12\r\n\tCONTESTED\x10\x02\x1a\xd1\x01\n\x0fIdentityRequest\x12\x13\n\x0bidentity_id\x18\x01 \x01(\x0c\x12i\n\x0crequest_type\x18\x02 \x01(\x0e\x32S.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityRequest.Type\">\n\x04Type\x12\x11\n\rFULL_IDENTITY\x10\x00\x12\x0b\n\x07\x42\x41LANCE\x10\x01\x12\x08\n\x04KEYS\x10\x02\x12\x0c\n\x08REVISION\x10\x03\x1a&\n\x0f\x43ontractRequest\x12\x13\n\x0b\x63ontract_id\x18\x01 \x01(\x0c\x1a\xe7\x02\n\x11VoteStatusRequest\x12\xa5\x01\n&contested_resource_vote_status_request\x18\x01 \x01(\x0b\x32s.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequestH\x00\x1a\x99\x01\n\"ContestedResourceVoteStatusRequest\x12\x13\n\x0b\x63ontract_id\x18\x01 \x01(\x0c\x12\x1a\n\x12\x64ocument_type_name\x18\x02 \x01(\t\x12\x12\n\nindex_name\x18\x03 \x01(\t\x12\x14\n\x0cindex_values\x18\x04 \x03(\x0c\x12\x18\n\x10voter_identifier\x18\x05 \x01(\x0c\x42\x0e\n\x0crequest_type\x1a\x44\n\x1bIdentityTokenBalanceRequest\x12\x10\n\x08token_id\x18\x01 \x01(\x0c\x12\x13\n\x0bidentity_id\x18\x02 \x01(\x0c\x1a\x41\n\x18IdentityTokenInfoRequest\x12\x10\n\x08token_id\x18\x01 \x01(\x0c\x12\x13\n\x0bidentity_id\x18\x02 \x01(\x0c\x1a&\n\x12TokenStatusRequest\x12\x10\n\x08token_id\x18\x01 \x01(\x0c\x42\t\n\x07version\"\x82\x02\n\x11GetProofsResponse\x12N\n\x02v0\x18\x01 \x01(\x0b\x32@.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0H\x00\x1a\x91\x01\n\x13GetProofsResponseV0\x12\x31\n\x05proof\x18\x01 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x02 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadataB\x08\n\x06resultB\t\n\x07version\"\xb4\x01\n\x16GetDataContractRequest\x12X\n\x02v0\x18\x01 \x01(\x0b\x32J.org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0H\x00\x1a\x35\n\x18GetDataContractRequestV0\x12\n\n\x02id\x18\x01 \x01(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\xb3\x02\n\x17GetDataContractResponse\x12Z\n\x02v0\x18\x01 \x01(\x0b\x32L.org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0H\x00\x1a\xb0\x01\n\x19GetDataContractResponseV0\x12\x17\n\rdata_contract\x18\x01 \x01(\x0cH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadataB\x08\n\x06resultB\t\n\x07version\"\xb9\x01\n\x17GetDataContractsRequest\x12Z\n\x02v0\x18\x01 \x01(\x0b\x32L.org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0H\x00\x1a\x37\n\x19GetDataContractsRequestV0\x12\x0b\n\x03ids\x18\x01 \x03(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\xcf\x04\n\x18GetDataContractsResponse\x12\\\n\x02v0\x18\x01 \x01(\x0b\x32N.org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0H\x00\x1a[\n\x11\x44\x61taContractEntry\x12\x12\n\nidentifier\x18\x01 \x01(\x0c\x12\x32\n\rdata_contract\x18\x02 \x01(\x0b\x32\x1b.google.protobuf.BytesValue\x1au\n\rDataContracts\x12\x64\n\x15\x64\x61ta_contract_entries\x18\x01 \x03(\x0b\x32\x45.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry\x1a\xf5\x01\n\x1aGetDataContractsResponseV0\x12[\n\x0e\x64\x61ta_contracts\x18\x01 \x01(\x0b\x32\x41.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractsH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadataB\x08\n\x06resultB\t\n\x07version\"\xc5\x02\n\x1dGetDataContractHistoryRequest\x12\x66\n\x02v0\x18\x01 \x01(\x0b\x32X.org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0H\x00\x1a\xb0\x01\n\x1fGetDataContractHistoryRequestV0\x12\n\n\x02id\x18\x01 \x01(\x0c\x12+\n\x05limit\x18\x02 \x01(\x0b\x32\x1c.google.protobuf.UInt32Value\x12,\n\x06offset\x18\x03 \x01(\x0b\x32\x1c.google.protobuf.UInt32Value\x12\x17\n\x0bstart_at_ms\x18\x04 \x01(\x04\x42\x02\x30\x01\x12\r\n\x05prove\x18\x05 \x01(\x08\x42\t\n\x07version\"\xb2\x05\n\x1eGetDataContractHistoryResponse\x12h\n\x02v0\x18\x01 \x01(\x0b\x32Z.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0H\x00\x1a\x9a\x04\n GetDataContractHistoryResponseV0\x12\x8f\x01\n\x15\x64\x61ta_contract_history\x18\x01 \x01(\x0b\x32n.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a;\n\x18\x44\x61taContractHistoryEntry\x12\x10\n\x04\x64\x61te\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\r\n\x05value\x18\x02 \x01(\x0c\x1a\xaa\x01\n\x13\x44\x61taContractHistory\x12\x92\x01\n\x15\x64\x61ta_contract_entries\x18\x01 \x03(\x0b\x32s.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntryB\x08\n\x06resultB\t\n\x07version\"\xb2\x02\n\x13GetDocumentsRequest\x12R\n\x02v0\x18\x01 \x01(\x0b\x32\x44.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0H\x00\x1a\xbb\x01\n\x15GetDocumentsRequestV0\x12\x18\n\x10\x64\x61ta_contract_id\x18\x01 \x01(\x0c\x12\x15\n\rdocument_type\x18\x02 \x01(\t\x12\r\n\x05where\x18\x03 \x01(\x0c\x12\x10\n\x08order_by\x18\x04 \x01(\x0c\x12\r\n\x05limit\x18\x05 \x01(\r\x12\x15\n\x0bstart_after\x18\x06 \x01(\x0cH\x00\x12\x12\n\x08start_at\x18\x07 \x01(\x0cH\x00\x12\r\n\x05prove\x18\x08 \x01(\x08\x42\x07\n\x05startB\t\n\x07version\"\x95\x03\n\x14GetDocumentsResponse\x12T\n\x02v0\x18\x01 \x01(\x0b\x32\x46.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0H\x00\x1a\x9b\x02\n\x16GetDocumentsResponseV0\x12\x65\n\tdocuments\x18\x01 \x01(\x0b\x32P.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.DocumentsH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a\x1e\n\tDocuments\x12\x11\n\tdocuments\x18\x01 \x03(\x0c\x42\x08\n\x06resultB\t\n\x07version\"\xed\x01\n!GetIdentityByPublicKeyHashRequest\x12n\n\x02v0\x18\x01 \x01(\x0b\x32`.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0H\x00\x1aM\n#GetIdentityByPublicKeyHashRequestV0\x12\x17\n\x0fpublic_key_hash\x18\x01 \x01(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\xda\x02\n\"GetIdentityByPublicKeyHashResponse\x12p\n\x02v0\x18\x01 \x01(\x0b\x32\x62.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0H\x00\x1a\xb6\x01\n$GetIdentityByPublicKeyHashResponseV0\x12\x12\n\x08identity\x18\x01 \x01(\x0cH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadataB\x08\n\x06resultB\t\n\x07version\"\xfb\x01\n#WaitForStateTransitionResultRequest\x12r\n\x02v0\x18\x01 \x01(\x0b\x32\x64.org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0H\x00\x1aU\n%WaitForStateTransitionResultRequestV0\x12\x1d\n\x15state_transition_hash\x18\x01 \x01(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\x99\x03\n$WaitForStateTransitionResultResponse\x12t\n\x02v0\x18\x01 \x01(\x0b\x32\x66.org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0H\x00\x1a\xef\x01\n&WaitForStateTransitionResultResponseV0\x12I\n\x05\x65rror\x18\x01 \x01(\x0b\x32\x38.org.dash.platform.dapi.v0.StateTransitionBroadcastErrorH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadataB\x08\n\x06resultB\t\n\x07version\"\xc4\x01\n\x19GetConsensusParamsRequest\x12^\n\x02v0\x18\x01 \x01(\x0b\x32P.org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0H\x00\x1a<\n\x1bGetConsensusParamsRequestV0\x12\x0e\n\x06height\x18\x01 \x01(\x05\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\x9c\x04\n\x1aGetConsensusParamsResponse\x12`\n\x02v0\x18\x01 \x01(\x0b\x32R.org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0H\x00\x1aP\n\x14\x43onsensusParamsBlock\x12\x11\n\tmax_bytes\x18\x01 \x01(\t\x12\x0f\n\x07max_gas\x18\x02 \x01(\t\x12\x14\n\x0ctime_iota_ms\x18\x03 \x01(\t\x1a\x62\n\x17\x43onsensusParamsEvidence\x12\x1a\n\x12max_age_num_blocks\x18\x01 \x01(\t\x12\x18\n\x10max_age_duration\x18\x02 \x01(\t\x12\x11\n\tmax_bytes\x18\x03 \x01(\t\x1a\xda\x01\n\x1cGetConsensusParamsResponseV0\x12Y\n\x05\x62lock\x18\x01 \x01(\x0b\x32J.org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock\x12_\n\x08\x65vidence\x18\x02 \x01(\x0b\x32M.org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidenceB\t\n\x07version\"\xe4\x01\n%GetProtocolVersionUpgradeStateRequest\x12v\n\x02v0\x18\x01 \x01(\x0b\x32h.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0H\x00\x1a\x38\n\'GetProtocolVersionUpgradeStateRequestV0\x12\r\n\x05prove\x18\x01 \x01(\x08\x42\t\n\x07version\"\xb5\x05\n&GetProtocolVersionUpgradeStateResponse\x12x\n\x02v0\x18\x01 \x01(\x0b\x32j.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0H\x00\x1a\x85\x04\n(GetProtocolVersionUpgradeStateResponseV0\x12\x87\x01\n\x08versions\x18\x01 \x01(\x0b\x32s.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionsH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a\x96\x01\n\x08Versions\x12\x89\x01\n\x08versions\x18\x01 \x03(\x0b\x32w.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry\x1a:\n\x0cVersionEntry\x12\x16\n\x0eversion_number\x18\x01 \x01(\r\x12\x12\n\nvote_count\x18\x02 \x01(\rB\x08\n\x06resultB\t\n\x07version\"\xa3\x02\n*GetProtocolVersionUpgradeVoteStatusRequest\x12\x80\x01\n\x02v0\x18\x01 \x01(\x0b\x32r.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0H\x00\x1ag\n,GetProtocolVersionUpgradeVoteStatusRequestV0\x12\x19\n\x11start_pro_tx_hash\x18\x01 \x01(\x0c\x12\r\n\x05\x63ount\x18\x02 \x01(\r\x12\r\n\x05prove\x18\x03 \x01(\x08\x42\t\n\x07version\"\xef\x05\n+GetProtocolVersionUpgradeVoteStatusResponse\x12\x82\x01\n\x02v0\x18\x01 \x01(\x0b\x32t.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0H\x00\x1a\xaf\x04\n-GetProtocolVersionUpgradeVoteStatusResponseV0\x12\x98\x01\n\x08versions\x18\x01 \x01(\x0b\x32\x83\x01.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignalsH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a\xaf\x01\n\x0eVersionSignals\x12\x9c\x01\n\x0fversion_signals\x18\x01 \x03(\x0b\x32\x82\x01.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal\x1a\x35\n\rVersionSignal\x12\x13\n\x0bpro_tx_hash\x18\x01 \x01(\x0c\x12\x0f\n\x07version\x18\x02 \x01(\rB\x08\n\x06resultB\t\n\x07version\"\xf5\x01\n\x14GetEpochsInfoRequest\x12T\n\x02v0\x18\x01 \x01(\x0b\x32\x46.org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0H\x00\x1a|\n\x16GetEpochsInfoRequestV0\x12\x31\n\x0bstart_epoch\x18\x01 \x01(\x0b\x32\x1c.google.protobuf.UInt32Value\x12\r\n\x05\x63ount\x18\x02 \x01(\r\x12\x11\n\tascending\x18\x03 \x01(\x08\x12\r\n\x05prove\x18\x04 \x01(\x08\x42\t\n\x07version\"\x99\x05\n\x15GetEpochsInfoResponse\x12V\n\x02v0\x18\x01 \x01(\x0b\x32H.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0H\x00\x1a\x9c\x04\n\x17GetEpochsInfoResponseV0\x12\x65\n\x06\x65pochs\x18\x01 \x01(\x0b\x32S.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfosH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1au\n\nEpochInfos\x12g\n\x0b\x65poch_infos\x18\x01 \x03(\x0b\x32R.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo\x1a\xa6\x01\n\tEpochInfo\x12\x0e\n\x06number\x18\x01 \x01(\r\x12\x1e\n\x12\x66irst_block_height\x18\x02 \x01(\x04\x42\x02\x30\x01\x12\x1f\n\x17\x66irst_core_block_height\x18\x03 \x01(\r\x12\x16\n\nstart_time\x18\x04 \x01(\x04\x42\x02\x30\x01\x12\x16\n\x0e\x66\x65\x65_multiplier\x18\x05 \x01(\x01\x12\x18\n\x10protocol_version\x18\x06 \x01(\rB\x08\n\x06resultB\t\n\x07version\"\xde\x04\n\x1cGetContestedResourcesRequest\x12\x64\n\x02v0\x18\x01 \x01(\x0b\x32V.org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0H\x00\x1a\xcc\x03\n\x1eGetContestedResourcesRequestV0\x12\x13\n\x0b\x63ontract_id\x18\x01 \x01(\x0c\x12\x1a\n\x12\x64ocument_type_name\x18\x02 \x01(\t\x12\x12\n\nindex_name\x18\x03 \x01(\t\x12\x1a\n\x12start_index_values\x18\x04 \x03(\x0c\x12\x18\n\x10\x65nd_index_values\x18\x05 \x03(\x0c\x12\x89\x01\n\x13start_at_value_info\x18\x06 \x01(\x0b\x32g.org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfoH\x00\x88\x01\x01\x12\x12\n\x05\x63ount\x18\x07 \x01(\rH\x01\x88\x01\x01\x12\x17\n\x0forder_ascending\x18\x08 \x01(\x08\x12\r\n\x05prove\x18\t \x01(\x08\x1a\x45\n\x10StartAtValueInfo\x12\x13\n\x0bstart_value\x18\x01 \x01(\x0c\x12\x1c\n\x14start_value_included\x18\x02 \x01(\x08\x42\x16\n\x14_start_at_value_infoB\x08\n\x06_countB\t\n\x07version\"\x88\x04\n\x1dGetContestedResourcesResponse\x12\x66\n\x02v0\x18\x01 \x01(\x0b\x32X.org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0H\x00\x1a\xf3\x02\n\x1fGetContestedResourcesResponseV0\x12\x95\x01\n\x19\x63ontested_resource_values\x18\x01 \x01(\x0b\x32p.org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValuesH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a<\n\x17\x43ontestedResourceValues\x12!\n\x19\x63ontested_resource_values\x18\x01 \x03(\x0c\x42\x08\n\x06resultB\t\n\x07version\"\xd2\x05\n\x1cGetVotePollsByEndDateRequest\x12\x64\n\x02v0\x18\x01 \x01(\x0b\x32V.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0H\x00\x1a\xc0\x04\n\x1eGetVotePollsByEndDateRequestV0\x12\x84\x01\n\x0fstart_time_info\x18\x01 \x01(\x0b\x32\x66.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfoH\x00\x88\x01\x01\x12\x80\x01\n\rend_time_info\x18\x02 \x01(\x0b\x32\x64.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfoH\x01\x88\x01\x01\x12\x12\n\x05limit\x18\x03 \x01(\rH\x02\x88\x01\x01\x12\x13\n\x06offset\x18\x04 \x01(\rH\x03\x88\x01\x01\x12\x11\n\tascending\x18\x05 \x01(\x08\x12\r\n\x05prove\x18\x06 \x01(\x08\x1aI\n\x0fStartAtTimeInfo\x12\x19\n\rstart_time_ms\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\x1b\n\x13start_time_included\x18\x02 \x01(\x08\x1a\x43\n\rEndAtTimeInfo\x12\x17\n\x0b\x65nd_time_ms\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\x19\n\x11\x65nd_time_included\x18\x02 \x01(\x08\x42\x12\n\x10_start_time_infoB\x10\n\x0e_end_time_infoB\x08\n\x06_limitB\t\n\x07_offsetB\t\n\x07version\"\x83\x06\n\x1dGetVotePollsByEndDateResponse\x12\x66\n\x02v0\x18\x01 \x01(\x0b\x32X.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0H\x00\x1a\xee\x04\n\x1fGetVotePollsByEndDateResponseV0\x12\x9c\x01\n\x18vote_polls_by_timestamps\x18\x01 \x01(\x0b\x32x.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestampsH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1aV\n\x1eSerializedVotePollsByTimestamp\x12\x15\n\ttimestamp\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\x1d\n\x15serialized_vote_polls\x18\x02 \x03(\x0c\x1a\xd7\x01\n\x1fSerializedVotePollsByTimestamps\x12\x99\x01\n\x18vote_polls_by_timestamps\x18\x01 \x03(\x0b\x32w.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp\x12\x18\n\x10\x66inished_results\x18\x02 \x01(\x08\x42\x08\n\x06resultB\t\n\x07version\"\xff\x06\n$GetContestedResourceVoteStateRequest\x12t\n\x02v0\x18\x01 \x01(\x0b\x32\x66.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0H\x00\x1a\xd5\x05\n&GetContestedResourceVoteStateRequestV0\x12\x13\n\x0b\x63ontract_id\x18\x01 \x01(\x0c\x12\x1a\n\x12\x64ocument_type_name\x18\x02 \x01(\t\x12\x12\n\nindex_name\x18\x03 \x01(\t\x12\x14\n\x0cindex_values\x18\x04 \x03(\x0c\x12\x86\x01\n\x0bresult_type\x18\x05 \x01(\x0e\x32q.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.ResultType\x12\x36\n.allow_include_locked_and_abstaining_vote_tally\x18\x06 \x01(\x08\x12\xa3\x01\n\x18start_at_identifier_info\x18\x07 \x01(\x0b\x32|.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfoH\x00\x88\x01\x01\x12\x12\n\x05\x63ount\x18\x08 \x01(\rH\x01\x88\x01\x01\x12\r\n\x05prove\x18\t \x01(\x08\x1aT\n\x15StartAtIdentifierInfo\x12\x18\n\x10start_identifier\x18\x01 \x01(\x0c\x12!\n\x19start_identifier_included\x18\x02 \x01(\x08\"I\n\nResultType\x12\r\n\tDOCUMENTS\x10\x00\x12\x0e\n\nVOTE_TALLY\x10\x01\x12\x1c\n\x18\x44OCUMENTS_AND_VOTE_TALLY\x10\x02\x42\x1b\n\x19_start_at_identifier_infoB\x08\n\x06_countB\t\n\x07version\"\x94\x0c\n%GetContestedResourceVoteStateResponse\x12v\n\x02v0\x18\x01 \x01(\x0b\x32h.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0H\x00\x1a\xe7\n\n\'GetContestedResourceVoteStateResponseV0\x12\xae\x01\n\x1d\x63ontested_resource_contenders\x18\x01 \x01(\x0b\x32\x84\x01.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContendersH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a\xda\x03\n\x10\x46inishedVoteInfo\x12\xad\x01\n\x15\x66inished_vote_outcome\x18\x01 \x01(\x0e\x32\x8d\x01.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo.FinishedVoteOutcome\x12\x1f\n\x12won_by_identity_id\x18\x02 \x01(\x0cH\x00\x88\x01\x01\x12$\n\x18\x66inished_at_block_height\x18\x03 \x01(\x04\x42\x02\x30\x01\x12%\n\x1d\x66inished_at_core_block_height\x18\x04 \x01(\r\x12%\n\x19\x66inished_at_block_time_ms\x18\x05 \x01(\x04\x42\x02\x30\x01\x12\x19\n\x11\x66inished_at_epoch\x18\x06 \x01(\r\"O\n\x13\x46inishedVoteOutcome\x12\x14\n\x10TOWARDS_IDENTITY\x10\x00\x12\n\n\x06LOCKED\x10\x01\x12\x16\n\x12NO_PREVIOUS_WINNER\x10\x02\x42\x15\n\x13_won_by_identity_id\x1a\xc4\x03\n\x1b\x43ontestedResourceContenders\x12\x86\x01\n\ncontenders\x18\x01 \x03(\x0b\x32r.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender\x12\x1f\n\x12\x61\x62stain_vote_tally\x18\x02 \x01(\rH\x00\x88\x01\x01\x12\x1c\n\x0flock_vote_tally\x18\x03 \x01(\rH\x01\x88\x01\x01\x12\x9a\x01\n\x12\x66inished_vote_info\x18\x04 \x01(\x0b\x32y.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfoH\x02\x88\x01\x01\x42\x15\n\x13_abstain_vote_tallyB\x12\n\x10_lock_vote_tallyB\x15\n\x13_finished_vote_info\x1ak\n\tContender\x12\x12\n\nidentifier\x18\x01 \x01(\x0c\x12\x17\n\nvote_count\x18\x02 \x01(\rH\x00\x88\x01\x01\x12\x15\n\x08\x64ocument\x18\x03 \x01(\x0cH\x01\x88\x01\x01\x42\r\n\x0b_vote_countB\x0b\n\t_documentB\x08\n\x06resultB\t\n\x07version\"\xd5\x05\n,GetContestedResourceVotersForIdentityRequest\x12\x84\x01\n\x02v0\x18\x01 \x01(\x0b\x32v.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0H\x00\x1a\x92\x04\n.GetContestedResourceVotersForIdentityRequestV0\x12\x13\n\x0b\x63ontract_id\x18\x01 \x01(\x0c\x12\x1a\n\x12\x64ocument_type_name\x18\x02 \x01(\t\x12\x12\n\nindex_name\x18\x03 \x01(\t\x12\x14\n\x0cindex_values\x18\x04 \x03(\x0c\x12\x15\n\rcontestant_id\x18\x05 \x01(\x0c\x12\xb4\x01\n\x18start_at_identifier_info\x18\x06 \x01(\x0b\x32\x8c\x01.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfoH\x00\x88\x01\x01\x12\x12\n\x05\x63ount\x18\x07 \x01(\rH\x01\x88\x01\x01\x12\x17\n\x0forder_ascending\x18\x08 \x01(\x08\x12\r\n\x05prove\x18\t \x01(\x08\x1aT\n\x15StartAtIdentifierInfo\x12\x18\n\x10start_identifier\x18\x01 \x01(\x0c\x12!\n\x19start_identifier_included\x18\x02 \x01(\x08\x42\x1b\n\x19_start_at_identifier_infoB\x08\n\x06_countB\t\n\x07version\"\xf1\x04\n-GetContestedResourceVotersForIdentityResponse\x12\x86\x01\n\x02v0\x18\x01 \x01(\x0b\x32x.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0H\x00\x1a\xab\x03\n/GetContestedResourceVotersForIdentityResponseV0\x12\xb6\x01\n\x19\x63ontested_resource_voters\x18\x01 \x01(\x0b\x32\x90\x01.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVotersH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a\x43\n\x17\x43ontestedResourceVoters\x12\x0e\n\x06voters\x18\x01 \x03(\x0c\x12\x18\n\x10\x66inished_results\x18\x02 \x01(\x08\x42\x08\n\x06resultB\t\n\x07version\"\xad\x05\n(GetContestedResourceIdentityVotesRequest\x12|\n\x02v0\x18\x01 \x01(\x0b\x32n.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0H\x00\x1a\xf7\x03\n*GetContestedResourceIdentityVotesRequestV0\x12\x13\n\x0bidentity_id\x18\x01 \x01(\x0c\x12+\n\x05limit\x18\x02 \x01(\x0b\x32\x1c.google.protobuf.UInt32Value\x12,\n\x06offset\x18\x03 \x01(\x0b\x32\x1c.google.protobuf.UInt32Value\x12\x17\n\x0forder_ascending\x18\x04 \x01(\x08\x12\xae\x01\n\x1astart_at_vote_poll_id_info\x18\x05 \x01(\x0b\x32\x84\x01.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfoH\x00\x88\x01\x01\x12\r\n\x05prove\x18\x06 \x01(\x08\x1a\x61\n\x15StartAtVotePollIdInfo\x12 \n\x18start_at_poll_identifier\x18\x01 \x01(\x0c\x12&\n\x1estart_poll_identifier_included\x18\x02 \x01(\x08\x42\x1d\n\x1b_start_at_vote_poll_id_infoB\t\n\x07version\"\xc8\n\n)GetContestedResourceIdentityVotesResponse\x12~\n\x02v0\x18\x01 \x01(\x0b\x32p.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0H\x00\x1a\x8f\t\n+GetContestedResourceIdentityVotesResponseV0\x12\xa1\x01\n\x05votes\x18\x01 \x01(\x0b\x32\x8f\x01.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotesH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a\xf7\x01\n\x1e\x43ontestedResourceIdentityVotes\x12\xba\x01\n!contested_resource_identity_votes\x18\x01 \x03(\x0b\x32\x8e\x01.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote\x12\x18\n\x10\x66inished_results\x18\x02 \x01(\x08\x1a\xad\x02\n\x12ResourceVoteChoice\x12\xad\x01\n\x10vote_choice_type\x18\x01 \x01(\x0e\x32\x92\x01.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice.VoteChoiceType\x12\x18\n\x0bidentity_id\x18\x02 \x01(\x0cH\x00\x88\x01\x01\"=\n\x0eVoteChoiceType\x12\x14\n\x10TOWARDS_IDENTITY\x10\x00\x12\x0b\n\x07\x41\x42STAIN\x10\x01\x12\x08\n\x04LOCK\x10\x02\x42\x0e\n\x0c_identity_id\x1a\x95\x02\n\x1d\x43ontestedResourceIdentityVote\x12\x13\n\x0b\x63ontract_id\x18\x01 \x01(\x0c\x12\x1a\n\x12\x64ocument_type_name\x18\x02 \x01(\t\x12\'\n\x1fserialized_index_storage_values\x18\x03 \x03(\x0c\x12\x99\x01\n\x0bvote_choice\x18\x04 \x01(\x0b\x32\x83\x01.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoiceB\x08\n\x06resultB\t\n\x07version\"\xf0\x01\n%GetPrefundedSpecializedBalanceRequest\x12v\n\x02v0\x18\x01 \x01(\x0b\x32h.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0H\x00\x1a\x44\n\'GetPrefundedSpecializedBalanceRequestV0\x12\n\n\x02id\x18\x01 \x01(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\xed\x02\n&GetPrefundedSpecializedBalanceResponse\x12x\n\x02v0\x18\x01 \x01(\x0b\x32j.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0H\x00\x1a\xbd\x01\n(GetPrefundedSpecializedBalanceResponseV0\x12\x15\n\x07\x62\x61lance\x18\x01 \x01(\x04\x42\x02\x30\x01H\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadataB\x08\n\x06resultB\t\n\x07version\"\xd0\x01\n GetTotalCreditsInPlatformRequest\x12l\n\x02v0\x18\x01 \x01(\x0b\x32^.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0H\x00\x1a\x33\n\"GetTotalCreditsInPlatformRequestV0\x12\r\n\x05prove\x18\x01 \x01(\x08\x42\t\n\x07version\"\xd9\x02\n!GetTotalCreditsInPlatformResponse\x12n\n\x02v0\x18\x01 \x01(\x0b\x32`.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0H\x00\x1a\xb8\x01\n#GetTotalCreditsInPlatformResponseV0\x12\x15\n\x07\x63redits\x18\x01 \x01(\x04\x42\x02\x30\x01H\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadataB\x08\n\x06resultB\t\n\x07version\"\xc4\x01\n\x16GetPathElementsRequest\x12X\n\x02v0\x18\x01 \x01(\x0b\x32J.org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0H\x00\x1a\x45\n\x18GetPathElementsRequestV0\x12\x0c\n\x04path\x18\x01 \x03(\x0c\x12\x0c\n\x04keys\x18\x02 \x03(\x0c\x12\r\n\x05prove\x18\x03 \x01(\x08\x42\t\n\x07version\"\xa3\x03\n\x17GetPathElementsResponse\x12Z\n\x02v0\x18\x01 \x01(\x0b\x32L.org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0H\x00\x1a\xa0\x02\n\x19GetPathElementsResponseV0\x12i\n\x08\x65lements\x18\x01 \x01(\x0b\x32U.org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.ElementsH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a\x1c\n\x08\x45lements\x12\x10\n\x08\x65lements\x18\x01 \x03(\x0c\x42\x08\n\x06resultB\t\n\x07version\"\x81\x01\n\x10GetStatusRequest\x12L\n\x02v0\x18\x01 \x01(\x0b\x32>.org.dash.platform.dapi.v0.GetStatusRequest.GetStatusRequestV0H\x00\x1a\x14\n\x12GetStatusRequestV0B\t\n\x07version\"\xd0\x10\n\x11GetStatusResponse\x12N\n\x02v0\x18\x01 \x01(\x0b\x32@.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0H\x00\x1a\xdf\x0f\n\x13GetStatusResponseV0\x12Y\n\x07version\x18\x01 \x01(\x0b\x32H.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version\x12S\n\x04node\x18\x02 \x01(\x0b\x32\x45.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node\x12U\n\x05\x63hain\x18\x03 \x01(\x0b\x32\x46.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain\x12Y\n\x07network\x18\x04 \x01(\x0b\x32H.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network\x12^\n\nstate_sync\x18\x05 \x01(\x0b\x32J.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync\x12S\n\x04time\x18\x06 \x01(\x0b\x32\x45.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time\x1a\xee\x04\n\x07Version\x12\x63\n\x08software\x18\x01 \x01(\x0b\x32Q.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software\x12\x63\n\x08protocol\x18\x02 \x01(\x0b\x32Q.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol\x1a^\n\x08Software\x12\x0c\n\x04\x64\x61pi\x18\x01 \x01(\t\x12\x12\n\x05\x64rive\x18\x02 \x01(\tH\x00\x88\x01\x01\x12\x17\n\ntenderdash\x18\x03 \x01(\tH\x01\x88\x01\x01\x42\x08\n\x06_driveB\r\n\x0b_tenderdash\x1a\xb8\x02\n\x08Protocol\x12p\n\ntenderdash\x18\x01 \x01(\x0b\x32\\.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash\x12\x66\n\x05\x64rive\x18\x02 \x01(\x0b\x32W.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive\x1a(\n\nTenderdash\x12\x0b\n\x03p2p\x18\x01 \x01(\r\x12\r\n\x05\x62lock\x18\x02 \x01(\r\x1a(\n\x05\x44rive\x12\x0e\n\x06latest\x18\x03 \x01(\r\x12\x0f\n\x07\x63urrent\x18\x04 \x01(\r\x1a\x7f\n\x04Time\x12\x11\n\x05local\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\x16\n\x05\x62lock\x18\x02 \x01(\x04\x42\x02\x30\x01H\x00\x88\x01\x01\x12\x18\n\x07genesis\x18\x03 \x01(\x04\x42\x02\x30\x01H\x01\x88\x01\x01\x12\x12\n\x05\x65poch\x18\x04 \x01(\rH\x02\x88\x01\x01\x42\x08\n\x06_blockB\n\n\x08_genesisB\x08\n\x06_epoch\x1a<\n\x04Node\x12\n\n\x02id\x18\x01 \x01(\x0c\x12\x18\n\x0bpro_tx_hash\x18\x02 \x01(\x0cH\x00\x88\x01\x01\x42\x0e\n\x0c_pro_tx_hash\x1a\xb3\x02\n\x05\x43hain\x12\x13\n\x0b\x63\x61tching_up\x18\x01 \x01(\x08\x12\x19\n\x11latest_block_hash\x18\x02 \x01(\x0c\x12\x17\n\x0flatest_app_hash\x18\x03 \x01(\x0c\x12\x1f\n\x13latest_block_height\x18\x04 \x01(\x04\x42\x02\x30\x01\x12\x1b\n\x13\x65\x61rliest_block_hash\x18\x05 \x01(\x0c\x12\x19\n\x11\x65\x61rliest_app_hash\x18\x06 \x01(\x0c\x12!\n\x15\x65\x61rliest_block_height\x18\x07 \x01(\x04\x42\x02\x30\x01\x12!\n\x15max_peer_block_height\x18\t \x01(\x04\x42\x02\x30\x01\x12%\n\x18\x63ore_chain_locked_height\x18\n \x01(\rH\x00\x88\x01\x01\x42\x1b\n\x19_core_chain_locked_height\x1a\x43\n\x07Network\x12\x10\n\x08\x63hain_id\x18\x01 \x01(\t\x12\x13\n\x0bpeers_count\x18\x02 \x01(\r\x12\x11\n\tlistening\x18\x03 \x01(\x08\x1a\x85\x02\n\tStateSync\x12\x1d\n\x11total_synced_time\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\x1a\n\x0eremaining_time\x18\x02 \x01(\x04\x42\x02\x30\x01\x12\x17\n\x0ftotal_snapshots\x18\x03 \x01(\r\x12\"\n\x16\x63hunk_process_avg_time\x18\x04 \x01(\x04\x42\x02\x30\x01\x12\x1b\n\x0fsnapshot_height\x18\x05 \x01(\x04\x42\x02\x30\x01\x12!\n\x15snapshot_chunks_count\x18\x06 \x01(\x04\x42\x02\x30\x01\x12\x1d\n\x11\x62\x61\x63kfilled_blocks\x18\x07 \x01(\x04\x42\x02\x30\x01\x12!\n\x15\x62\x61\x63kfill_blocks_total\x18\x08 \x01(\x04\x42\x02\x30\x01\x42\t\n\x07version\"\xb1\x01\n\x1cGetCurrentQuorumsInfoRequest\x12\x64\n\x02v0\x18\x01 \x01(\x0b\x32V.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0H\x00\x1a \n\x1eGetCurrentQuorumsInfoRequestV0B\t\n\x07version\"\xa1\x05\n\x1dGetCurrentQuorumsInfoResponse\x12\x66\n\x02v0\x18\x01 \x01(\x0b\x32X.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0H\x00\x1a\x46\n\x0bValidatorV0\x12\x13\n\x0bpro_tx_hash\x18\x01 \x01(\x0c\x12\x0f\n\x07node_ip\x18\x02 \x01(\t\x12\x11\n\tis_banned\x18\x03 \x01(\x08\x1a\xaf\x01\n\x0eValidatorSetV0\x12\x13\n\x0bquorum_hash\x18\x01 \x01(\x0c\x12\x13\n\x0b\x63ore_height\x18\x02 \x01(\r\x12U\n\x07members\x18\x03 \x03(\x0b\x32\x44.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0\x12\x1c\n\x14threshold_public_key\x18\x04 \x01(\x0c\x1a\x92\x02\n\x1fGetCurrentQuorumsInfoResponseV0\x12\x15\n\rquorum_hashes\x18\x01 \x03(\x0c\x12\x1b\n\x13\x63urrent_quorum_hash\x18\x02 \x01(\x0c\x12_\n\x0evalidator_sets\x18\x03 \x03(\x0b\x32G.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0\x12\x1b\n\x13last_block_proposer\x18\x04 \x01(\x0c\x12=\n\x08metadata\x18\x05 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadataB\t\n\x07version\"\xf4\x01\n\x1fGetIdentityTokenBalancesRequest\x12j\n\x02v0\x18\x01 \x01(\x0b\x32\\.org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0H\x00\x1aZ\n!GetIdentityTokenBalancesRequestV0\x12\x13\n\x0bidentity_id\x18\x01 \x01(\x0c\x12\x11\n\ttoken_ids\x18\x02 \x03(\x0c\x12\r\n\x05prove\x18\x03 \x01(\x08\x42\t\n\x07version\"\xad\x05\n GetIdentityTokenBalancesResponse\x12l\n\x02v0\x18\x01 \x01(\x0b\x32^.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0H\x00\x1a\x8f\x04\n\"GetIdentityTokenBalancesResponseV0\x12\x86\x01\n\x0etoken_balances\x18\x01 \x01(\x0b\x32l.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalancesH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1aG\n\x11TokenBalanceEntry\x12\x10\n\x08token_id\x18\x01 \x01(\x0c\x12\x14\n\x07\x62\x61lance\x18\x02 \x01(\x04H\x00\x88\x01\x01\x42\n\n\x08_balance\x1a\x9a\x01\n\rTokenBalances\x12\x88\x01\n\x0etoken_balances\x18\x01 \x03(\x0b\x32p.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntryB\x08\n\x06resultB\t\n\x07version\"\xfc\x01\n!GetIdentitiesTokenBalancesRequest\x12n\n\x02v0\x18\x01 \x01(\x0b\x32`.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0H\x00\x1a\\\n#GetIdentitiesTokenBalancesRequestV0\x12\x10\n\x08token_id\x18\x01 \x01(\x0c\x12\x14\n\x0cidentity_ids\x18\x02 \x03(\x0c\x12\r\n\x05prove\x18\x03 \x01(\x08\x42\t\n\x07version\"\xf2\x05\n\"GetIdentitiesTokenBalancesResponse\x12p\n\x02v0\x18\x01 \x01(\x0b\x32\x62.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0H\x00\x1a\xce\x04\n$GetIdentitiesTokenBalancesResponseV0\x12\x9b\x01\n\x17identity_token_balances\x18\x01 \x01(\x0b\x32x.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalancesH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1aR\n\x19IdentityTokenBalanceEntry\x12\x13\n\x0bidentity_id\x18\x01 \x01(\x0c\x12\x14\n\x07\x62\x61lance\x18\x02 \x01(\x04H\x00\x88\x01\x01\x42\n\n\x08_balance\x1a\xb7\x01\n\x15IdentityTokenBalances\x12\x9d\x01\n\x17identity_token_balances\x18\x01 \x03(\x0b\x32|.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntryB\x08\n\x06resultB\t\n\x07version\"\xe8\x01\n\x1cGetIdentityTokenInfosRequest\x12\x64\n\x02v0\x18\x01 \x01(\x0b\x32V.org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0H\x00\x1aW\n\x1eGetIdentityTokenInfosRequestV0\x12\x13\n\x0bidentity_id\x18\x01 \x01(\x0c\x12\x11\n\ttoken_ids\x18\x02 \x03(\x0c\x12\r\n\x05prove\x18\x03 \x01(\x08\x42\t\n\x07version\"\x98\x06\n\x1dGetIdentityTokenInfosResponse\x12\x66\n\x02v0\x18\x01 \x01(\x0b\x32X.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0H\x00\x1a\x83\x05\n\x1fGetIdentityTokenInfosResponseV0\x12z\n\x0btoken_infos\x18\x01 \x01(\x0b\x32\x63.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfosH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a(\n\x16TokenIdentityInfoEntry\x12\x0e\n\x06\x66rozen\x18\x01 \x01(\x08\x1a\xb0\x01\n\x0eTokenInfoEntry\x12\x10\n\x08token_id\x18\x01 \x01(\x0c\x12\x82\x01\n\x04info\x18\x02 \x01(\x0b\x32o.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenIdentityInfoEntryH\x00\x88\x01\x01\x42\x07\n\x05_info\x1a\x8a\x01\n\nTokenInfos\x12|\n\x0btoken_infos\x18\x01 \x03(\x0b\x32g.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntryB\x08\n\x06resultB\t\n\x07version\"\xf0\x01\n\x1eGetIdentitiesTokenInfosRequest\x12h\n\x02v0\x18\x01 \x01(\x0b\x32Z.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0H\x00\x1aY\n GetIdentitiesTokenInfosRequestV0\x12\x10\n\x08token_id\x18\x01 \x01(\x0c\x12\x14\n\x0cidentity_ids\x18\x02 \x03(\x0c\x12\r\n\x05prove\x18\x03 \x01(\x08\x42\t\n\x07version\"\xca\x06\n\x1fGetIdentitiesTokenInfosResponse\x12j\n\x02v0\x18\x01 \x01(\x0b\x32\\.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0H\x00\x1a\xaf\x05\n!GetIdentitiesTokenInfosResponseV0\x12\x8f\x01\n\x14identity_token_infos\x18\x01 \x01(\x0b\x32o.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfosH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a(\n\x16TokenIdentityInfoEntry\x12\x0e\n\x06\x66rozen\x18\x01 \x01(\x08\x1a\xb7\x01\n\x0eTokenInfoEntry\x12\x13\n\x0bidentity_id\x18\x01 \x01(\x0c\x12\x86\x01\n\x04info\x18\x02 \x01(\x0b\x32s.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenIdentityInfoEntryH\x00\x88\x01\x01\x42\x07\n\x05_info\x1a\x97\x01\n\x12IdentityTokenInfos\x12\x80\x01\n\x0btoken_infos\x18\x01 \x03(\x0b\x32k.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntryB\x08\n\x06resultB\t\n\x07version\"\xbf\x01\n\x17GetTokenStatusesRequest\x12Z\n\x02v0\x18\x01 \x01(\x0b\x32L.org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0H\x00\x1a=\n\x19GetTokenStatusesRequestV0\x12\x11\n\ttoken_ids\x18\x01 \x03(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\xe7\x04\n\x18GetTokenStatusesResponse\x12\\\n\x02v0\x18\x01 \x01(\x0b\x32N.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0H\x00\x1a\xe1\x03\n\x1aGetTokenStatusesResponseV0\x12v\n\x0etoken_statuses\x18\x01 \x01(\x0b\x32\\.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusesH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a\x44\n\x10TokenStatusEntry\x12\x10\n\x08token_id\x18\x01 \x01(\x0c\x12\x13\n\x06paused\x18\x02 \x01(\x08H\x00\x88\x01\x01\x42\t\n\x07_paused\x1a\x88\x01\n\rTokenStatuses\x12w\n\x0etoken_statuses\x18\x01 \x03(\x0b\x32_.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntryB\x08\n\x06resultB\t\n\x07version\"\xef\x04\n)GetTokenPreProgrammedDistributionsRequest\x12~\n\x02v0\x18\x01 \x01(\x0b\x32p.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0H\x00\x1a\xb6\x03\n+GetTokenPreProgrammedDistributionsRequestV0\x12\x10\n\x08token_id\x18\x01 \x01(\x0c\x12\x98\x01\n\rstart_at_info\x18\x02 \x01(\x0b\x32|.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfoH\x00\x88\x01\x01\x12\x12\n\x05limit\x18\x03 \x01(\rH\x01\x88\x01\x01\x12\r\n\x05prove\x18\x04 \x01(\x08\x1a\x9a\x01\n\x0bStartAtInfo\x12\x15\n\rstart_time_ms\x18\x01 \x01(\x04\x12\x1c\n\x0fstart_recipient\x18\x02 \x01(\x0cH\x00\x88\x01\x01\x12%\n\x18start_recipient_included\x18\x03 \x01(\x08H\x01\x88\x01\x01\x42\x12\n\x10_start_recipientB\x1b\n\x19_start_recipient_includedB\x10\n\x0e_start_at_infoB\x08\n\x06_limitB\t\n\x07version\"\xec\x07\n*GetTokenPreProgrammedDistributionsResponse\x12\x80\x01\n\x02v0\x18\x01 \x01(\x0b\x32r.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0H\x00\x1a\xaf\x06\n,GetTokenPreProgrammedDistributionsResponseV0\x12\xa5\x01\n\x13token_distributions\x18\x01 \x01(\x0b\x32\x85\x01.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionsH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a>\n\x16TokenDistributionEntry\x12\x14\n\x0crecipient_id\x18\x01 \x01(\x0c\x12\x0e\n\x06\x61mount\x18\x02 \x01(\x04\x1a\xd4\x01\n\x1bTokenTimedDistributionEntry\x12\x11\n\ttimestamp\x18\x01 \x01(\x04\x12\xa1\x01\n\rdistributions\x18\x02 \x03(\x0b\x32\x89\x01.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry\x1a\xc3\x01\n\x12TokenDistributions\x12\xac\x01\n\x13token_distributions\x18\x01 \x03(\x0b\x32\x8e\x01.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntryB\x08\n\x06resultB\t\n\x07version\"\xca\x01\n\x1aGetTokenTotalSupplyRequest\x12`\n\x02v0\x18\x01 \x01(\x0b\x32R.org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0H\x00\x1a?\n\x1cGetTokenTotalSupplyRequestV0\x12\x10\n\x08token_id\x18\x01 \x01(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\xaf\x04\n\x1bGetTokenTotalSupplyResponse\x12\x62\n\x02v0\x18\x01 \x01(\x0b\x32T.org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0H\x00\x1a\xa0\x03\n\x1dGetTokenTotalSupplyResponseV0\x12\x88\x01\n\x12token_total_supply\x18\x01 \x01(\x0b\x32j.org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntryH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1ax\n\x15TokenTotalSupplyEntry\x12\x10\n\x08token_id\x18\x01 \x01(\x0c\x12\x30\n(total_aggregated_amount_in_user_accounts\x18\x02 \x01(\x04\x12\x1b\n\x13total_system_amount\x18\x03 \x01(\x04\x42\x08\n\x06resultB\t\n\x07version\"\xd2\x01\n\x13GetGroupInfoRequest\x12R\n\x02v0\x18\x01 \x01(\x0b\x32\x44.org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0H\x00\x1a\\\n\x15GetGroupInfoRequestV0\x12\x13\n\x0b\x63ontract_id\x18\x01 \x01(\x0c\x12\x1f\n\x17group_contract_position\x18\x02 \x01(\r\x12\r\n\x05prove\x18\x03 \x01(\x08\x42\t\n\x07version\"\xd4\x05\n\x14GetGroupInfoResponse\x12T\n\x02v0\x18\x01 \x01(\x0b\x32\x46.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0H\x00\x1a\xda\x04\n\x16GetGroupInfoResponseV0\x12\x66\n\ngroup_info\x18\x01 \x01(\x0b\x32P.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x04 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a\x34\n\x10GroupMemberEntry\x12\x11\n\tmember_id\x18\x01 \x01(\x0c\x12\r\n\x05power\x18\x02 \x01(\r\x1a\x98\x01\n\x0eGroupInfoEntry\x12h\n\x07members\x18\x01 \x03(\x0b\x32W.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupMemberEntry\x12\x1c\n\x14group_required_power\x18\x02 \x01(\r\x1a\x8a\x01\n\tGroupInfo\x12n\n\ngroup_info\x18\x01 \x01(\x0b\x32U.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntryH\x00\x88\x01\x01\x42\r\n\x0b_group_infoB\x08\n\x06resultB\t\n\x07version\"\xed\x03\n\x14GetGroupInfosRequest\x12T\n\x02v0\x18\x01 \x01(\x0b\x32\x46.org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0H\x00\x1au\n\x1cStartAtGroupContractPosition\x12%\n\x1dstart_group_contract_position\x18\x01 \x01(\r\x12.\n&start_group_contract_position_included\x18\x02 \x01(\x08\x1a\xfc\x01\n\x16GetGroupInfosRequestV0\x12\x13\n\x0b\x63ontract_id\x18\x01 \x01(\x0c\x12{\n start_at_group_contract_position\x18\x02 \x01(\x0b\x32L.org.dash.platform.dapi.v0.GetGroupInfosRequest.StartAtGroupContractPositionH\x00\x88\x01\x01\x12\x12\n\x05\x63ount\x18\x03 \x01(\rH\x01\x88\x01\x01\x12\r\n\x05prove\x18\x04 \x01(\x08\x42#\n!_start_at_group_contract_positionB\x08\n\x06_countB\t\n\x07version\"\xff\x05\n\x15GetGroupInfosResponse\x12V\n\x02v0\x18\x01 \x01(\x0b\x32H.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0H\x00\x1a\x82\x05\n\x17GetGroupInfosResponseV0\x12j\n\x0bgroup_infos\x18\x01 \x01(\x0b\x32S.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfosH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x04 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a\x34\n\x10GroupMemberEntry\x12\x11\n\tmember_id\x18\x01 \x01(\x0c\x12\r\n\x05power\x18\x02 \x01(\r\x1a\xc3\x01\n\x16GroupPositionInfoEntry\x12\x1f\n\x17group_contract_position\x18\x01 \x01(\r\x12j\n\x07members\x18\x02 \x03(\x0b\x32Y.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupMemberEntry\x12\x1c\n\x14group_required_power\x18\x03 \x01(\r\x1a\x82\x01\n\nGroupInfos\x12t\n\x0bgroup_infos\x18\x01 \x03(\x0b\x32_.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntryB\x08\n\x06resultB\t\n\x07version\"\xbe\x04\n\x16GetGroupActionsRequest\x12X\n\x02v0\x18\x01 \x01(\x0b\x32J.org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0H\x00\x1aL\n\x0fStartAtActionId\x12\x17\n\x0fstart_action_id\x18\x01 \x01(\x0c\x12 \n\x18start_action_id_included\x18\x02 \x01(\x08\x1a\xc8\x02\n\x18GetGroupActionsRequestV0\x12\x13\n\x0b\x63ontract_id\x18\x01 \x01(\x0c\x12\x1f\n\x17group_contract_position\x18\x02 \x01(\r\x12N\n\x06status\x18\x03 \x01(\x0e\x32>.org.dash.platform.dapi.v0.GetGroupActionsRequest.ActionStatus\x12\x62\n\x12start_at_action_id\x18\x04 \x01(\x0b\x32\x41.org.dash.platform.dapi.v0.GetGroupActionsRequest.StartAtActionIdH\x00\x88\x01\x01\x12\x12\n\x05\x63ount\x18\x05 \x01(\rH\x01\x88\x01\x01\x12\r\n\x05prove\x18\x06 \x01(\x08\x42\x15\n\x13_start_at_action_idB\x08\n\x06_count\"&\n\x0c\x41\x63tionStatus\x12\n\n\x06\x41\x43TIVE\x10\x00\x12\n\n\x06\x43LOSED\x10\x01\x42\t\n\x07version\"\xd1\x19\n\x17GetGroupActionsResponse\x12Z\n\x02v0\x18\x01 \x01(\x0b\x32L.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0H\x00\x1a\xce\x18\n\x19GetGroupActionsResponseV0\x12r\n\rgroup_actions\x18\x01 \x01(\x0b\x32Y.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionsH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a[\n\tMintEvent\x12\x0e\n\x06\x61mount\x18\x01 \x01(\x04\x12\x14\n\x0crecipient_id\x18\x02 \x01(\x0c\x12\x18\n\x0bpublic_note\x18\x03 \x01(\tH\x00\x88\x01\x01\x42\x0e\n\x0c_public_note\x1a\x45\n\tBurnEvent\x12\x0e\n\x06\x61mount\x18\x01 \x01(\x04\x12\x18\n\x0bpublic_note\x18\x02 \x01(\tH\x00\x88\x01\x01\x42\x0e\n\x0c_public_note\x1aJ\n\x0b\x46reezeEvent\x12\x11\n\tfrozen_id\x18\x01 \x01(\x0c\x12\x18\n\x0bpublic_note\x18\x02 \x01(\tH\x00\x88\x01\x01\x42\x0e\n\x0c_public_note\x1aL\n\rUnfreezeEvent\x12\x11\n\tfrozen_id\x18\x01 \x01(\x0c\x12\x18\n\x0bpublic_note\x18\x02 \x01(\tH\x00\x88\x01\x01\x42\x0e\n\x0c_public_note\x1a\x66\n\x17\x44\x65stroyFrozenFundsEvent\x12\x11\n\tfrozen_id\x18\x01 \x01(\x0c\x12\x0e\n\x06\x61mount\x18\x02 \x01(\x04\x12\x18\n\x0bpublic_note\x18\x03 \x01(\tH\x00\x88\x01\x01\x42\x0e\n\x0c_public_note\x1a\x64\n\x13SharedEncryptedNote\x12\x18\n\x10sender_key_index\x18\x01 \x01(\r\x12\x1b\n\x13recipient_key_index\x18\x02 \x01(\r\x12\x16\n\x0e\x65ncrypted_data\x18\x03 \x01(\x0c\x1a{\n\x15PersonalEncryptedNote\x12!\n\x19root_encryption_key_index\x18\x01 \x01(\r\x12\'\n\x1f\x64\x65rivation_encryption_key_index\x18\x02 \x01(\r\x12\x16\n\x0e\x65ncrypted_data\x18\x03 \x01(\x0c\x1a\xe9\x01\n\x14\x45mergencyActionEvent\x12\x81\x01\n\x0b\x61\x63tion_type\x18\x01 \x01(\x0e\x32l.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent.ActionType\x12\x18\n\x0bpublic_note\x18\x02 \x01(\tH\x00\x88\x01\x01\"#\n\nActionType\x12\t\n\x05PAUSE\x10\x00\x12\n\n\x06RESUME\x10\x01\x42\x0e\n\x0c_public_note\x1a\x64\n\x16TokenConfigUpdateEvent\x12 \n\x18token_config_update_item\x18\x01 \x01(\x0c\x12\x18\n\x0bpublic_note\x18\x02 \x01(\tH\x00\x88\x01\x01\x42\x0e\n\x0c_public_note\x1a\xfc\x02\n\x10GroupActionEvent\x12n\n\x0btoken_event\x18\x01 \x01(\x0b\x32W.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEventH\x00\x12t\n\x0e\x64ocument_event\x18\x02 \x01(\x0b\x32Z.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEventH\x00\x12t\n\x0e\x63ontract_event\x18\x03 \x01(\x0b\x32Z.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEventH\x00\x42\x0c\n\nevent_type\x1a\x8b\x01\n\rDocumentEvent\x12r\n\x06\x63reate\x18\x01 \x01(\x0b\x32`.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentCreateEventH\x00\x42\x06\n\x04type\x1a/\n\x13\x44ocumentCreateEvent\x12\x18\n\x10\x63reated_document\x18\x01 \x01(\x0c\x1a/\n\x13\x43ontractUpdateEvent\x12\x18\n\x10updated_contract\x18\x01 \x01(\x0c\x1a\x8b\x01\n\rContractEvent\x12r\n\x06update\x18\x01 \x01(\x0b\x32`.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractUpdateEventH\x00\x42\x06\n\x04type\x1a\xcb\x06\n\nTokenEvent\x12\x66\n\x04mint\x18\x01 \x01(\x0b\x32V.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEventH\x00\x12\x66\n\x04\x62urn\x18\x02 \x01(\x0b\x32V.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnEventH\x00\x12j\n\x06\x66reeze\x18\x03 \x01(\x0b\x32X.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.FreezeEventH\x00\x12n\n\x08unfreeze\x18\x04 \x01(\x0b\x32Z.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEventH\x00\x12\x84\x01\n\x14\x64\x65stroy_frozen_funds\x18\x05 \x01(\x0b\x32\x64.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEventH\x00\x12}\n\x10\x65mergency_action\x18\x06 \x01(\x0b\x32\x61.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEventH\x00\x12\x82\x01\n\x13token_config_update\x18\x07 \x01(\x0b\x32\x63.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEventH\x00\x42\x06\n\x04type\x1a\x93\x01\n\x10GroupActionEntry\x12\x11\n\taction_id\x18\x01 \x01(\x0c\x12l\n\x05\x65vent\x18\x02 \x01(\x0b\x32].org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent\x1a\x84\x01\n\x0cGroupActions\x12t\n\rgroup_actions\x18\x01 \x03(\x0b\x32].org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntryB\x08\n\x06resultB\t\n\x07version\"\x88\x03\n\x1cGetGroupActionSignersRequest\x12\x64\n\x02v0\x18\x01 \x01(\x0b\x32V.org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0H\x00\x1a\xce\x01\n\x1eGetGroupActionSignersRequestV0\x12\x13\n\x0b\x63ontract_id\x18\x01 \x01(\x0c\x12\x1f\n\x17group_contract_position\x18\x02 \x01(\r\x12T\n\x06status\x18\x03 \x01(\x0e\x32\x44.org.dash.platform.dapi.v0.GetGroupActionSignersRequest.ActionStatus\x12\x11\n\taction_id\x18\x04 \x01(\x0c\x12\r\n\x05prove\x18\x05 \x01(\x08\"&\n\x0c\x41\x63tionStatus\x12\n\n\x06\x41\x43TIVE\x10\x00\x12\n\n\x06\x43LOSED\x10\x01\x42\t\n\x07version\"\x8b\x05\n\x1dGetGroupActionSignersResponse\x12\x66\n\x02v0\x18\x01 \x01(\x0b\x32X.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0H\x00\x1a\xf6\x03\n\x1fGetGroupActionSignersResponseV0\x12\x8b\x01\n\x14group_action_signers\x18\x01 \x01(\x0b\x32k.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSignersH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a\x35\n\x11GroupActionSigner\x12\x11\n\tsigner_id\x18\x01 \x01(\x0c\x12\r\n\x05power\x18\x02 \x01(\r\x1a\x91\x01\n\x12GroupActionSigners\x12{\n\x07signers\x18\x01 \x03(\x0b\x32j.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSignerB\x08\n\x06resultB\t\n\x07version*Z\n\nKeyPurpose\x12\x12\n\x0e\x41UTHENTICATION\x10\x00\x12\x0e\n\nENCRYPTION\x10\x01\x12\x0e\n\nDECRYPTION\x10\x02\x12\x0c\n\x08TRANSFER\x10\x03\x12\n\n\x06VOTING\x10\x05\x32\x9a\x30\n\x08Platform\x12\x93\x01\n\x18\x62roadcastStateTransition\x12:.org.dash.platform.dapi.v0.BroadcastStateTransitionRequest\x1a;.org.dash.platform.dapi.v0.BroadcastStateTransitionResponse\x12l\n\x0bgetIdentity\x12-.org.dash.platform.dapi.v0.GetIdentityRequest\x1a..org.dash.platform.dapi.v0.GetIdentityResponse\x12x\n\x0fgetIdentityKeys\x12\x31.org.dash.platform.dapi.v0.GetIdentityKeysRequest\x1a\x32.org.dash.platform.dapi.v0.GetIdentityKeysResponse\x12\x96\x01\n\x19getIdentitiesContractKeys\x12;.org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest\x1a<.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse\x12{\n\x10getIdentityNonce\x12\x32.org.dash.platform.dapi.v0.GetIdentityNonceRequest\x1a\x33.org.dash.platform.dapi.v0.GetIdentityNonceResponse\x12\x93\x01\n\x18getIdentityContractNonce\x12:.org.dash.platform.dapi.v0.GetIdentityContractNonceRequest\x1a;.org.dash.platform.dapi.v0.GetIdentityContractNonceResponse\x12\x81\x01\n\x12getIdentityBalance\x12\x34.org.dash.platform.dapi.v0.GetIdentityBalanceRequest\x1a\x35.org.dash.platform.dapi.v0.GetIdentityBalanceResponse\x12\x8a\x01\n\x15getIdentitiesBalances\x12\x37.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest\x1a\x38.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse\x12\xa2\x01\n\x1dgetIdentityBalanceAndRevision\x12?.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest\x1a@.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse\x12\xaf\x01\n#getEvonodesProposedEpochBlocksByIds\x12\x45.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest\x1a\x41.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse\x12\xb3\x01\n%getEvonodesProposedEpochBlocksByRange\x12G.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest\x1a\x41.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse\x12\x66\n\tgetProofs\x12+.org.dash.platform.dapi.v0.GetProofsRequest\x1a,.org.dash.platform.dapi.v0.GetProofsResponse\x12x\n\x0fgetDataContract\x12\x31.org.dash.platform.dapi.v0.GetDataContractRequest\x1a\x32.org.dash.platform.dapi.v0.GetDataContractResponse\x12\x8d\x01\n\x16getDataContractHistory\x12\x38.org.dash.platform.dapi.v0.GetDataContractHistoryRequest\x1a\x39.org.dash.platform.dapi.v0.GetDataContractHistoryResponse\x12{\n\x10getDataContracts\x12\x32.org.dash.platform.dapi.v0.GetDataContractsRequest\x1a\x33.org.dash.platform.dapi.v0.GetDataContractsResponse\x12o\n\x0cgetDocuments\x12..org.dash.platform.dapi.v0.GetDocumentsRequest\x1a/.org.dash.platform.dapi.v0.GetDocumentsResponse\x12\x99\x01\n\x1agetIdentityByPublicKeyHash\x12<.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest\x1a=.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse\x12\x9f\x01\n\x1cwaitForStateTransitionResult\x12>.org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest\x1a?.org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse\x12\x81\x01\n\x12getConsensusParams\x12\x34.org.dash.platform.dapi.v0.GetConsensusParamsRequest\x1a\x35.org.dash.platform.dapi.v0.GetConsensusParamsResponse\x12\xa5\x01\n\x1egetProtocolVersionUpgradeState\x12@.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest\x1a\x41.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse\x12\xb4\x01\n#getProtocolVersionUpgradeVoteStatus\x12\x45.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest\x1a\x46.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse\x12r\n\rgetEpochsInfo\x12/.org.dash.platform.dapi.v0.GetEpochsInfoRequest\x1a\x30.org.dash.platform.dapi.v0.GetEpochsInfoResponse\x12\x8a\x01\n\x15getContestedResources\x12\x37.org.dash.platform.dapi.v0.GetContestedResourcesRequest\x1a\x38.org.dash.platform.dapi.v0.GetContestedResourcesResponse\x12\xa2\x01\n\x1dgetContestedResourceVoteState\x12?.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest\x1a@.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse\x12\xba\x01\n%getContestedResourceVotersForIdentity\x12G.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest\x1aH.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse\x12\xae\x01\n!getContestedResourceIdentityVotes\x12\x43.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest\x1a\x44.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse\x12\x8a\x01\n\x15getVotePollsByEndDate\x12\x37.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest\x1a\x38.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse\x12\xa5\x01\n\x1egetPrefundedSpecializedBalance\x12@.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest\x1a\x41.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse\x12\x96\x01\n\x19getTotalCreditsInPlatform\x12;.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest\x1a<.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse\x12x\n\x0fgetPathElements\x12\x31.org.dash.platform.dapi.v0.GetPathElementsRequest\x1a\x32.org.dash.platform.dapi.v0.GetPathElementsResponse\x12\x66\n\tgetStatus\x12+.org.dash.platform.dapi.v0.GetStatusRequest\x1a,.org.dash.platform.dapi.v0.GetStatusResponse\x12\x8a\x01\n\x15getCurrentQuorumsInfo\x12\x37.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest\x1a\x38.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse\x12\x93\x01\n\x18getIdentityTokenBalances\x12:.org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest\x1a;.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse\x12\x99\x01\n\x1agetIdentitiesTokenBalances\x12<.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest\x1a=.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse\x12\x8a\x01\n\x15getIdentityTokenInfos\x12\x37.org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest\x1a\x38.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse\x12\x90\x01\n\x17getIdentitiesTokenInfos\x12\x39.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest\x1a:.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse\x12{\n\x10getTokenStatuses\x12\x32.org.dash.platform.dapi.v0.GetTokenStatusesRequest\x1a\x33.org.dash.platform.dapi.v0.GetTokenStatusesResponse\x12\xb1\x01\n\"getTokenPreProgrammedDistributions\x12\x44.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest\x1a\x45.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse\x12\x84\x01\n\x13getTokenTotalSupply\x12\x35.org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest\x1a\x36.org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse\x12o\n\x0cgetGroupInfo\x12..org.dash.platform.dapi.v0.GetGroupInfoRequest\x1a/.org.dash.platform.dapi.v0.GetGroupInfoResponse\x12r\n\rgetGroupInfos\x12/.org.dash.platform.dapi.v0.GetGroupInfosRequest\x1a\x30.org.dash.platform.dapi.v0.GetGroupInfosResponse\x12x\n\x0fgetGroupActions\x12\x31.org.dash.platform.dapi.v0.GetGroupActionsRequest\x1a\x32.org.dash.platform.dapi.v0.GetGroupActionsResponse\x12\x8a\x01\n\x15getGroupActionSigners\x12\x37.org.dash.platform.dapi.v0.GetGroupActionSignersRequest\x1a\x38.org.dash.platform.dapi.v0.GetGroupActionSignersResponseb\x06proto3' + serialized_pb=b'\n\x0eplatform.proto\x12\x19org.dash.platform.dapi.v0\x1a\x1egoogle/protobuf/wrappers.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x81\x01\n\x05Proof\x12\x15\n\rgrovedb_proof\x18\x01 \x01(\x0c\x12\x13\n\x0bquorum_hash\x18\x02 \x01(\x0c\x12\x11\n\tsignature\x18\x03 \x01(\x0c\x12\r\n\x05round\x18\x04 \x01(\r\x12\x15\n\rblock_id_hash\x18\x05 \x01(\x0c\x12\x13\n\x0bquorum_type\x18\x06 \x01(\r\"\x98\x01\n\x10ResponseMetadata\x12\x12\n\x06height\x18\x01 \x01(\x04\x42\x02\x30\x01\x12 \n\x18\x63ore_chain_locked_height\x18\x02 \x01(\r\x12\r\n\x05\x65poch\x18\x03 \x01(\r\x12\x13\n\x07time_ms\x18\x04 \x01(\x04\x42\x02\x30\x01\x12\x18\n\x10protocol_version\x18\x05 \x01(\r\x12\x10\n\x08\x63hain_id\x18\x06 \x01(\t\"L\n\x1dStateTransitionBroadcastError\x12\x0c\n\x04\x63ode\x18\x01 \x01(\r\x12\x0f\n\x07message\x18\x02 \x01(\t\x12\x0c\n\x04\x64\x61ta\x18\x03 \x01(\x0c\";\n\x1f\x42roadcastStateTransitionRequest\x12\x18\n\x10state_transition\x18\x01 \x01(\x0c\"\"\n BroadcastStateTransitionResponse\"\xa4\x01\n\x12GetIdentityRequest\x12P\n\x02v0\x18\x01 \x01(\x0b\x32\x42.org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0H\x00\x1a\x31\n\x14GetIdentityRequestV0\x12\n\n\x02id\x18\x01 \x01(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\xc1\x01\n\x17GetIdentityNonceRequest\x12Z\n\x02v0\x18\x01 \x01(\x0b\x32L.org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0H\x00\x1a?\n\x19GetIdentityNonceRequestV0\x12\x13\n\x0bidentity_id\x18\x01 \x01(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\xf6\x01\n\x1fGetIdentityContractNonceRequest\x12j\n\x02v0\x18\x01 \x01(\x0b\x32\\.org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0H\x00\x1a\\\n!GetIdentityContractNonceRequestV0\x12\x13\n\x0bidentity_id\x18\x01 \x01(\x0c\x12\x13\n\x0b\x63ontract_id\x18\x02 \x01(\x0c\x12\r\n\x05prove\x18\x03 \x01(\x08\x42\t\n\x07version\"\xc0\x01\n\x19GetIdentityBalanceRequest\x12^\n\x02v0\x18\x01 \x01(\x0b\x32P.org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0H\x00\x1a\x38\n\x1bGetIdentityBalanceRequestV0\x12\n\n\x02id\x18\x01 \x01(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\xec\x01\n$GetIdentityBalanceAndRevisionRequest\x12t\n\x02v0\x18\x01 \x01(\x0b\x32\x66.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0H\x00\x1a\x43\n&GetIdentityBalanceAndRevisionRequestV0\x12\n\n\x02id\x18\x01 \x01(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\x9e\x02\n\x13GetIdentityResponse\x12R\n\x02v0\x18\x01 \x01(\x0b\x32\x44.org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0H\x00\x1a\xa7\x01\n\x15GetIdentityResponseV0\x12\x12\n\x08identity\x18\x01 \x01(\x0cH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadataB\x08\n\x06resultB\t\n\x07version\"\xbc\x02\n\x18GetIdentityNonceResponse\x12\\\n\x02v0\x18\x01 \x01(\x0b\x32N.org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0H\x00\x1a\xb6\x01\n\x1aGetIdentityNonceResponseV0\x12\x1c\n\x0eidentity_nonce\x18\x01 \x01(\x04\x42\x02\x30\x01H\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadataB\x08\n\x06resultB\t\n\x07version\"\xe5\x02\n GetIdentityContractNonceResponse\x12l\n\x02v0\x18\x01 \x01(\x0b\x32^.org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0H\x00\x1a\xc7\x01\n\"GetIdentityContractNonceResponseV0\x12%\n\x17identity_contract_nonce\x18\x01 \x01(\x04\x42\x02\x30\x01H\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadataB\x08\n\x06resultB\t\n\x07version\"\xbd\x02\n\x1aGetIdentityBalanceResponse\x12`\n\x02v0\x18\x01 \x01(\x0b\x32R.org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0H\x00\x1a\xb1\x01\n\x1cGetIdentityBalanceResponseV0\x12\x15\n\x07\x62\x61lance\x18\x01 \x01(\x04\x42\x02\x30\x01H\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadataB\x08\n\x06resultB\t\n\x07version\"\xb1\x04\n%GetIdentityBalanceAndRevisionResponse\x12v\n\x02v0\x18\x01 \x01(\x0b\x32h.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0H\x00\x1a\x84\x03\n\'GetIdentityBalanceAndRevisionResponseV0\x12\x9b\x01\n\x14\x62\x61lance_and_revision\x18\x01 \x01(\x0b\x32{.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevisionH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a?\n\x12\x42\x61lanceAndRevision\x12\x13\n\x07\x62\x61lance\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\x14\n\x08revision\x18\x02 \x01(\x04\x42\x02\x30\x01\x42\x08\n\x06resultB\t\n\x07version\"\xd1\x01\n\x0eKeyRequestType\x12\x36\n\x08\x61ll_keys\x18\x01 \x01(\x0b\x32\".org.dash.platform.dapi.v0.AllKeysH\x00\x12@\n\rspecific_keys\x18\x02 \x01(\x0b\x32\'.org.dash.platform.dapi.v0.SpecificKeysH\x00\x12:\n\nsearch_key\x18\x03 \x01(\x0b\x32$.org.dash.platform.dapi.v0.SearchKeyH\x00\x42\t\n\x07request\"\t\n\x07\x41llKeys\"\x1f\n\x0cSpecificKeys\x12\x0f\n\x07key_ids\x18\x01 \x03(\r\"\xb6\x01\n\tSearchKey\x12I\n\x0bpurpose_map\x18\x01 \x03(\x0b\x32\x34.org.dash.platform.dapi.v0.SearchKey.PurposeMapEntry\x1a^\n\x0fPurposeMapEntry\x12\x0b\n\x03key\x18\x01 \x01(\r\x12:\n\x05value\x18\x02 \x01(\x0b\x32+.org.dash.platform.dapi.v0.SecurityLevelMap:\x02\x38\x01\"\xbf\x02\n\x10SecurityLevelMap\x12]\n\x12security_level_map\x18\x01 \x03(\x0b\x32\x41.org.dash.platform.dapi.v0.SecurityLevelMap.SecurityLevelMapEntry\x1aw\n\x15SecurityLevelMapEntry\x12\x0b\n\x03key\x18\x01 \x01(\r\x12M\n\x05value\x18\x02 \x01(\x0e\x32>.org.dash.platform.dapi.v0.SecurityLevelMap.KeyKindRequestType:\x02\x38\x01\"S\n\x12KeyKindRequestType\x12\x1f\n\x1b\x43URRENT_KEY_OF_KIND_REQUEST\x10\x00\x12\x1c\n\x18\x41LL_KEYS_OF_KIND_REQUEST\x10\x01\"\xda\x02\n\x16GetIdentityKeysRequest\x12X\n\x02v0\x18\x01 \x01(\x0b\x32J.org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0H\x00\x1a\xda\x01\n\x18GetIdentityKeysRequestV0\x12\x13\n\x0bidentity_id\x18\x01 \x01(\x0c\x12?\n\x0crequest_type\x18\x02 \x01(\x0b\x32).org.dash.platform.dapi.v0.KeyRequestType\x12+\n\x05limit\x18\x03 \x01(\x0b\x32\x1c.google.protobuf.UInt32Value\x12,\n\x06offset\x18\x04 \x01(\x0b\x32\x1c.google.protobuf.UInt32Value\x12\r\n\x05prove\x18\x05 \x01(\x08\x42\t\n\x07version\"\x99\x03\n\x17GetIdentityKeysResponse\x12Z\n\x02v0\x18\x01 \x01(\x0b\x32L.org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0H\x00\x1a\x96\x02\n\x19GetIdentityKeysResponseV0\x12\x61\n\x04keys\x18\x01 \x01(\x0b\x32Q.org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.KeysH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a\x1a\n\x04Keys\x12\x12\n\nkeys_bytes\x18\x01 \x03(\x0c\x42\x08\n\x06resultB\t\n\x07version\"\xef\x02\n GetIdentitiesContractKeysRequest\x12l\n\x02v0\x18\x01 \x01(\x0b\x32^.org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0H\x00\x1a\xd1\x01\n\"GetIdentitiesContractKeysRequestV0\x12\x16\n\x0eidentities_ids\x18\x01 \x03(\x0c\x12\x13\n\x0b\x63ontract_id\x18\x02 \x01(\x0c\x12\x1f\n\x12\x64ocument_type_name\x18\x03 \x01(\tH\x00\x88\x01\x01\x12\x37\n\x08purposes\x18\x04 \x03(\x0e\x32%.org.dash.platform.dapi.v0.KeyPurpose\x12\r\n\x05prove\x18\x05 \x01(\x08\x42\x15\n\x13_document_type_nameB\t\n\x07version\"\xdf\x06\n!GetIdentitiesContractKeysResponse\x12n\n\x02v0\x18\x01 \x01(\x0b\x32`.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0H\x00\x1a\xbe\x05\n#GetIdentitiesContractKeysResponseV0\x12\x8a\x01\n\x0fidentities_keys\x18\x01 \x01(\x0b\x32o.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeysH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1aY\n\x0bPurposeKeys\x12\x36\n\x07purpose\x18\x01 \x01(\x0e\x32%.org.dash.platform.dapi.v0.KeyPurpose\x12\x12\n\nkeys_bytes\x18\x02 \x03(\x0c\x1a\x9f\x01\n\x0cIdentityKeys\x12\x13\n\x0bidentity_id\x18\x01 \x01(\x0c\x12z\n\x04keys\x18\x02 \x03(\x0b\x32l.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys\x1a\x90\x01\n\x0eIdentitiesKeys\x12~\n\x07\x65ntries\x18\x01 \x03(\x0b\x32m.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeysB\x08\n\x06resultB\t\n\x07version\"\xa4\x02\n*GetEvonodesProposedEpochBlocksByIdsRequest\x12\x80\x01\n\x02v0\x18\x01 \x01(\x0b\x32r.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0H\x00\x1ah\n,GetEvonodesProposedEpochBlocksByIdsRequestV0\x12\x12\n\x05\x65poch\x18\x01 \x01(\rH\x00\x88\x01\x01\x12\x0b\n\x03ids\x18\x02 \x03(\x0c\x12\r\n\x05prove\x18\x03 \x01(\x08\x42\x08\n\x06_epochB\t\n\x07version\"\x92\x06\n&GetEvonodesProposedEpochBlocksResponse\x12x\n\x02v0\x18\x01 \x01(\x0b\x32j.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0H\x00\x1a\xe2\x04\n(GetEvonodesProposedEpochBlocksResponseV0\x12\xb1\x01\n#evonodes_proposed_block_counts_info\x18\x01 \x01(\x0b\x32\x81\x01.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocksH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a?\n\x15\x45vonodeProposedBlocks\x12\x13\n\x0bpro_tx_hash\x18\x01 \x01(\x0c\x12\x11\n\x05\x63ount\x18\x02 \x01(\x04\x42\x02\x30\x01\x1a\xc4\x01\n\x16\x45vonodesProposedBlocks\x12\xa9\x01\n\x1e\x65vonodes_proposed_block_counts\x18\x01 \x03(\x0b\x32\x80\x01.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocksB\x08\n\x06resultB\t\n\x07version\"\xf2\x02\n,GetEvonodesProposedEpochBlocksByRangeRequest\x12\x84\x01\n\x02v0\x18\x01 \x01(\x0b\x32v.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0H\x00\x1a\xaf\x01\n.GetEvonodesProposedEpochBlocksByRangeRequestV0\x12\x12\n\x05\x65poch\x18\x01 \x01(\rH\x01\x88\x01\x01\x12\x12\n\x05limit\x18\x02 \x01(\rH\x02\x88\x01\x01\x12\x15\n\x0bstart_after\x18\x03 \x01(\x0cH\x00\x12\x12\n\x08start_at\x18\x04 \x01(\x0cH\x00\x12\r\n\x05prove\x18\x05 \x01(\x08\x42\x07\n\x05startB\x08\n\x06_epochB\x08\n\x06_limitB\t\n\x07version\"\xcd\x01\n\x1cGetIdentitiesBalancesRequest\x12\x64\n\x02v0\x18\x01 \x01(\x0b\x32V.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0H\x00\x1a<\n\x1eGetIdentitiesBalancesRequestV0\x12\x0b\n\x03ids\x18\x01 \x03(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\x9f\x05\n\x1dGetIdentitiesBalancesResponse\x12\x66\n\x02v0\x18\x01 \x01(\x0b\x32X.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0H\x00\x1a\x8a\x04\n\x1fGetIdentitiesBalancesResponseV0\x12\x8a\x01\n\x13identities_balances\x18\x01 \x01(\x0b\x32k.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalancesH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1aL\n\x0fIdentityBalance\x12\x13\n\x0bidentity_id\x18\x01 \x01(\x0c\x12\x18\n\x07\x62\x61lance\x18\x02 \x01(\x04\x42\x02\x30\x01H\x00\x88\x01\x01\x42\n\n\x08_balance\x1a\x8f\x01\n\x12IdentitiesBalances\x12y\n\x07\x65ntries\x18\x01 \x03(\x0b\x32h.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalanceB\x08\n\x06resultB\t\n\x07version\"\xb4\x01\n\x16GetDataContractRequest\x12X\n\x02v0\x18\x01 \x01(\x0b\x32J.org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0H\x00\x1a\x35\n\x18GetDataContractRequestV0\x12\n\n\x02id\x18\x01 \x01(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\xb3\x02\n\x17GetDataContractResponse\x12Z\n\x02v0\x18\x01 \x01(\x0b\x32L.org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0H\x00\x1a\xb0\x01\n\x19GetDataContractResponseV0\x12\x17\n\rdata_contract\x18\x01 \x01(\x0cH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadataB\x08\n\x06resultB\t\n\x07version\"\xb9\x01\n\x17GetDataContractsRequest\x12Z\n\x02v0\x18\x01 \x01(\x0b\x32L.org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0H\x00\x1a\x37\n\x19GetDataContractsRequestV0\x12\x0b\n\x03ids\x18\x01 \x03(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\xcf\x04\n\x18GetDataContractsResponse\x12\\\n\x02v0\x18\x01 \x01(\x0b\x32N.org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0H\x00\x1a[\n\x11\x44\x61taContractEntry\x12\x12\n\nidentifier\x18\x01 \x01(\x0c\x12\x32\n\rdata_contract\x18\x02 \x01(\x0b\x32\x1b.google.protobuf.BytesValue\x1au\n\rDataContracts\x12\x64\n\x15\x64\x61ta_contract_entries\x18\x01 \x03(\x0b\x32\x45.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry\x1a\xf5\x01\n\x1aGetDataContractsResponseV0\x12[\n\x0e\x64\x61ta_contracts\x18\x01 \x01(\x0b\x32\x41.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractsH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadataB\x08\n\x06resultB\t\n\x07version\"\xc5\x02\n\x1dGetDataContractHistoryRequest\x12\x66\n\x02v0\x18\x01 \x01(\x0b\x32X.org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0H\x00\x1a\xb0\x01\n\x1fGetDataContractHistoryRequestV0\x12\n\n\x02id\x18\x01 \x01(\x0c\x12+\n\x05limit\x18\x02 \x01(\x0b\x32\x1c.google.protobuf.UInt32Value\x12,\n\x06offset\x18\x03 \x01(\x0b\x32\x1c.google.protobuf.UInt32Value\x12\x17\n\x0bstart_at_ms\x18\x04 \x01(\x04\x42\x02\x30\x01\x12\r\n\x05prove\x18\x05 \x01(\x08\x42\t\n\x07version\"\xb2\x05\n\x1eGetDataContractHistoryResponse\x12h\n\x02v0\x18\x01 \x01(\x0b\x32Z.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0H\x00\x1a\x9a\x04\n GetDataContractHistoryResponseV0\x12\x8f\x01\n\x15\x64\x61ta_contract_history\x18\x01 \x01(\x0b\x32n.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a;\n\x18\x44\x61taContractHistoryEntry\x12\x10\n\x04\x64\x61te\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\r\n\x05value\x18\x02 \x01(\x0c\x1a\xaa\x01\n\x13\x44\x61taContractHistory\x12\x92\x01\n\x15\x64\x61ta_contract_entries\x18\x01 \x03(\x0b\x32s.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntryB\x08\n\x06resultB\t\n\x07version\"\xb2\x02\n\x13GetDocumentsRequest\x12R\n\x02v0\x18\x01 \x01(\x0b\x32\x44.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0H\x00\x1a\xbb\x01\n\x15GetDocumentsRequestV0\x12\x18\n\x10\x64\x61ta_contract_id\x18\x01 \x01(\x0c\x12\x15\n\rdocument_type\x18\x02 \x01(\t\x12\r\n\x05where\x18\x03 \x01(\x0c\x12\x10\n\x08order_by\x18\x04 \x01(\x0c\x12\r\n\x05limit\x18\x05 \x01(\r\x12\x15\n\x0bstart_after\x18\x06 \x01(\x0cH\x00\x12\x12\n\x08start_at\x18\x07 \x01(\x0cH\x00\x12\r\n\x05prove\x18\x08 \x01(\x08\x42\x07\n\x05startB\t\n\x07version\"\x95\x03\n\x14GetDocumentsResponse\x12T\n\x02v0\x18\x01 \x01(\x0b\x32\x46.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0H\x00\x1a\x9b\x02\n\x16GetDocumentsResponseV0\x12\x65\n\tdocuments\x18\x01 \x01(\x0b\x32P.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.DocumentsH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a\x1e\n\tDocuments\x12\x11\n\tdocuments\x18\x01 \x03(\x0c\x42\x08\n\x06resultB\t\n\x07version\"\xed\x01\n!GetIdentityByPublicKeyHashRequest\x12n\n\x02v0\x18\x01 \x01(\x0b\x32`.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0H\x00\x1aM\n#GetIdentityByPublicKeyHashRequestV0\x12\x17\n\x0fpublic_key_hash\x18\x01 \x01(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\xda\x02\n\"GetIdentityByPublicKeyHashResponse\x12p\n\x02v0\x18\x01 \x01(\x0b\x32\x62.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0H\x00\x1a\xb6\x01\n$GetIdentityByPublicKeyHashResponseV0\x12\x12\n\x08identity\x18\x01 \x01(\x0cH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadataB\x08\n\x06resultB\t\n\x07version\"\xfb\x01\n#WaitForStateTransitionResultRequest\x12r\n\x02v0\x18\x01 \x01(\x0b\x32\x64.org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0H\x00\x1aU\n%WaitForStateTransitionResultRequestV0\x12\x1d\n\x15state_transition_hash\x18\x01 \x01(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\x99\x03\n$WaitForStateTransitionResultResponse\x12t\n\x02v0\x18\x01 \x01(\x0b\x32\x66.org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0H\x00\x1a\xef\x01\n&WaitForStateTransitionResultResponseV0\x12I\n\x05\x65rror\x18\x01 \x01(\x0b\x32\x38.org.dash.platform.dapi.v0.StateTransitionBroadcastErrorH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadataB\x08\n\x06resultB\t\n\x07version\"\xc4\x01\n\x19GetConsensusParamsRequest\x12^\n\x02v0\x18\x01 \x01(\x0b\x32P.org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0H\x00\x1a<\n\x1bGetConsensusParamsRequestV0\x12\x0e\n\x06height\x18\x01 \x01(\x05\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\x9c\x04\n\x1aGetConsensusParamsResponse\x12`\n\x02v0\x18\x01 \x01(\x0b\x32R.org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0H\x00\x1aP\n\x14\x43onsensusParamsBlock\x12\x11\n\tmax_bytes\x18\x01 \x01(\t\x12\x0f\n\x07max_gas\x18\x02 \x01(\t\x12\x14\n\x0ctime_iota_ms\x18\x03 \x01(\t\x1a\x62\n\x17\x43onsensusParamsEvidence\x12\x1a\n\x12max_age_num_blocks\x18\x01 \x01(\t\x12\x18\n\x10max_age_duration\x18\x02 \x01(\t\x12\x11\n\tmax_bytes\x18\x03 \x01(\t\x1a\xda\x01\n\x1cGetConsensusParamsResponseV0\x12Y\n\x05\x62lock\x18\x01 \x01(\x0b\x32J.org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock\x12_\n\x08\x65vidence\x18\x02 \x01(\x0b\x32M.org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidenceB\t\n\x07version\"\xe4\x01\n%GetProtocolVersionUpgradeStateRequest\x12v\n\x02v0\x18\x01 \x01(\x0b\x32h.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0H\x00\x1a\x38\n\'GetProtocolVersionUpgradeStateRequestV0\x12\r\n\x05prove\x18\x01 \x01(\x08\x42\t\n\x07version\"\xb5\x05\n&GetProtocolVersionUpgradeStateResponse\x12x\n\x02v0\x18\x01 \x01(\x0b\x32j.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0H\x00\x1a\x85\x04\n(GetProtocolVersionUpgradeStateResponseV0\x12\x87\x01\n\x08versions\x18\x01 \x01(\x0b\x32s.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionsH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a\x96\x01\n\x08Versions\x12\x89\x01\n\x08versions\x18\x01 \x03(\x0b\x32w.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry\x1a:\n\x0cVersionEntry\x12\x16\n\x0eversion_number\x18\x01 \x01(\r\x12\x12\n\nvote_count\x18\x02 \x01(\rB\x08\n\x06resultB\t\n\x07version\"\xa3\x02\n*GetProtocolVersionUpgradeVoteStatusRequest\x12\x80\x01\n\x02v0\x18\x01 \x01(\x0b\x32r.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0H\x00\x1ag\n,GetProtocolVersionUpgradeVoteStatusRequestV0\x12\x19\n\x11start_pro_tx_hash\x18\x01 \x01(\x0c\x12\r\n\x05\x63ount\x18\x02 \x01(\r\x12\r\n\x05prove\x18\x03 \x01(\x08\x42\t\n\x07version\"\xef\x05\n+GetProtocolVersionUpgradeVoteStatusResponse\x12\x82\x01\n\x02v0\x18\x01 \x01(\x0b\x32t.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0H\x00\x1a\xaf\x04\n-GetProtocolVersionUpgradeVoteStatusResponseV0\x12\x98\x01\n\x08versions\x18\x01 \x01(\x0b\x32\x83\x01.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignalsH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a\xaf\x01\n\x0eVersionSignals\x12\x9c\x01\n\x0fversion_signals\x18\x01 \x03(\x0b\x32\x82\x01.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal\x1a\x35\n\rVersionSignal\x12\x13\n\x0bpro_tx_hash\x18\x01 \x01(\x0c\x12\x0f\n\x07version\x18\x02 \x01(\rB\x08\n\x06resultB\t\n\x07version\"\xf5\x01\n\x14GetEpochsInfoRequest\x12T\n\x02v0\x18\x01 \x01(\x0b\x32\x46.org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0H\x00\x1a|\n\x16GetEpochsInfoRequestV0\x12\x31\n\x0bstart_epoch\x18\x01 \x01(\x0b\x32\x1c.google.protobuf.UInt32Value\x12\r\n\x05\x63ount\x18\x02 \x01(\r\x12\x11\n\tascending\x18\x03 \x01(\x08\x12\r\n\x05prove\x18\x04 \x01(\x08\x42\t\n\x07version\"\x99\x05\n\x15GetEpochsInfoResponse\x12V\n\x02v0\x18\x01 \x01(\x0b\x32H.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0H\x00\x1a\x9c\x04\n\x17GetEpochsInfoResponseV0\x12\x65\n\x06\x65pochs\x18\x01 \x01(\x0b\x32S.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfosH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1au\n\nEpochInfos\x12g\n\x0b\x65poch_infos\x18\x01 \x03(\x0b\x32R.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo\x1a\xa6\x01\n\tEpochInfo\x12\x0e\n\x06number\x18\x01 \x01(\r\x12\x1e\n\x12\x66irst_block_height\x18\x02 \x01(\x04\x42\x02\x30\x01\x12\x1f\n\x17\x66irst_core_block_height\x18\x03 \x01(\r\x12\x16\n\nstart_time\x18\x04 \x01(\x04\x42\x02\x30\x01\x12\x16\n\x0e\x66\x65\x65_multiplier\x18\x05 \x01(\x01\x12\x18\n\x10protocol_version\x18\x06 \x01(\rB\x08\n\x06resultB\t\n\x07version\"\xde\x04\n\x1cGetContestedResourcesRequest\x12\x64\n\x02v0\x18\x01 \x01(\x0b\x32V.org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0H\x00\x1a\xcc\x03\n\x1eGetContestedResourcesRequestV0\x12\x13\n\x0b\x63ontract_id\x18\x01 \x01(\x0c\x12\x1a\n\x12\x64ocument_type_name\x18\x02 \x01(\t\x12\x12\n\nindex_name\x18\x03 \x01(\t\x12\x1a\n\x12start_index_values\x18\x04 \x03(\x0c\x12\x18\n\x10\x65nd_index_values\x18\x05 \x03(\x0c\x12\x89\x01\n\x13start_at_value_info\x18\x06 \x01(\x0b\x32g.org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfoH\x00\x88\x01\x01\x12\x12\n\x05\x63ount\x18\x07 \x01(\rH\x01\x88\x01\x01\x12\x17\n\x0forder_ascending\x18\x08 \x01(\x08\x12\r\n\x05prove\x18\t \x01(\x08\x1a\x45\n\x10StartAtValueInfo\x12\x13\n\x0bstart_value\x18\x01 \x01(\x0c\x12\x1c\n\x14start_value_included\x18\x02 \x01(\x08\x42\x16\n\x14_start_at_value_infoB\x08\n\x06_countB\t\n\x07version\"\x88\x04\n\x1dGetContestedResourcesResponse\x12\x66\n\x02v0\x18\x01 \x01(\x0b\x32X.org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0H\x00\x1a\xf3\x02\n\x1fGetContestedResourcesResponseV0\x12\x95\x01\n\x19\x63ontested_resource_values\x18\x01 \x01(\x0b\x32p.org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValuesH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a<\n\x17\x43ontestedResourceValues\x12!\n\x19\x63ontested_resource_values\x18\x01 \x03(\x0c\x42\x08\n\x06resultB\t\n\x07version\"\xd2\x05\n\x1cGetVotePollsByEndDateRequest\x12\x64\n\x02v0\x18\x01 \x01(\x0b\x32V.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0H\x00\x1a\xc0\x04\n\x1eGetVotePollsByEndDateRequestV0\x12\x84\x01\n\x0fstart_time_info\x18\x01 \x01(\x0b\x32\x66.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfoH\x00\x88\x01\x01\x12\x80\x01\n\rend_time_info\x18\x02 \x01(\x0b\x32\x64.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfoH\x01\x88\x01\x01\x12\x12\n\x05limit\x18\x03 \x01(\rH\x02\x88\x01\x01\x12\x13\n\x06offset\x18\x04 \x01(\rH\x03\x88\x01\x01\x12\x11\n\tascending\x18\x05 \x01(\x08\x12\r\n\x05prove\x18\x06 \x01(\x08\x1aI\n\x0fStartAtTimeInfo\x12\x19\n\rstart_time_ms\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\x1b\n\x13start_time_included\x18\x02 \x01(\x08\x1a\x43\n\rEndAtTimeInfo\x12\x17\n\x0b\x65nd_time_ms\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\x19\n\x11\x65nd_time_included\x18\x02 \x01(\x08\x42\x12\n\x10_start_time_infoB\x10\n\x0e_end_time_infoB\x08\n\x06_limitB\t\n\x07_offsetB\t\n\x07version\"\x83\x06\n\x1dGetVotePollsByEndDateResponse\x12\x66\n\x02v0\x18\x01 \x01(\x0b\x32X.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0H\x00\x1a\xee\x04\n\x1fGetVotePollsByEndDateResponseV0\x12\x9c\x01\n\x18vote_polls_by_timestamps\x18\x01 \x01(\x0b\x32x.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestampsH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1aV\n\x1eSerializedVotePollsByTimestamp\x12\x15\n\ttimestamp\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\x1d\n\x15serialized_vote_polls\x18\x02 \x03(\x0c\x1a\xd7\x01\n\x1fSerializedVotePollsByTimestamps\x12\x99\x01\n\x18vote_polls_by_timestamps\x18\x01 \x03(\x0b\x32w.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp\x12\x18\n\x10\x66inished_results\x18\x02 \x01(\x08\x42\x08\n\x06resultB\t\n\x07version\"\xff\x06\n$GetContestedResourceVoteStateRequest\x12t\n\x02v0\x18\x01 \x01(\x0b\x32\x66.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0H\x00\x1a\xd5\x05\n&GetContestedResourceVoteStateRequestV0\x12\x13\n\x0b\x63ontract_id\x18\x01 \x01(\x0c\x12\x1a\n\x12\x64ocument_type_name\x18\x02 \x01(\t\x12\x12\n\nindex_name\x18\x03 \x01(\t\x12\x14\n\x0cindex_values\x18\x04 \x03(\x0c\x12\x86\x01\n\x0bresult_type\x18\x05 \x01(\x0e\x32q.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.ResultType\x12\x36\n.allow_include_locked_and_abstaining_vote_tally\x18\x06 \x01(\x08\x12\xa3\x01\n\x18start_at_identifier_info\x18\x07 \x01(\x0b\x32|.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfoH\x00\x88\x01\x01\x12\x12\n\x05\x63ount\x18\x08 \x01(\rH\x01\x88\x01\x01\x12\r\n\x05prove\x18\t \x01(\x08\x1aT\n\x15StartAtIdentifierInfo\x12\x18\n\x10start_identifier\x18\x01 \x01(\x0c\x12!\n\x19start_identifier_included\x18\x02 \x01(\x08\"I\n\nResultType\x12\r\n\tDOCUMENTS\x10\x00\x12\x0e\n\nVOTE_TALLY\x10\x01\x12\x1c\n\x18\x44OCUMENTS_AND_VOTE_TALLY\x10\x02\x42\x1b\n\x19_start_at_identifier_infoB\x08\n\x06_countB\t\n\x07version\"\x94\x0c\n%GetContestedResourceVoteStateResponse\x12v\n\x02v0\x18\x01 \x01(\x0b\x32h.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0H\x00\x1a\xe7\n\n\'GetContestedResourceVoteStateResponseV0\x12\xae\x01\n\x1d\x63ontested_resource_contenders\x18\x01 \x01(\x0b\x32\x84\x01.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContendersH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a\xda\x03\n\x10\x46inishedVoteInfo\x12\xad\x01\n\x15\x66inished_vote_outcome\x18\x01 \x01(\x0e\x32\x8d\x01.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo.FinishedVoteOutcome\x12\x1f\n\x12won_by_identity_id\x18\x02 \x01(\x0cH\x00\x88\x01\x01\x12$\n\x18\x66inished_at_block_height\x18\x03 \x01(\x04\x42\x02\x30\x01\x12%\n\x1d\x66inished_at_core_block_height\x18\x04 \x01(\r\x12%\n\x19\x66inished_at_block_time_ms\x18\x05 \x01(\x04\x42\x02\x30\x01\x12\x19\n\x11\x66inished_at_epoch\x18\x06 \x01(\r\"O\n\x13\x46inishedVoteOutcome\x12\x14\n\x10TOWARDS_IDENTITY\x10\x00\x12\n\n\x06LOCKED\x10\x01\x12\x16\n\x12NO_PREVIOUS_WINNER\x10\x02\x42\x15\n\x13_won_by_identity_id\x1a\xc4\x03\n\x1b\x43ontestedResourceContenders\x12\x86\x01\n\ncontenders\x18\x01 \x03(\x0b\x32r.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender\x12\x1f\n\x12\x61\x62stain_vote_tally\x18\x02 \x01(\rH\x00\x88\x01\x01\x12\x1c\n\x0flock_vote_tally\x18\x03 \x01(\rH\x01\x88\x01\x01\x12\x9a\x01\n\x12\x66inished_vote_info\x18\x04 \x01(\x0b\x32y.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfoH\x02\x88\x01\x01\x42\x15\n\x13_abstain_vote_tallyB\x12\n\x10_lock_vote_tallyB\x15\n\x13_finished_vote_info\x1ak\n\tContender\x12\x12\n\nidentifier\x18\x01 \x01(\x0c\x12\x17\n\nvote_count\x18\x02 \x01(\rH\x00\x88\x01\x01\x12\x15\n\x08\x64ocument\x18\x03 \x01(\x0cH\x01\x88\x01\x01\x42\r\n\x0b_vote_countB\x0b\n\t_documentB\x08\n\x06resultB\t\n\x07version\"\xd5\x05\n,GetContestedResourceVotersForIdentityRequest\x12\x84\x01\n\x02v0\x18\x01 \x01(\x0b\x32v.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0H\x00\x1a\x92\x04\n.GetContestedResourceVotersForIdentityRequestV0\x12\x13\n\x0b\x63ontract_id\x18\x01 \x01(\x0c\x12\x1a\n\x12\x64ocument_type_name\x18\x02 \x01(\t\x12\x12\n\nindex_name\x18\x03 \x01(\t\x12\x14\n\x0cindex_values\x18\x04 \x03(\x0c\x12\x15\n\rcontestant_id\x18\x05 \x01(\x0c\x12\xb4\x01\n\x18start_at_identifier_info\x18\x06 \x01(\x0b\x32\x8c\x01.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfoH\x00\x88\x01\x01\x12\x12\n\x05\x63ount\x18\x07 \x01(\rH\x01\x88\x01\x01\x12\x17\n\x0forder_ascending\x18\x08 \x01(\x08\x12\r\n\x05prove\x18\t \x01(\x08\x1aT\n\x15StartAtIdentifierInfo\x12\x18\n\x10start_identifier\x18\x01 \x01(\x0c\x12!\n\x19start_identifier_included\x18\x02 \x01(\x08\x42\x1b\n\x19_start_at_identifier_infoB\x08\n\x06_countB\t\n\x07version\"\xf1\x04\n-GetContestedResourceVotersForIdentityResponse\x12\x86\x01\n\x02v0\x18\x01 \x01(\x0b\x32x.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0H\x00\x1a\xab\x03\n/GetContestedResourceVotersForIdentityResponseV0\x12\xb6\x01\n\x19\x63ontested_resource_voters\x18\x01 \x01(\x0b\x32\x90\x01.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVotersH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a\x43\n\x17\x43ontestedResourceVoters\x12\x0e\n\x06voters\x18\x01 \x03(\x0c\x12\x18\n\x10\x66inished_results\x18\x02 \x01(\x08\x42\x08\n\x06resultB\t\n\x07version\"\xad\x05\n(GetContestedResourceIdentityVotesRequest\x12|\n\x02v0\x18\x01 \x01(\x0b\x32n.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0H\x00\x1a\xf7\x03\n*GetContestedResourceIdentityVotesRequestV0\x12\x13\n\x0bidentity_id\x18\x01 \x01(\x0c\x12+\n\x05limit\x18\x02 \x01(\x0b\x32\x1c.google.protobuf.UInt32Value\x12,\n\x06offset\x18\x03 \x01(\x0b\x32\x1c.google.protobuf.UInt32Value\x12\x17\n\x0forder_ascending\x18\x04 \x01(\x08\x12\xae\x01\n\x1astart_at_vote_poll_id_info\x18\x05 \x01(\x0b\x32\x84\x01.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfoH\x00\x88\x01\x01\x12\r\n\x05prove\x18\x06 \x01(\x08\x1a\x61\n\x15StartAtVotePollIdInfo\x12 \n\x18start_at_poll_identifier\x18\x01 \x01(\x0c\x12&\n\x1estart_poll_identifier_included\x18\x02 \x01(\x08\x42\x1d\n\x1b_start_at_vote_poll_id_infoB\t\n\x07version\"\xc8\n\n)GetContestedResourceIdentityVotesResponse\x12~\n\x02v0\x18\x01 \x01(\x0b\x32p.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0H\x00\x1a\x8f\t\n+GetContestedResourceIdentityVotesResponseV0\x12\xa1\x01\n\x05votes\x18\x01 \x01(\x0b\x32\x8f\x01.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotesH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a\xf7\x01\n\x1e\x43ontestedResourceIdentityVotes\x12\xba\x01\n!contested_resource_identity_votes\x18\x01 \x03(\x0b\x32\x8e\x01.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote\x12\x18\n\x10\x66inished_results\x18\x02 \x01(\x08\x1a\xad\x02\n\x12ResourceVoteChoice\x12\xad\x01\n\x10vote_choice_type\x18\x01 \x01(\x0e\x32\x92\x01.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice.VoteChoiceType\x12\x18\n\x0bidentity_id\x18\x02 \x01(\x0cH\x00\x88\x01\x01\"=\n\x0eVoteChoiceType\x12\x14\n\x10TOWARDS_IDENTITY\x10\x00\x12\x0b\n\x07\x41\x42STAIN\x10\x01\x12\x08\n\x04LOCK\x10\x02\x42\x0e\n\x0c_identity_id\x1a\x95\x02\n\x1d\x43ontestedResourceIdentityVote\x12\x13\n\x0b\x63ontract_id\x18\x01 \x01(\x0c\x12\x1a\n\x12\x64ocument_type_name\x18\x02 \x01(\t\x12\'\n\x1fserialized_index_storage_values\x18\x03 \x03(\x0c\x12\x99\x01\n\x0bvote_choice\x18\x04 \x01(\x0b\x32\x83\x01.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoiceB\x08\n\x06resultB\t\n\x07version\"\xf0\x01\n%GetPrefundedSpecializedBalanceRequest\x12v\n\x02v0\x18\x01 \x01(\x0b\x32h.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0H\x00\x1a\x44\n\'GetPrefundedSpecializedBalanceRequestV0\x12\n\n\x02id\x18\x01 \x01(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\xed\x02\n&GetPrefundedSpecializedBalanceResponse\x12x\n\x02v0\x18\x01 \x01(\x0b\x32j.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0H\x00\x1a\xbd\x01\n(GetPrefundedSpecializedBalanceResponseV0\x12\x15\n\x07\x62\x61lance\x18\x01 \x01(\x04\x42\x02\x30\x01H\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadataB\x08\n\x06resultB\t\n\x07version\"\xd0\x01\n GetTotalCreditsInPlatformRequest\x12l\n\x02v0\x18\x01 \x01(\x0b\x32^.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0H\x00\x1a\x33\n\"GetTotalCreditsInPlatformRequestV0\x12\r\n\x05prove\x18\x01 \x01(\x08\x42\t\n\x07version\"\xd9\x02\n!GetTotalCreditsInPlatformResponse\x12n\n\x02v0\x18\x01 \x01(\x0b\x32`.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0H\x00\x1a\xb8\x01\n#GetTotalCreditsInPlatformResponseV0\x12\x15\n\x07\x63redits\x18\x01 \x01(\x04\x42\x02\x30\x01H\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadataB\x08\n\x06resultB\t\n\x07version\"\xc4\x01\n\x16GetPathElementsRequest\x12X\n\x02v0\x18\x01 \x01(\x0b\x32J.org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0H\x00\x1a\x45\n\x18GetPathElementsRequestV0\x12\x0c\n\x04path\x18\x01 \x03(\x0c\x12\x0c\n\x04keys\x18\x02 \x03(\x0c\x12\r\n\x05prove\x18\x03 \x01(\x08\x42\t\n\x07version\"\xa3\x03\n\x17GetPathElementsResponse\x12Z\n\x02v0\x18\x01 \x01(\x0b\x32L.org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0H\x00\x1a\xa0\x02\n\x19GetPathElementsResponseV0\x12i\n\x08\x65lements\x18\x01 \x01(\x0b\x32U.org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.ElementsH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a\x1c\n\x08\x45lements\x12\x10\n\x08\x65lements\x18\x01 \x03(\x0c\x42\x08\n\x06resultB\t\n\x07version\"\x81\x01\n\x10GetStatusRequest\x12L\n\x02v0\x18\x01 \x01(\x0b\x32>.org.dash.platform.dapi.v0.GetStatusRequest.GetStatusRequestV0H\x00\x1a\x14\n\x12GetStatusRequestV0B\t\n\x07version\"\xd0\x10\n\x11GetStatusResponse\x12N\n\x02v0\x18\x01 \x01(\x0b\x32@.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0H\x00\x1a\xdf\x0f\n\x13GetStatusResponseV0\x12Y\n\x07version\x18\x01 \x01(\x0b\x32H.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version\x12S\n\x04node\x18\x02 \x01(\x0b\x32\x45.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node\x12U\n\x05\x63hain\x18\x03 \x01(\x0b\x32\x46.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain\x12Y\n\x07network\x18\x04 \x01(\x0b\x32H.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network\x12^\n\nstate_sync\x18\x05 \x01(\x0b\x32J.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync\x12S\n\x04time\x18\x06 \x01(\x0b\x32\x45.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time\x1a\xee\x04\n\x07Version\x12\x63\n\x08software\x18\x01 \x01(\x0b\x32Q.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software\x12\x63\n\x08protocol\x18\x02 \x01(\x0b\x32Q.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol\x1a^\n\x08Software\x12\x0c\n\x04\x64\x61pi\x18\x01 \x01(\t\x12\x12\n\x05\x64rive\x18\x02 \x01(\tH\x00\x88\x01\x01\x12\x17\n\ntenderdash\x18\x03 \x01(\tH\x01\x88\x01\x01\x42\x08\n\x06_driveB\r\n\x0b_tenderdash\x1a\xb8\x02\n\x08Protocol\x12p\n\ntenderdash\x18\x01 \x01(\x0b\x32\\.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash\x12\x66\n\x05\x64rive\x18\x02 \x01(\x0b\x32W.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive\x1a(\n\nTenderdash\x12\x0b\n\x03p2p\x18\x01 \x01(\r\x12\r\n\x05\x62lock\x18\x02 \x01(\r\x1a(\n\x05\x44rive\x12\x0e\n\x06latest\x18\x03 \x01(\r\x12\x0f\n\x07\x63urrent\x18\x04 \x01(\r\x1a\x7f\n\x04Time\x12\x11\n\x05local\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\x16\n\x05\x62lock\x18\x02 \x01(\x04\x42\x02\x30\x01H\x00\x88\x01\x01\x12\x18\n\x07genesis\x18\x03 \x01(\x04\x42\x02\x30\x01H\x01\x88\x01\x01\x12\x12\n\x05\x65poch\x18\x04 \x01(\rH\x02\x88\x01\x01\x42\x08\n\x06_blockB\n\n\x08_genesisB\x08\n\x06_epoch\x1a<\n\x04Node\x12\n\n\x02id\x18\x01 \x01(\x0c\x12\x18\n\x0bpro_tx_hash\x18\x02 \x01(\x0cH\x00\x88\x01\x01\x42\x0e\n\x0c_pro_tx_hash\x1a\xb3\x02\n\x05\x43hain\x12\x13\n\x0b\x63\x61tching_up\x18\x01 \x01(\x08\x12\x19\n\x11latest_block_hash\x18\x02 \x01(\x0c\x12\x17\n\x0flatest_app_hash\x18\x03 \x01(\x0c\x12\x1f\n\x13latest_block_height\x18\x04 \x01(\x04\x42\x02\x30\x01\x12\x1b\n\x13\x65\x61rliest_block_hash\x18\x05 \x01(\x0c\x12\x19\n\x11\x65\x61rliest_app_hash\x18\x06 \x01(\x0c\x12!\n\x15\x65\x61rliest_block_height\x18\x07 \x01(\x04\x42\x02\x30\x01\x12!\n\x15max_peer_block_height\x18\t \x01(\x04\x42\x02\x30\x01\x12%\n\x18\x63ore_chain_locked_height\x18\n \x01(\rH\x00\x88\x01\x01\x42\x1b\n\x19_core_chain_locked_height\x1a\x43\n\x07Network\x12\x10\n\x08\x63hain_id\x18\x01 \x01(\t\x12\x13\n\x0bpeers_count\x18\x02 \x01(\r\x12\x11\n\tlistening\x18\x03 \x01(\x08\x1a\x85\x02\n\tStateSync\x12\x1d\n\x11total_synced_time\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\x1a\n\x0eremaining_time\x18\x02 \x01(\x04\x42\x02\x30\x01\x12\x17\n\x0ftotal_snapshots\x18\x03 \x01(\r\x12\"\n\x16\x63hunk_process_avg_time\x18\x04 \x01(\x04\x42\x02\x30\x01\x12\x1b\n\x0fsnapshot_height\x18\x05 \x01(\x04\x42\x02\x30\x01\x12!\n\x15snapshot_chunks_count\x18\x06 \x01(\x04\x42\x02\x30\x01\x12\x1d\n\x11\x62\x61\x63kfilled_blocks\x18\x07 \x01(\x04\x42\x02\x30\x01\x12!\n\x15\x62\x61\x63kfill_blocks_total\x18\x08 \x01(\x04\x42\x02\x30\x01\x42\t\n\x07version\"\xb1\x01\n\x1cGetCurrentQuorumsInfoRequest\x12\x64\n\x02v0\x18\x01 \x01(\x0b\x32V.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0H\x00\x1a \n\x1eGetCurrentQuorumsInfoRequestV0B\t\n\x07version\"\xa1\x05\n\x1dGetCurrentQuorumsInfoResponse\x12\x66\n\x02v0\x18\x01 \x01(\x0b\x32X.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0H\x00\x1a\x46\n\x0bValidatorV0\x12\x13\n\x0bpro_tx_hash\x18\x01 \x01(\x0c\x12\x0f\n\x07node_ip\x18\x02 \x01(\t\x12\x11\n\tis_banned\x18\x03 \x01(\x08\x1a\xaf\x01\n\x0eValidatorSetV0\x12\x13\n\x0bquorum_hash\x18\x01 \x01(\x0c\x12\x13\n\x0b\x63ore_height\x18\x02 \x01(\r\x12U\n\x07members\x18\x03 \x03(\x0b\x32\x44.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0\x12\x1c\n\x14threshold_public_key\x18\x04 \x01(\x0c\x1a\x92\x02\n\x1fGetCurrentQuorumsInfoResponseV0\x12\x15\n\rquorum_hashes\x18\x01 \x03(\x0c\x12\x1b\n\x13\x63urrent_quorum_hash\x18\x02 \x01(\x0c\x12_\n\x0evalidator_sets\x18\x03 \x03(\x0b\x32G.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0\x12\x1b\n\x13last_block_proposer\x18\x04 \x01(\x0c\x12=\n\x08metadata\x18\x05 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadataB\t\n\x07version\"\xf4\x01\n\x1fGetIdentityTokenBalancesRequest\x12j\n\x02v0\x18\x01 \x01(\x0b\x32\\.org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0H\x00\x1aZ\n!GetIdentityTokenBalancesRequestV0\x12\x13\n\x0bidentity_id\x18\x01 \x01(\x0c\x12\x11\n\ttoken_ids\x18\x02 \x03(\x0c\x12\r\n\x05prove\x18\x03 \x01(\x08\x42\t\n\x07version\"\xad\x05\n GetIdentityTokenBalancesResponse\x12l\n\x02v0\x18\x01 \x01(\x0b\x32^.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0H\x00\x1a\x8f\x04\n\"GetIdentityTokenBalancesResponseV0\x12\x86\x01\n\x0etoken_balances\x18\x01 \x01(\x0b\x32l.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalancesH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1aG\n\x11TokenBalanceEntry\x12\x10\n\x08token_id\x18\x01 \x01(\x0c\x12\x14\n\x07\x62\x61lance\x18\x02 \x01(\x04H\x00\x88\x01\x01\x42\n\n\x08_balance\x1a\x9a\x01\n\rTokenBalances\x12\x88\x01\n\x0etoken_balances\x18\x01 \x03(\x0b\x32p.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntryB\x08\n\x06resultB\t\n\x07version\"\xfc\x01\n!GetIdentitiesTokenBalancesRequest\x12n\n\x02v0\x18\x01 \x01(\x0b\x32`.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0H\x00\x1a\\\n#GetIdentitiesTokenBalancesRequestV0\x12\x10\n\x08token_id\x18\x01 \x01(\x0c\x12\x14\n\x0cidentity_ids\x18\x02 \x03(\x0c\x12\r\n\x05prove\x18\x03 \x01(\x08\x42\t\n\x07version\"\xf2\x05\n\"GetIdentitiesTokenBalancesResponse\x12p\n\x02v0\x18\x01 \x01(\x0b\x32\x62.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0H\x00\x1a\xce\x04\n$GetIdentitiesTokenBalancesResponseV0\x12\x9b\x01\n\x17identity_token_balances\x18\x01 \x01(\x0b\x32x.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalancesH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1aR\n\x19IdentityTokenBalanceEntry\x12\x13\n\x0bidentity_id\x18\x01 \x01(\x0c\x12\x14\n\x07\x62\x61lance\x18\x02 \x01(\x04H\x00\x88\x01\x01\x42\n\n\x08_balance\x1a\xb7\x01\n\x15IdentityTokenBalances\x12\x9d\x01\n\x17identity_token_balances\x18\x01 \x03(\x0b\x32|.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntryB\x08\n\x06resultB\t\n\x07version\"\xe8\x01\n\x1cGetIdentityTokenInfosRequest\x12\x64\n\x02v0\x18\x01 \x01(\x0b\x32V.org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0H\x00\x1aW\n\x1eGetIdentityTokenInfosRequestV0\x12\x13\n\x0bidentity_id\x18\x01 \x01(\x0c\x12\x11\n\ttoken_ids\x18\x02 \x03(\x0c\x12\r\n\x05prove\x18\x03 \x01(\x08\x42\t\n\x07version\"\x98\x06\n\x1dGetIdentityTokenInfosResponse\x12\x66\n\x02v0\x18\x01 \x01(\x0b\x32X.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0H\x00\x1a\x83\x05\n\x1fGetIdentityTokenInfosResponseV0\x12z\n\x0btoken_infos\x18\x01 \x01(\x0b\x32\x63.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfosH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a(\n\x16TokenIdentityInfoEntry\x12\x0e\n\x06\x66rozen\x18\x01 \x01(\x08\x1a\xb0\x01\n\x0eTokenInfoEntry\x12\x10\n\x08token_id\x18\x01 \x01(\x0c\x12\x82\x01\n\x04info\x18\x02 \x01(\x0b\x32o.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenIdentityInfoEntryH\x00\x88\x01\x01\x42\x07\n\x05_info\x1a\x8a\x01\n\nTokenInfos\x12|\n\x0btoken_infos\x18\x01 \x03(\x0b\x32g.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntryB\x08\n\x06resultB\t\n\x07version\"\xf0\x01\n\x1eGetIdentitiesTokenInfosRequest\x12h\n\x02v0\x18\x01 \x01(\x0b\x32Z.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0H\x00\x1aY\n GetIdentitiesTokenInfosRequestV0\x12\x10\n\x08token_id\x18\x01 \x01(\x0c\x12\x14\n\x0cidentity_ids\x18\x02 \x03(\x0c\x12\r\n\x05prove\x18\x03 \x01(\x08\x42\t\n\x07version\"\xca\x06\n\x1fGetIdentitiesTokenInfosResponse\x12j\n\x02v0\x18\x01 \x01(\x0b\x32\\.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0H\x00\x1a\xaf\x05\n!GetIdentitiesTokenInfosResponseV0\x12\x8f\x01\n\x14identity_token_infos\x18\x01 \x01(\x0b\x32o.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfosH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a(\n\x16TokenIdentityInfoEntry\x12\x0e\n\x06\x66rozen\x18\x01 \x01(\x08\x1a\xb7\x01\n\x0eTokenInfoEntry\x12\x13\n\x0bidentity_id\x18\x01 \x01(\x0c\x12\x86\x01\n\x04info\x18\x02 \x01(\x0b\x32s.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenIdentityInfoEntryH\x00\x88\x01\x01\x42\x07\n\x05_info\x1a\x97\x01\n\x12IdentityTokenInfos\x12\x80\x01\n\x0btoken_infos\x18\x01 \x03(\x0b\x32k.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntryB\x08\n\x06resultB\t\n\x07version\"\xbf\x01\n\x17GetTokenStatusesRequest\x12Z\n\x02v0\x18\x01 \x01(\x0b\x32L.org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0H\x00\x1a=\n\x19GetTokenStatusesRequestV0\x12\x11\n\ttoken_ids\x18\x01 \x03(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\xe7\x04\n\x18GetTokenStatusesResponse\x12\\\n\x02v0\x18\x01 \x01(\x0b\x32N.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0H\x00\x1a\xe1\x03\n\x1aGetTokenStatusesResponseV0\x12v\n\x0etoken_statuses\x18\x01 \x01(\x0b\x32\\.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusesH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a\x44\n\x10TokenStatusEntry\x12\x10\n\x08token_id\x18\x01 \x01(\x0c\x12\x13\n\x06paused\x18\x02 \x01(\x08H\x00\x88\x01\x01\x42\t\n\x07_paused\x1a\x88\x01\n\rTokenStatuses\x12w\n\x0etoken_statuses\x18\x01 \x03(\x0b\x32_.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntryB\x08\n\x06resultB\t\n\x07version\"\xef\x04\n)GetTokenPreProgrammedDistributionsRequest\x12~\n\x02v0\x18\x01 \x01(\x0b\x32p.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0H\x00\x1a\xb6\x03\n+GetTokenPreProgrammedDistributionsRequestV0\x12\x10\n\x08token_id\x18\x01 \x01(\x0c\x12\x98\x01\n\rstart_at_info\x18\x02 \x01(\x0b\x32|.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfoH\x00\x88\x01\x01\x12\x12\n\x05limit\x18\x03 \x01(\rH\x01\x88\x01\x01\x12\r\n\x05prove\x18\x04 \x01(\x08\x1a\x9a\x01\n\x0bStartAtInfo\x12\x15\n\rstart_time_ms\x18\x01 \x01(\x04\x12\x1c\n\x0fstart_recipient\x18\x02 \x01(\x0cH\x00\x88\x01\x01\x12%\n\x18start_recipient_included\x18\x03 \x01(\x08H\x01\x88\x01\x01\x42\x12\n\x10_start_recipientB\x1b\n\x19_start_recipient_includedB\x10\n\x0e_start_at_infoB\x08\n\x06_limitB\t\n\x07version\"\xec\x07\n*GetTokenPreProgrammedDistributionsResponse\x12\x80\x01\n\x02v0\x18\x01 \x01(\x0b\x32r.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0H\x00\x1a\xaf\x06\n,GetTokenPreProgrammedDistributionsResponseV0\x12\xa5\x01\n\x13token_distributions\x18\x01 \x01(\x0b\x32\x85\x01.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionsH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a>\n\x16TokenDistributionEntry\x12\x14\n\x0crecipient_id\x18\x01 \x01(\x0c\x12\x0e\n\x06\x61mount\x18\x02 \x01(\x04\x1a\xd4\x01\n\x1bTokenTimedDistributionEntry\x12\x11\n\ttimestamp\x18\x01 \x01(\x04\x12\xa1\x01\n\rdistributions\x18\x02 \x03(\x0b\x32\x89\x01.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry\x1a\xc3\x01\n\x12TokenDistributions\x12\xac\x01\n\x13token_distributions\x18\x01 \x03(\x0b\x32\x8e\x01.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntryB\x08\n\x06resultB\t\n\x07version\"\xca\x01\n\x1aGetTokenTotalSupplyRequest\x12`\n\x02v0\x18\x01 \x01(\x0b\x32R.org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0H\x00\x1a?\n\x1cGetTokenTotalSupplyRequestV0\x12\x10\n\x08token_id\x18\x01 \x01(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\xaf\x04\n\x1bGetTokenTotalSupplyResponse\x12\x62\n\x02v0\x18\x01 \x01(\x0b\x32T.org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0H\x00\x1a\xa0\x03\n\x1dGetTokenTotalSupplyResponseV0\x12\x88\x01\n\x12token_total_supply\x18\x01 \x01(\x0b\x32j.org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntryH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1ax\n\x15TokenTotalSupplyEntry\x12\x10\n\x08token_id\x18\x01 \x01(\x0c\x12\x30\n(total_aggregated_amount_in_user_accounts\x18\x02 \x01(\x04\x12\x1b\n\x13total_system_amount\x18\x03 \x01(\x04\x42\x08\n\x06resultB\t\n\x07version\"\xd2\x01\n\x13GetGroupInfoRequest\x12R\n\x02v0\x18\x01 \x01(\x0b\x32\x44.org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0H\x00\x1a\\\n\x15GetGroupInfoRequestV0\x12\x13\n\x0b\x63ontract_id\x18\x01 \x01(\x0c\x12\x1f\n\x17group_contract_position\x18\x02 \x01(\r\x12\r\n\x05prove\x18\x03 \x01(\x08\x42\t\n\x07version\"\xd4\x05\n\x14GetGroupInfoResponse\x12T\n\x02v0\x18\x01 \x01(\x0b\x32\x46.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0H\x00\x1a\xda\x04\n\x16GetGroupInfoResponseV0\x12\x66\n\ngroup_info\x18\x01 \x01(\x0b\x32P.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x04 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a\x34\n\x10GroupMemberEntry\x12\x11\n\tmember_id\x18\x01 \x01(\x0c\x12\r\n\x05power\x18\x02 \x01(\r\x1a\x98\x01\n\x0eGroupInfoEntry\x12h\n\x07members\x18\x01 \x03(\x0b\x32W.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupMemberEntry\x12\x1c\n\x14group_required_power\x18\x02 \x01(\r\x1a\x8a\x01\n\tGroupInfo\x12n\n\ngroup_info\x18\x01 \x01(\x0b\x32U.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntryH\x00\x88\x01\x01\x42\r\n\x0b_group_infoB\x08\n\x06resultB\t\n\x07version\"\xed\x03\n\x14GetGroupInfosRequest\x12T\n\x02v0\x18\x01 \x01(\x0b\x32\x46.org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0H\x00\x1au\n\x1cStartAtGroupContractPosition\x12%\n\x1dstart_group_contract_position\x18\x01 \x01(\r\x12.\n&start_group_contract_position_included\x18\x02 \x01(\x08\x1a\xfc\x01\n\x16GetGroupInfosRequestV0\x12\x13\n\x0b\x63ontract_id\x18\x01 \x01(\x0c\x12{\n start_at_group_contract_position\x18\x02 \x01(\x0b\x32L.org.dash.platform.dapi.v0.GetGroupInfosRequest.StartAtGroupContractPositionH\x00\x88\x01\x01\x12\x12\n\x05\x63ount\x18\x03 \x01(\rH\x01\x88\x01\x01\x12\r\n\x05prove\x18\x04 \x01(\x08\x42#\n!_start_at_group_contract_positionB\x08\n\x06_countB\t\n\x07version\"\xff\x05\n\x15GetGroupInfosResponse\x12V\n\x02v0\x18\x01 \x01(\x0b\x32H.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0H\x00\x1a\x82\x05\n\x17GetGroupInfosResponseV0\x12j\n\x0bgroup_infos\x18\x01 \x01(\x0b\x32S.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfosH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x04 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a\x34\n\x10GroupMemberEntry\x12\x11\n\tmember_id\x18\x01 \x01(\x0c\x12\r\n\x05power\x18\x02 \x01(\r\x1a\xc3\x01\n\x16GroupPositionInfoEntry\x12\x1f\n\x17group_contract_position\x18\x01 \x01(\r\x12j\n\x07members\x18\x02 \x03(\x0b\x32Y.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupMemberEntry\x12\x1c\n\x14group_required_power\x18\x03 \x01(\r\x1a\x82\x01\n\nGroupInfos\x12t\n\x0bgroup_infos\x18\x01 \x03(\x0b\x32_.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntryB\x08\n\x06resultB\t\n\x07version\"\xbe\x04\n\x16GetGroupActionsRequest\x12X\n\x02v0\x18\x01 \x01(\x0b\x32J.org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0H\x00\x1aL\n\x0fStartAtActionId\x12\x17\n\x0fstart_action_id\x18\x01 \x01(\x0c\x12 \n\x18start_action_id_included\x18\x02 \x01(\x08\x1a\xc8\x02\n\x18GetGroupActionsRequestV0\x12\x13\n\x0b\x63ontract_id\x18\x01 \x01(\x0c\x12\x1f\n\x17group_contract_position\x18\x02 \x01(\r\x12N\n\x06status\x18\x03 \x01(\x0e\x32>.org.dash.platform.dapi.v0.GetGroupActionsRequest.ActionStatus\x12\x62\n\x12start_at_action_id\x18\x04 \x01(\x0b\x32\x41.org.dash.platform.dapi.v0.GetGroupActionsRequest.StartAtActionIdH\x00\x88\x01\x01\x12\x12\n\x05\x63ount\x18\x05 \x01(\rH\x01\x88\x01\x01\x12\r\n\x05prove\x18\x06 \x01(\x08\x42\x15\n\x13_start_at_action_idB\x08\n\x06_count\"&\n\x0c\x41\x63tionStatus\x12\n\n\x06\x41\x43TIVE\x10\x00\x12\n\n\x06\x43LOSED\x10\x01\x42\t\n\x07version\"\xd1\x19\n\x17GetGroupActionsResponse\x12Z\n\x02v0\x18\x01 \x01(\x0b\x32L.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0H\x00\x1a\xce\x18\n\x19GetGroupActionsResponseV0\x12r\n\rgroup_actions\x18\x01 \x01(\x0b\x32Y.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionsH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a[\n\tMintEvent\x12\x0e\n\x06\x61mount\x18\x01 \x01(\x04\x12\x14\n\x0crecipient_id\x18\x02 \x01(\x0c\x12\x18\n\x0bpublic_note\x18\x03 \x01(\tH\x00\x88\x01\x01\x42\x0e\n\x0c_public_note\x1a\x45\n\tBurnEvent\x12\x0e\n\x06\x61mount\x18\x01 \x01(\x04\x12\x18\n\x0bpublic_note\x18\x02 \x01(\tH\x00\x88\x01\x01\x42\x0e\n\x0c_public_note\x1aJ\n\x0b\x46reezeEvent\x12\x11\n\tfrozen_id\x18\x01 \x01(\x0c\x12\x18\n\x0bpublic_note\x18\x02 \x01(\tH\x00\x88\x01\x01\x42\x0e\n\x0c_public_note\x1aL\n\rUnfreezeEvent\x12\x11\n\tfrozen_id\x18\x01 \x01(\x0c\x12\x18\n\x0bpublic_note\x18\x02 \x01(\tH\x00\x88\x01\x01\x42\x0e\n\x0c_public_note\x1a\x66\n\x17\x44\x65stroyFrozenFundsEvent\x12\x11\n\tfrozen_id\x18\x01 \x01(\x0c\x12\x0e\n\x06\x61mount\x18\x02 \x01(\x04\x12\x18\n\x0bpublic_note\x18\x03 \x01(\tH\x00\x88\x01\x01\x42\x0e\n\x0c_public_note\x1a\x64\n\x13SharedEncryptedNote\x12\x18\n\x10sender_key_index\x18\x01 \x01(\r\x12\x1b\n\x13recipient_key_index\x18\x02 \x01(\r\x12\x16\n\x0e\x65ncrypted_data\x18\x03 \x01(\x0c\x1a{\n\x15PersonalEncryptedNote\x12!\n\x19root_encryption_key_index\x18\x01 \x01(\r\x12\'\n\x1f\x64\x65rivation_encryption_key_index\x18\x02 \x01(\r\x12\x16\n\x0e\x65ncrypted_data\x18\x03 \x01(\x0c\x1a\xe9\x01\n\x14\x45mergencyActionEvent\x12\x81\x01\n\x0b\x61\x63tion_type\x18\x01 \x01(\x0e\x32l.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent.ActionType\x12\x18\n\x0bpublic_note\x18\x02 \x01(\tH\x00\x88\x01\x01\"#\n\nActionType\x12\t\n\x05PAUSE\x10\x00\x12\n\n\x06RESUME\x10\x01\x42\x0e\n\x0c_public_note\x1a\x64\n\x16TokenConfigUpdateEvent\x12 \n\x18token_config_update_item\x18\x01 \x01(\x0c\x12\x18\n\x0bpublic_note\x18\x02 \x01(\tH\x00\x88\x01\x01\x42\x0e\n\x0c_public_note\x1a\xfc\x02\n\x10GroupActionEvent\x12n\n\x0btoken_event\x18\x01 \x01(\x0b\x32W.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEventH\x00\x12t\n\x0e\x64ocument_event\x18\x02 \x01(\x0b\x32Z.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEventH\x00\x12t\n\x0e\x63ontract_event\x18\x03 \x01(\x0b\x32Z.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEventH\x00\x42\x0c\n\nevent_type\x1a\x8b\x01\n\rDocumentEvent\x12r\n\x06\x63reate\x18\x01 \x01(\x0b\x32`.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentCreateEventH\x00\x42\x06\n\x04type\x1a/\n\x13\x44ocumentCreateEvent\x12\x18\n\x10\x63reated_document\x18\x01 \x01(\x0c\x1a/\n\x13\x43ontractUpdateEvent\x12\x18\n\x10updated_contract\x18\x01 \x01(\x0c\x1a\x8b\x01\n\rContractEvent\x12r\n\x06update\x18\x01 \x01(\x0b\x32`.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractUpdateEventH\x00\x42\x06\n\x04type\x1a\xcb\x06\n\nTokenEvent\x12\x66\n\x04mint\x18\x01 \x01(\x0b\x32V.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEventH\x00\x12\x66\n\x04\x62urn\x18\x02 \x01(\x0b\x32V.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnEventH\x00\x12j\n\x06\x66reeze\x18\x03 \x01(\x0b\x32X.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.FreezeEventH\x00\x12n\n\x08unfreeze\x18\x04 \x01(\x0b\x32Z.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEventH\x00\x12\x84\x01\n\x14\x64\x65stroy_frozen_funds\x18\x05 \x01(\x0b\x32\x64.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEventH\x00\x12}\n\x10\x65mergency_action\x18\x06 \x01(\x0b\x32\x61.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEventH\x00\x12\x82\x01\n\x13token_config_update\x18\x07 \x01(\x0b\x32\x63.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEventH\x00\x42\x06\n\x04type\x1a\x93\x01\n\x10GroupActionEntry\x12\x11\n\taction_id\x18\x01 \x01(\x0c\x12l\n\x05\x65vent\x18\x02 \x01(\x0b\x32].org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent\x1a\x84\x01\n\x0cGroupActions\x12t\n\rgroup_actions\x18\x01 \x03(\x0b\x32].org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntryB\x08\n\x06resultB\t\n\x07version\"\x88\x03\n\x1cGetGroupActionSignersRequest\x12\x64\n\x02v0\x18\x01 \x01(\x0b\x32V.org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0H\x00\x1a\xce\x01\n\x1eGetGroupActionSignersRequestV0\x12\x13\n\x0b\x63ontract_id\x18\x01 \x01(\x0c\x12\x1f\n\x17group_contract_position\x18\x02 \x01(\r\x12T\n\x06status\x18\x03 \x01(\x0e\x32\x44.org.dash.platform.dapi.v0.GetGroupActionSignersRequest.ActionStatus\x12\x11\n\taction_id\x18\x04 \x01(\x0c\x12\r\n\x05prove\x18\x05 \x01(\x08\"&\n\x0c\x41\x63tionStatus\x12\n\n\x06\x41\x43TIVE\x10\x00\x12\n\n\x06\x43LOSED\x10\x01\x42\t\n\x07version\"\x8b\x05\n\x1dGetGroupActionSignersResponse\x12\x66\n\x02v0\x18\x01 \x01(\x0b\x32X.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0H\x00\x1a\xf6\x03\n\x1fGetGroupActionSignersResponseV0\x12\x8b\x01\n\x14group_action_signers\x18\x01 \x01(\x0b\x32k.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSignersH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a\x35\n\x11GroupActionSigner\x12\x11\n\tsigner_id\x18\x01 \x01(\x0c\x12\r\n\x05power\x18\x02 \x01(\r\x1a\x91\x01\n\x12GroupActionSigners\x12{\n\x07signers\x18\x01 \x03(\x0b\x32j.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSignerB\x08\n\x06resultB\t\n\x07version*Z\n\nKeyPurpose\x12\x12\n\x0e\x41UTHENTICATION\x10\x00\x12\x0e\n\nENCRYPTION\x10\x01\x12\x0e\n\nDECRYPTION\x10\x02\x12\x0c\n\x08TRANSFER\x10\x03\x12\n\n\x06VOTING\x10\x05\x32\xb2/\n\x08Platform\x12\x93\x01\n\x18\x62roadcastStateTransition\x12:.org.dash.platform.dapi.v0.BroadcastStateTransitionRequest\x1a;.org.dash.platform.dapi.v0.BroadcastStateTransitionResponse\x12l\n\x0bgetIdentity\x12-.org.dash.platform.dapi.v0.GetIdentityRequest\x1a..org.dash.platform.dapi.v0.GetIdentityResponse\x12x\n\x0fgetIdentityKeys\x12\x31.org.dash.platform.dapi.v0.GetIdentityKeysRequest\x1a\x32.org.dash.platform.dapi.v0.GetIdentityKeysResponse\x12\x96\x01\n\x19getIdentitiesContractKeys\x12;.org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest\x1a<.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse\x12{\n\x10getIdentityNonce\x12\x32.org.dash.platform.dapi.v0.GetIdentityNonceRequest\x1a\x33.org.dash.platform.dapi.v0.GetIdentityNonceResponse\x12\x93\x01\n\x18getIdentityContractNonce\x12:.org.dash.platform.dapi.v0.GetIdentityContractNonceRequest\x1a;.org.dash.platform.dapi.v0.GetIdentityContractNonceResponse\x12\x81\x01\n\x12getIdentityBalance\x12\x34.org.dash.platform.dapi.v0.GetIdentityBalanceRequest\x1a\x35.org.dash.platform.dapi.v0.GetIdentityBalanceResponse\x12\x8a\x01\n\x15getIdentitiesBalances\x12\x37.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest\x1a\x38.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse\x12\xa2\x01\n\x1dgetIdentityBalanceAndRevision\x12?.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest\x1a@.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse\x12\xaf\x01\n#getEvonodesProposedEpochBlocksByIds\x12\x45.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest\x1a\x41.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse\x12\xb3\x01\n%getEvonodesProposedEpochBlocksByRange\x12G.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest\x1a\x41.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse\x12x\n\x0fgetDataContract\x12\x31.org.dash.platform.dapi.v0.GetDataContractRequest\x1a\x32.org.dash.platform.dapi.v0.GetDataContractResponse\x12\x8d\x01\n\x16getDataContractHistory\x12\x38.org.dash.platform.dapi.v0.GetDataContractHistoryRequest\x1a\x39.org.dash.platform.dapi.v0.GetDataContractHistoryResponse\x12{\n\x10getDataContracts\x12\x32.org.dash.platform.dapi.v0.GetDataContractsRequest\x1a\x33.org.dash.platform.dapi.v0.GetDataContractsResponse\x12o\n\x0cgetDocuments\x12..org.dash.platform.dapi.v0.GetDocumentsRequest\x1a/.org.dash.platform.dapi.v0.GetDocumentsResponse\x12\x99\x01\n\x1agetIdentityByPublicKeyHash\x12<.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest\x1a=.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse\x12\x9f\x01\n\x1cwaitForStateTransitionResult\x12>.org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest\x1a?.org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse\x12\x81\x01\n\x12getConsensusParams\x12\x34.org.dash.platform.dapi.v0.GetConsensusParamsRequest\x1a\x35.org.dash.platform.dapi.v0.GetConsensusParamsResponse\x12\xa5\x01\n\x1egetProtocolVersionUpgradeState\x12@.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest\x1a\x41.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse\x12\xb4\x01\n#getProtocolVersionUpgradeVoteStatus\x12\x45.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest\x1a\x46.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse\x12r\n\rgetEpochsInfo\x12/.org.dash.platform.dapi.v0.GetEpochsInfoRequest\x1a\x30.org.dash.platform.dapi.v0.GetEpochsInfoResponse\x12\x8a\x01\n\x15getContestedResources\x12\x37.org.dash.platform.dapi.v0.GetContestedResourcesRequest\x1a\x38.org.dash.platform.dapi.v0.GetContestedResourcesResponse\x12\xa2\x01\n\x1dgetContestedResourceVoteState\x12?.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest\x1a@.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse\x12\xba\x01\n%getContestedResourceVotersForIdentity\x12G.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest\x1aH.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse\x12\xae\x01\n!getContestedResourceIdentityVotes\x12\x43.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest\x1a\x44.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse\x12\x8a\x01\n\x15getVotePollsByEndDate\x12\x37.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest\x1a\x38.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse\x12\xa5\x01\n\x1egetPrefundedSpecializedBalance\x12@.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest\x1a\x41.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse\x12\x96\x01\n\x19getTotalCreditsInPlatform\x12;.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest\x1a<.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse\x12x\n\x0fgetPathElements\x12\x31.org.dash.platform.dapi.v0.GetPathElementsRequest\x1a\x32.org.dash.platform.dapi.v0.GetPathElementsResponse\x12\x66\n\tgetStatus\x12+.org.dash.platform.dapi.v0.GetStatusRequest\x1a,.org.dash.platform.dapi.v0.GetStatusResponse\x12\x8a\x01\n\x15getCurrentQuorumsInfo\x12\x37.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest\x1a\x38.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse\x12\x93\x01\n\x18getIdentityTokenBalances\x12:.org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest\x1a;.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse\x12\x99\x01\n\x1agetIdentitiesTokenBalances\x12<.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest\x1a=.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse\x12\x8a\x01\n\x15getIdentityTokenInfos\x12\x37.org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest\x1a\x38.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse\x12\x90\x01\n\x17getIdentitiesTokenInfos\x12\x39.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest\x1a:.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse\x12{\n\x10getTokenStatuses\x12\x32.org.dash.platform.dapi.v0.GetTokenStatusesRequest\x1a\x33.org.dash.platform.dapi.v0.GetTokenStatusesResponse\x12\xb1\x01\n\"getTokenPreProgrammedDistributions\x12\x44.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest\x1a\x45.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse\x12\x84\x01\n\x13getTokenTotalSupply\x12\x35.org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest\x1a\x36.org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse\x12o\n\x0cgetGroupInfo\x12..org.dash.platform.dapi.v0.GetGroupInfoRequest\x1a/.org.dash.platform.dapi.v0.GetGroupInfoResponse\x12r\n\rgetGroupInfos\x12/.org.dash.platform.dapi.v0.GetGroupInfosRequest\x1a\x30.org.dash.platform.dapi.v0.GetGroupInfosResponse\x12x\n\x0fgetGroupActions\x12\x31.org.dash.platform.dapi.v0.GetGroupActionsRequest\x1a\x32.org.dash.platform.dapi.v0.GetGroupActionsResponse\x12\x8a\x01\n\x15getGroupActionSigners\x12\x37.org.dash.platform.dapi.v0.GetGroupActionSignersRequest\x1a\x38.org.dash.platform.dapi.v0.GetGroupActionSignersResponseb\x06proto3' , dependencies=[google_dot_protobuf_dot_wrappers__pb2.DESCRIPTOR,google_dot_protobuf_dot_struct__pb2.DESCRIPTOR,google_dot_protobuf_dot_timestamp__pb2.DESCRIPTOR,]) @@ -62,8 +62,8 @@ ], containing_type=None, serialized_options=None, - serialized_start=46565, - serialized_end=46655, + serialized_start=44290, + serialized_end=44380, ) _sym_db.RegisterEnumDescriptor(_KEYPURPOSE) @@ -100,71 +100,6 @@ ) _sym_db.RegisterEnumDescriptor(_SECURITYLEVELMAP_KEYKINDREQUESTTYPE) -_GETPROOFSREQUEST_GETPROOFSREQUESTV0_DOCUMENTREQUEST_DOCUMENTCONTESTEDSTATUS = _descriptor.EnumDescriptor( - name='DocumentContestedStatus', - full_name='org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest.DocumentContestedStatus', - filename=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - values=[ - _descriptor.EnumValueDescriptor( - name='NOT_CONTESTED', index=0, number=0, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='MAYBE_CONTESTED', index=1, number=1, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='CONTESTED', index=2, number=2, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - ], - containing_type=None, - serialized_options=None, - serialized_start=9729, - serialized_end=9809, -) -_sym_db.RegisterEnumDescriptor(_GETPROOFSREQUEST_GETPROOFSREQUESTV0_DOCUMENTREQUEST_DOCUMENTCONTESTEDSTATUS) - -_GETPROOFSREQUEST_GETPROOFSREQUESTV0_IDENTITYREQUEST_TYPE = _descriptor.EnumDescriptor( - name='Type', - full_name='org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityRequest.Type', - filename=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - values=[ - _descriptor.EnumValueDescriptor( - name='FULL_IDENTITY', index=0, number=0, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='BALANCE', index=1, number=1, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='KEYS', index=2, number=2, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='REVISION', index=3, number=3, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - ], - containing_type=None, - serialized_options=None, - serialized_start=9959, - serialized_end=10021, -) -_sym_db.RegisterEnumDescriptor(_GETPROOFSREQUEST_GETPROOFSREQUESTV0_IDENTITYREQUEST_TYPE) - _GETCONTESTEDRESOURCEVOTESTATEREQUEST_GETCONTESTEDRESOURCEVOTESTATEREQUESTV0_RESULTTYPE = _descriptor.EnumDescriptor( name='ResultType', full_name='org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.ResultType', @@ -190,8 +125,8 @@ ], containing_type=None, serialized_options=None, - serialized_start=22179, - serialized_end=22252, + serialized_start=19904, + serialized_end=19977, ) _sym_db.RegisterEnumDescriptor(_GETCONTESTEDRESOURCEVOTESTATEREQUEST_GETCONTESTEDRESOURCEVOTESTATEREQUESTV0_RESULTTYPE) @@ -220,8 +155,8 @@ ], containing_type=None, serialized_options=None, - serialized_start=23174, - serialized_end=23253, + serialized_start=20899, + serialized_end=20978, ) _sym_db.RegisterEnumDescriptor(_GETCONTESTEDRESOURCEVOTESTATERESPONSE_GETCONTESTEDRESOURCEVOTESTATERESPONSEV0_FINISHEDVOTEINFO_FINISHEDVOTEOUTCOME) @@ -250,8 +185,8 @@ ], containing_type=None, serialized_options=None, - serialized_start=26882, - serialized_end=26943, + serialized_start=24607, + serialized_end=24668, ) _sym_db.RegisterEnumDescriptor(_GETCONTESTEDRESOURCEIDENTITYVOTESRESPONSE_GETCONTESTEDRESOURCEIDENTITYVOTESRESPONSEV0_RESOURCEVOTECHOICE_VOTECHOICETYPE) @@ -275,8 +210,8 @@ ], containing_type=None, serialized_options=None, - serialized_start=42181, - serialized_end=42219, + serialized_start=39906, + serialized_end=39944, ) _sym_db.RegisterEnumDescriptor(_GETGROUPACTIONSREQUEST_ACTIONSTATUS) @@ -300,8 +235,8 @@ ], containing_type=None, serialized_options=None, - serialized_start=43444, - serialized_end=43479, + serialized_start=41169, + serialized_end=41204, ) _sym_db.RegisterEnumDescriptor(_GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_EMERGENCYACTIONEVENT_ACTIONTYPE) @@ -325,8 +260,8 @@ ], containing_type=None, serialized_options=None, - serialized_start=42181, - serialized_end=42219, + serialized_start=39906, + serialized_end=39944, ) _sym_db.RegisterEnumDescriptor(_GETGROUPACTIONSIGNERSREQUEST_ACTIONSTATUS) @@ -2505,523 +2440,18 @@ file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='v0', full_name='org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.v0', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[_GETEVONODESPROPOSEDEPOCHBLOCKSBYRANGEREQUEST_GETEVONODESPROPOSEDEPOCHBLOCKSBYRANGEREQUESTV0, ], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name='version', full_name='org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.version', - index=0, containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[]), - ], - serialized_start=7345, - serialized_end=7715, -) - - -_GETIDENTITIESBALANCESREQUEST_GETIDENTITIESBALANCESREQUESTV0 = _descriptor.Descriptor( - name='GetIdentitiesBalancesRequestV0', - full_name='org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='ids', full_name='org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.ids', index=0, - number=1, type=12, cpp_type=9, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='prove', full_name='org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.prove', index=1, - number=2, type=8, cpp_type=7, label=1, - has_default_value=False, default_value=False, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=7852, - serialized_end=7912, -) - -_GETIDENTITIESBALANCESREQUEST = _descriptor.Descriptor( - name='GetIdentitiesBalancesRequest', - full_name='org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='v0', full_name='org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.v0', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[_GETIDENTITIESBALANCESREQUEST_GETIDENTITIESBALANCESREQUESTV0, ], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name='version', full_name='org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.version', - index=0, containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[]), - ], - serialized_start=7718, - serialized_end=7923, -) - - -_GETIDENTITIESBALANCESRESPONSE_GETIDENTITIESBALANCESRESPONSEV0_IDENTITYBALANCE = _descriptor.Descriptor( - name='IdentityBalance', - full_name='org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='identity_id', full_name='org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance.identity_id', index=0, - number=1, type=12, cpp_type=9, label=1, - has_default_value=False, default_value=b"", - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='balance', full_name='org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance.balance', index=1, - number=2, type=4, cpp_type=4, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=b'0\001', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name='_balance', full_name='org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance._balance', - index=0, containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[]), - ], - serialized_start=8354, - serialized_end=8430, -) - -_GETIDENTITIESBALANCESRESPONSE_GETIDENTITIESBALANCESRESPONSEV0_IDENTITIESBALANCES = _descriptor.Descriptor( - name='IdentitiesBalances', - full_name='org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='entries', full_name='org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances.entries', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=8433, - serialized_end=8576, -) - -_GETIDENTITIESBALANCESRESPONSE_GETIDENTITIESBALANCESRESPONSEV0 = _descriptor.Descriptor( - name='GetIdentitiesBalancesResponseV0', - full_name='org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='identities_balances', full_name='org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.identities_balances', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='proof', full_name='org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.proof', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='metadata', full_name='org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.metadata', index=2, - number=3, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[_GETIDENTITIESBALANCESRESPONSE_GETIDENTITIESBALANCESRESPONSEV0_IDENTITYBALANCE, _GETIDENTITIESBALANCESRESPONSE_GETIDENTITIESBALANCESRESPONSEV0_IDENTITIESBALANCES, ], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name='result', full_name='org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.result', - index=0, containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[]), - ], - serialized_start=8064, - serialized_end=8586, -) - -_GETIDENTITIESBALANCESRESPONSE = _descriptor.Descriptor( - name='GetIdentitiesBalancesResponse', - full_name='org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='v0', full_name='org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.v0', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[_GETIDENTITIESBALANCESRESPONSE_GETIDENTITIESBALANCESRESPONSEV0, ], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name='version', full_name='org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.version', - index=0, containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[]), - ], - serialized_start=7926, - serialized_end=8597, -) - - -_GETPROOFSREQUEST_GETPROOFSREQUESTV0_DOCUMENTREQUEST = _descriptor.Descriptor( - name='DocumentRequest', - full_name='org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='contract_id', full_name='org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest.contract_id', index=0, - number=1, type=12, cpp_type=9, label=1, - has_default_value=False, default_value=b"", - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='document_type', full_name='org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest.document_type', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='document_type_keeps_history', full_name='org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest.document_type_keeps_history', index=2, - number=3, type=8, cpp_type=7, label=1, - has_default_value=False, default_value=False, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='document_id', full_name='org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest.document_id', index=3, - number=4, type=12, cpp_type=9, label=1, - has_default_value=False, default_value=b"", - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='document_contested_status', full_name='org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest.document_contested_status', index=4, - number=5, type=14, cpp_type=8, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - _GETPROOFSREQUEST_GETPROOFSREQUESTV0_DOCUMENTREQUEST_DOCUMENTCONTESTEDSTATUS, - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=9468, - serialized_end=9809, -) - -_GETPROOFSREQUEST_GETPROOFSREQUESTV0_IDENTITYREQUEST = _descriptor.Descriptor( - name='IdentityRequest', - full_name='org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='identity_id', full_name='org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityRequest.identity_id', index=0, - number=1, type=12, cpp_type=9, label=1, - has_default_value=False, default_value=b"", - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='request_type', full_name='org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityRequest.request_type', index=1, - number=2, type=14, cpp_type=8, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - _GETPROOFSREQUEST_GETPROOFSREQUESTV0_IDENTITYREQUEST_TYPE, - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=9812, - serialized_end=10021, -) - -_GETPROOFSREQUEST_GETPROOFSREQUESTV0_CONTRACTREQUEST = _descriptor.Descriptor( - name='ContractRequest', - full_name='org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.ContractRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='contract_id', full_name='org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.ContractRequest.contract_id', index=0, - number=1, type=12, cpp_type=9, label=1, - has_default_value=False, default_value=b"", - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=10023, - serialized_end=10061, -) - -_GETPROOFSREQUEST_GETPROOFSREQUESTV0_VOTESTATUSREQUEST_CONTESTEDRESOURCEVOTESTATUSREQUEST = _descriptor.Descriptor( - name='ContestedResourceVoteStatusRequest', - full_name='org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='contract_id', full_name='org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest.contract_id', index=0, - number=1, type=12, cpp_type=9, label=1, - has_default_value=False, default_value=b"", - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='document_type_name', full_name='org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest.document_type_name', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='index_name', full_name='org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest.index_name', index=2, - number=3, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='index_values', full_name='org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest.index_values', index=3, - number=4, type=12, cpp_type=9, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='voter_identifier', full_name='org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest.voter_identifier', index=4, - number=5, type=12, cpp_type=9, label=1, - has_default_value=False, default_value=b"", - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=10254, - serialized_end=10407, -) - -_GETPROOFSREQUEST_GETPROOFSREQUESTV0_VOTESTATUSREQUEST = _descriptor.Descriptor( - name='VoteStatusRequest', - full_name='org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='contested_resource_vote_status_request', full_name='org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.contested_resource_vote_status_request', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[_GETPROOFSREQUEST_GETPROOFSREQUESTV0_VOTESTATUSREQUEST_CONTESTEDRESOURCEVOTESTATUSREQUEST, ], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name='request_type', full_name='org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.request_type', - index=0, containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[]), - ], - serialized_start=10064, - serialized_end=10423, -) - -_GETPROOFSREQUEST_GETPROOFSREQUESTV0_IDENTITYTOKENBALANCEREQUEST = _descriptor.Descriptor( - name='IdentityTokenBalanceRequest', - full_name='org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenBalanceRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='token_id', full_name='org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenBalanceRequest.token_id', index=0, - number=1, type=12, cpp_type=9, label=1, - has_default_value=False, default_value=b"", - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + fields=[ _descriptor.FieldDescriptor( - name='identity_id', full_name='org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenBalanceRequest.identity_id', index=1, - number=2, type=12, cpp_type=9, label=1, - has_default_value=False, default_value=b"", + name='v0', full_name='org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.v0', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], - nested_types=[], + nested_types=[_GETEVONODESPROPOSEDEPOCHBLOCKSBYRANGEREQUEST_GETEVONODESPROPOSEDEPOCHBLOCKSBYRANGEREQUESTV0, ], enum_types=[ ], serialized_options=None, @@ -3029,30 +2459,36 @@ syntax='proto3', extension_ranges=[], oneofs=[ + _descriptor.OneofDescriptor( + name='version', full_name='org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.version', + index=0, containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[]), ], - serialized_start=10425, - serialized_end=10493, + serialized_start=7345, + serialized_end=7715, ) -_GETPROOFSREQUEST_GETPROOFSREQUESTV0_IDENTITYTOKENINFOREQUEST = _descriptor.Descriptor( - name='IdentityTokenInfoRequest', - full_name='org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenInfoRequest', + +_GETIDENTITIESBALANCESREQUEST_GETIDENTITIESBALANCESREQUESTV0 = _descriptor.Descriptor( + name='GetIdentitiesBalancesRequestV0', + full_name='org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( - name='token_id', full_name='org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenInfoRequest.token_id', index=0, - number=1, type=12, cpp_type=9, label=1, - has_default_value=False, default_value=b"", + name='ids', full_name='org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.ids', index=0, + number=1, type=12, cpp_type=9, label=3, + has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='identity_id', full_name='org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenInfoRequest.identity_id', index=1, - number=2, type=12, cpp_type=9, label=1, - has_default_value=False, default_value=b"", + name='prove', full_name='org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.prove', index=1, + number=2, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), @@ -3068,29 +2504,29 @@ extension_ranges=[], oneofs=[ ], - serialized_start=10495, - serialized_end=10560, + serialized_start=7852, + serialized_end=7912, ) -_GETPROOFSREQUEST_GETPROOFSREQUESTV0_TOKENSTATUSREQUEST = _descriptor.Descriptor( - name='TokenStatusRequest', - full_name='org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.TokenStatusRequest', +_GETIDENTITIESBALANCESREQUEST = _descriptor.Descriptor( + name='GetIdentitiesBalancesRequest', + full_name='org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( - name='token_id', full_name='org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.TokenStatusRequest.token_id', index=0, - number=1, type=12, cpp_type=9, label=1, - has_default_value=False, default_value=b"", + name='v0', full_name='org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.v0', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], - nested_types=[], + nested_types=[_GETIDENTITIESBALANCESREQUEST_GETIDENTITIESBALANCESREQUESTV0, ], enum_types=[ ], serialized_options=None, @@ -3098,72 +2534,43 @@ syntax='proto3', extension_ranges=[], oneofs=[ + _descriptor.OneofDescriptor( + name='version', full_name='org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.version', + index=0, containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[]), ], - serialized_start=10562, - serialized_end=10600, + serialized_start=7718, + serialized_end=7923, ) -_GETPROOFSREQUEST_GETPROOFSREQUESTV0 = _descriptor.Descriptor( - name='GetProofsRequestV0', - full_name='org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0', + +_GETIDENTITIESBALANCESRESPONSE_GETIDENTITIESBALANCESRESPONSEV0_IDENTITYBALANCE = _descriptor.Descriptor( + name='IdentityBalance', + full_name='org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( - name='identities', full_name='org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.identities', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='contracts', full_name='org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.contracts', index=1, - number=2, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='documents', full_name='org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.documents', index=2, - number=3, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='votes', full_name='org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.votes', index=3, - number=4, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='identity_token_balances', full_name='org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.identity_token_balances', index=4, - number=5, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='identity_token_infos', full_name='org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.identity_token_infos', index=5, - number=6, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], + name='identity_id', full_name='org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance.identity_id', index=0, + number=1, type=12, cpp_type=9, label=1, + has_default_value=False, default_value=b"", message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='token_statuses', full_name='org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.token_statuses', index=6, - number=7, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], + name='balance', full_name='org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance.balance', index=1, + number=2, type=4, cpp_type=4, label=1, + has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + serialized_options=b'0\001', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], - nested_types=[_GETPROOFSREQUEST_GETPROOFSREQUESTV0_DOCUMENTREQUEST, _GETPROOFSREQUEST_GETPROOFSREQUESTV0_IDENTITYREQUEST, _GETPROOFSREQUEST_GETPROOFSREQUESTV0_CONTRACTREQUEST, _GETPROOFSREQUEST_GETPROOFSREQUESTV0_VOTESTATUSREQUEST, _GETPROOFSREQUEST_GETPROOFSREQUESTV0_IDENTITYTOKENBALANCEREQUEST, _GETPROOFSREQUEST_GETPROOFSREQUESTV0_IDENTITYTOKENINFOREQUEST, _GETPROOFSREQUEST_GETPROOFSREQUESTV0_TOKENSTATUSREQUEST, ], + nested_types=[], enum_types=[ ], serialized_options=None, @@ -3171,30 +2578,35 @@ syntax='proto3', extension_ranges=[], oneofs=[ + _descriptor.OneofDescriptor( + name='_balance', full_name='org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance._balance', + index=0, containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[]), ], - serialized_start=8699, - serialized_end=10600, + serialized_start=8354, + serialized_end=8430, ) -_GETPROOFSREQUEST = _descriptor.Descriptor( - name='GetProofsRequest', - full_name='org.dash.platform.dapi.v0.GetProofsRequest', +_GETIDENTITIESBALANCESRESPONSE_GETIDENTITIESBALANCESRESPONSEV0_IDENTITIESBALANCES = _descriptor.Descriptor( + name='IdentitiesBalances', + full_name='org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( - name='v0', full_name='org.dash.platform.dapi.v0.GetProofsRequest.v0', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, + name='entries', full_name='org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances.entries', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], - nested_types=[_GETPROOFSREQUEST_GETPROOFSREQUESTV0, ], + nested_types=[], enum_types=[ ], serialized_options=None, @@ -3202,43 +2614,44 @@ syntax='proto3', extension_ranges=[], oneofs=[ - _descriptor.OneofDescriptor( - name='version', full_name='org.dash.platform.dapi.v0.GetProofsRequest.version', - index=0, containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[]), ], - serialized_start=8600, - serialized_end=10611, + serialized_start=8433, + serialized_end=8576, ) - -_GETPROOFSRESPONSE_GETPROOFSRESPONSEV0 = _descriptor.Descriptor( - name='GetProofsResponseV0', - full_name='org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0', +_GETIDENTITIESBALANCESRESPONSE_GETIDENTITIESBALANCESRESPONSEV0 = _descriptor.Descriptor( + name='GetIdentitiesBalancesResponseV0', + full_name='org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( - name='proof', full_name='org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0.proof', index=0, + name='identities_balances', full_name='org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.identities_balances', index=0, number=1, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='metadata', full_name='org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0.metadata', index=1, + name='proof', full_name='org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.proof', index=1, number=2, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='metadata', full_name='org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.metadata', index=2, + number=3, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], - nested_types=[], + nested_types=[_GETIDENTITIESBALANCESRESPONSE_GETIDENTITIESBALANCESRESPONSEV0_IDENTITYBALANCE, _GETIDENTITIESBALANCESRESPONSE_GETIDENTITIESBALANCESRESPONSEV0_IDENTITIESBALANCES, ], enum_types=[ ], serialized_options=None, @@ -3247,25 +2660,25 @@ extension_ranges=[], oneofs=[ _descriptor.OneofDescriptor( - name='result', full_name='org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0.result', + name='result', full_name='org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.result', index=0, containing_type=None, create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=10716, - serialized_end=10861, + serialized_start=8064, + serialized_end=8586, ) -_GETPROOFSRESPONSE = _descriptor.Descriptor( - name='GetProofsResponse', - full_name='org.dash.platform.dapi.v0.GetProofsResponse', +_GETIDENTITIESBALANCESRESPONSE = _descriptor.Descriptor( + name='GetIdentitiesBalancesResponse', + full_name='org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( - name='v0', full_name='org.dash.platform.dapi.v0.GetProofsResponse.v0', index=0, + name='v0', full_name='org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.v0', index=0, number=1, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, @@ -3274,7 +2687,7 @@ ], extensions=[ ], - nested_types=[_GETPROOFSRESPONSE_GETPROOFSRESPONSEV0, ], + nested_types=[_GETIDENTITIESBALANCESRESPONSE_GETIDENTITIESBALANCESRESPONSEV0, ], enum_types=[ ], serialized_options=None, @@ -3283,13 +2696,13 @@ extension_ranges=[], oneofs=[ _descriptor.OneofDescriptor( - name='version', full_name='org.dash.platform.dapi.v0.GetProofsResponse.version', + name='version', full_name='org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.version', index=0, containing_type=None, create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=10614, - serialized_end=10872, + serialized_start=7926, + serialized_end=8597, ) @@ -3327,8 +2740,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=10991, - serialized_end=11044, + serialized_start=8716, + serialized_end=8769, ) _GETDATACONTRACTREQUEST = _descriptor.Descriptor( @@ -3363,8 +2776,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=10875, - serialized_end=11055, + serialized_start=8600, + serialized_end=8780, ) @@ -3414,8 +2827,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=11178, - serialized_end=11354, + serialized_start=8903, + serialized_end=9079, ) _GETDATACONTRACTRESPONSE = _descriptor.Descriptor( @@ -3450,8 +2863,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=11058, - serialized_end=11365, + serialized_start=8783, + serialized_end=9090, ) @@ -3489,8 +2902,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=11487, - serialized_end=11542, + serialized_start=9212, + serialized_end=9267, ) _GETDATACONTRACTSREQUEST = _descriptor.Descriptor( @@ -3525,8 +2938,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=11368, - serialized_end=11553, + serialized_start=9093, + serialized_end=9278, ) @@ -3564,8 +2977,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=11678, - serialized_end=11769, + serialized_start=9403, + serialized_end=9494, ) _GETDATACONTRACTSRESPONSE_DATACONTRACTS = _descriptor.Descriptor( @@ -3595,8 +3008,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=11771, - serialized_end=11888, + serialized_start=9496, + serialized_end=9613, ) _GETDATACONTRACTSRESPONSE_GETDATACONTRACTSRESPONSEV0 = _descriptor.Descriptor( @@ -3645,8 +3058,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=11891, - serialized_end=12136, + serialized_start=9616, + serialized_end=9861, ) _GETDATACONTRACTSRESPONSE = _descriptor.Descriptor( @@ -3681,8 +3094,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=11556, - serialized_end=12147, + serialized_start=9281, + serialized_end=9872, ) @@ -3741,8 +3154,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=12288, - serialized_end=12464, + serialized_start=10013, + serialized_end=10189, ) _GETDATACONTRACTHISTORYREQUEST = _descriptor.Descriptor( @@ -3777,8 +3190,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=12150, - serialized_end=12475, + serialized_start=9875, + serialized_end=10200, ) @@ -3816,8 +3229,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=12915, - serialized_end=12974, + serialized_start=10640, + serialized_end=10699, ) _GETDATACONTRACTHISTORYRESPONSE_GETDATACONTRACTHISTORYRESPONSEV0_DATACONTRACTHISTORY = _descriptor.Descriptor( @@ -3847,8 +3260,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=12977, - serialized_end=13147, + serialized_start=10702, + serialized_end=10872, ) _GETDATACONTRACTHISTORYRESPONSE_GETDATACONTRACTHISTORYRESPONSEV0 = _descriptor.Descriptor( @@ -3897,8 +3310,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=12619, - serialized_end=13157, + serialized_start=10344, + serialized_end=10882, ) _GETDATACONTRACTHISTORYRESPONSE = _descriptor.Descriptor( @@ -3933,8 +3346,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=12478, - serialized_end=13168, + serialized_start=10203, + serialized_end=10893, ) @@ -4019,8 +3432,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=13279, - serialized_end=13466, + serialized_start=11004, + serialized_end=11191, ) _GETDOCUMENTSREQUEST = _descriptor.Descriptor( @@ -4055,8 +3468,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=13171, - serialized_end=13477, + serialized_start=10896, + serialized_end=11202, ) @@ -4087,8 +3500,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=13834, - serialized_end=13864, + serialized_start=11559, + serialized_end=11589, ) _GETDOCUMENTSRESPONSE_GETDOCUMENTSRESPONSEV0 = _descriptor.Descriptor( @@ -4137,8 +3550,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=13591, - serialized_end=13874, + serialized_start=11316, + serialized_end=11599, ) _GETDOCUMENTSRESPONSE = _descriptor.Descriptor( @@ -4173,8 +3586,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=13480, - serialized_end=13885, + serialized_start=11205, + serialized_end=11610, ) @@ -4212,8 +3625,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=14037, - serialized_end=14114, + serialized_start=11762, + serialized_end=11839, ) _GETIDENTITYBYPUBLICKEYHASHREQUEST = _descriptor.Descriptor( @@ -4248,8 +3661,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=13888, - serialized_end=14125, + serialized_start=11613, + serialized_end=11850, ) @@ -4299,8 +3712,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=14281, - serialized_end=14463, + serialized_start=12006, + serialized_end=12188, ) _GETIDENTITYBYPUBLICKEYHASHRESPONSE = _descriptor.Descriptor( @@ -4335,8 +3748,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=14128, - serialized_end=14474, + serialized_start=11853, + serialized_end=12199, ) @@ -4374,8 +3787,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=14632, - serialized_end=14717, + serialized_start=12357, + serialized_end=12442, ) _WAITFORSTATETRANSITIONRESULTREQUEST = _descriptor.Descriptor( @@ -4410,8 +3823,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=14477, - serialized_end=14728, + serialized_start=12202, + serialized_end=12453, ) @@ -4461,8 +3874,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=14890, - serialized_end=15129, + serialized_start=12615, + serialized_end=12854, ) _WAITFORSTATETRANSITIONRESULTRESPONSE = _descriptor.Descriptor( @@ -4497,8 +3910,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=14731, - serialized_end=15140, + serialized_start=12456, + serialized_end=12865, ) @@ -4536,8 +3949,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=15268, - serialized_end=15328, + serialized_start=12993, + serialized_end=13053, ) _GETCONSENSUSPARAMSREQUEST = _descriptor.Descriptor( @@ -4572,8 +3985,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=15143, - serialized_end=15339, + serialized_start=12868, + serialized_end=13064, ) @@ -4618,8 +4031,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=15470, - serialized_end=15550, + serialized_start=13195, + serialized_end=13275, ) _GETCONSENSUSPARAMSRESPONSE_CONSENSUSPARAMSEVIDENCE = _descriptor.Descriptor( @@ -4663,8 +4076,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=15552, - serialized_end=15650, + serialized_start=13277, + serialized_end=13375, ) _GETCONSENSUSPARAMSRESPONSE_GETCONSENSUSPARAMSRESPONSEV0 = _descriptor.Descriptor( @@ -4701,8 +4114,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=15653, - serialized_end=15871, + serialized_start=13378, + serialized_end=13596, ) _GETCONSENSUSPARAMSRESPONSE = _descriptor.Descriptor( @@ -4737,8 +4150,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=15342, - serialized_end=15882, + serialized_start=13067, + serialized_end=13607, ) @@ -4769,8 +4182,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=16046, - serialized_end=16102, + serialized_start=13771, + serialized_end=13827, ) _GETPROTOCOLVERSIONUPGRADESTATEREQUEST = _descriptor.Descriptor( @@ -4805,8 +4218,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=15885, - serialized_end=16113, + serialized_start=13610, + serialized_end=13838, ) @@ -4837,8 +4250,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=16578, - serialized_end=16728, + serialized_start=14303, + serialized_end=14453, ) _GETPROTOCOLVERSIONUPGRADESTATERESPONSE_GETPROTOCOLVERSIONUPGRADESTATERESPONSEV0_VERSIONENTRY = _descriptor.Descriptor( @@ -4875,8 +4288,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=16730, - serialized_end=16788, + serialized_start=14455, + serialized_end=14513, ) _GETPROTOCOLVERSIONUPGRADESTATERESPONSE_GETPROTOCOLVERSIONUPGRADESTATERESPONSEV0 = _descriptor.Descriptor( @@ -4925,8 +4338,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=16281, - serialized_end=16798, + serialized_start=14006, + serialized_end=14523, ) _GETPROTOCOLVERSIONUPGRADESTATERESPONSE = _descriptor.Descriptor( @@ -4961,8 +4374,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=16116, - serialized_end=16809, + serialized_start=13841, + serialized_end=14534, ) @@ -5007,8 +4420,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=16989, - serialized_end=17092, + serialized_start=14714, + serialized_end=14817, ) _GETPROTOCOLVERSIONUPGRADEVOTESTATUSREQUEST = _descriptor.Descriptor( @@ -5043,8 +4456,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=16812, - serialized_end=17103, + serialized_start=14537, + serialized_end=14828, ) @@ -5075,8 +4488,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=17606, - serialized_end=17781, + serialized_start=15331, + serialized_end=15506, ) _GETPROTOCOLVERSIONUPGRADEVOTESTATUSRESPONSE_GETPROTOCOLVERSIONUPGRADEVOTESTATUSRESPONSEV0_VERSIONSIGNAL = _descriptor.Descriptor( @@ -5113,8 +4526,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=17783, - serialized_end=17836, + serialized_start=15508, + serialized_end=15561, ) _GETPROTOCOLVERSIONUPGRADEVOTESTATUSRESPONSE_GETPROTOCOLVERSIONUPGRADEVOTESTATUSRESPONSEV0 = _descriptor.Descriptor( @@ -5163,8 +4576,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=17287, - serialized_end=17846, + serialized_start=15012, + serialized_end=15571, ) _GETPROTOCOLVERSIONUPGRADEVOTESTATUSRESPONSE = _descriptor.Descriptor( @@ -5199,8 +4612,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=17106, - serialized_end=17857, + serialized_start=14831, + serialized_end=15582, ) @@ -5252,8 +4665,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=17970, - serialized_end=18094, + serialized_start=15695, + serialized_end=15819, ) _GETEPOCHSINFOREQUEST = _descriptor.Descriptor( @@ -5288,8 +4701,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=17860, - serialized_end=18105, + serialized_start=15585, + serialized_end=15830, ) @@ -5320,8 +4733,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=18466, - serialized_end=18583, + serialized_start=16191, + serialized_end=16308, ) _GETEPOCHSINFORESPONSE_GETEPOCHSINFORESPONSEV0_EPOCHINFO = _descriptor.Descriptor( @@ -5386,8 +4799,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=18586, - serialized_end=18752, + serialized_start=16311, + serialized_end=16477, ) _GETEPOCHSINFORESPONSE_GETEPOCHSINFORESPONSEV0 = _descriptor.Descriptor( @@ -5436,8 +4849,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=18222, - serialized_end=18762, + serialized_start=15947, + serialized_end=16487, ) _GETEPOCHSINFORESPONSE = _descriptor.Descriptor( @@ -5472,8 +4885,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=18108, - serialized_end=18773, + serialized_start=15833, + serialized_end=16498, ) @@ -5511,8 +4924,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=19268, - serialized_end=19337, + serialized_start=16993, + serialized_end=17062, ) _GETCONTESTEDRESOURCESREQUEST_GETCONTESTEDRESOURCESREQUESTV0 = _descriptor.Descriptor( @@ -5608,8 +5021,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=18911, - serialized_end=19371, + serialized_start=16636, + serialized_end=17096, ) _GETCONTESTEDRESOURCESREQUEST = _descriptor.Descriptor( @@ -5644,8 +5057,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=18776, - serialized_end=19382, + serialized_start=16501, + serialized_end=17107, ) @@ -5676,8 +5089,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=19824, - serialized_end=19884, + serialized_start=17549, + serialized_end=17609, ) _GETCONTESTEDRESOURCESRESPONSE_GETCONTESTEDRESOURCESRESPONSEV0 = _descriptor.Descriptor( @@ -5726,8 +5139,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=19523, - serialized_end=19894, + serialized_start=17248, + serialized_end=17619, ) _GETCONTESTEDRESOURCESRESPONSE = _descriptor.Descriptor( @@ -5762,8 +5175,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=19385, - serialized_end=19905, + serialized_start=17110, + serialized_end=17630, ) @@ -5801,8 +5214,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=20418, - serialized_end=20491, + serialized_start=18143, + serialized_end=18216, ) _GETVOTEPOLLSBYENDDATEREQUEST_GETVOTEPOLLSBYENDDATEREQUESTV0_ENDATTIMEINFO = _descriptor.Descriptor( @@ -5839,8 +5252,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=20493, - serialized_end=20560, + serialized_start=18218, + serialized_end=18285, ) _GETVOTEPOLLSBYENDDATEREQUEST_GETVOTEPOLLSBYENDDATEREQUESTV0 = _descriptor.Descriptor( @@ -5925,8 +5338,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=20043, - serialized_end=20619, + serialized_start=17768, + serialized_end=18344, ) _GETVOTEPOLLSBYENDDATEREQUEST = _descriptor.Descriptor( @@ -5961,8 +5374,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=19908, - serialized_end=20630, + serialized_start=17633, + serialized_end=18355, ) @@ -6000,8 +5413,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=21079, - serialized_end=21165, + serialized_start=18804, + serialized_end=18890, ) _GETVOTEPOLLSBYENDDATERESPONSE_GETVOTEPOLLSBYENDDATERESPONSEV0_SERIALIZEDVOTEPOLLSBYTIMESTAMPS = _descriptor.Descriptor( @@ -6038,8 +5451,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=21168, - serialized_end=21383, + serialized_start=18893, + serialized_end=19108, ) _GETVOTEPOLLSBYENDDATERESPONSE_GETVOTEPOLLSBYENDDATERESPONSEV0 = _descriptor.Descriptor( @@ -6088,8 +5501,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=20771, - serialized_end=21393, + serialized_start=18496, + serialized_end=19118, ) _GETVOTEPOLLSBYENDDATERESPONSE = _descriptor.Descriptor( @@ -6124,8 +5537,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=20633, - serialized_end=21404, + serialized_start=18358, + serialized_end=19129, ) @@ -6163,8 +5576,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=22093, - serialized_end=22177, + serialized_start=19818, + serialized_end=19902, ) _GETCONTESTEDRESOURCEVOTESTATEREQUEST_GETCONTESTEDRESOURCEVOTESTATEREQUESTV0 = _descriptor.Descriptor( @@ -6261,8 +5674,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=21566, - serialized_end=22291, + serialized_start=19291, + serialized_end=20016, ) _GETCONTESTEDRESOURCEVOTESTATEREQUEST = _descriptor.Descriptor( @@ -6297,8 +5710,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=21407, - serialized_end=22302, + serialized_start=19132, + serialized_end=20027, ) @@ -6370,8 +5783,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=22802, - serialized_end=23276, + serialized_start=20527, + serialized_end=21001, ) _GETCONTESTEDRESOURCEVOTESTATERESPONSE_GETCONTESTEDRESOURCEVOTESTATERESPONSEV0_CONTESTEDRESOURCECONTENDERS = _descriptor.Descriptor( @@ -6437,8 +5850,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=23279, - serialized_end=23731, + serialized_start=21004, + serialized_end=21456, ) _GETCONTESTEDRESOURCEVOTESTATERESPONSE_GETCONTESTEDRESOURCEVOTESTATERESPONSEV0_CONTENDER = _descriptor.Descriptor( @@ -6492,8 +5905,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=23733, - serialized_end=23840, + serialized_start=21458, + serialized_end=21565, ) _GETCONTESTEDRESOURCEVOTESTATERESPONSE_GETCONTESTEDRESOURCEVOTESTATERESPONSEV0 = _descriptor.Descriptor( @@ -6542,8 +5955,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=22467, - serialized_end=23850, + serialized_start=20192, + serialized_end=21575, ) _GETCONTESTEDRESOURCEVOTESTATERESPONSE = _descriptor.Descriptor( @@ -6578,8 +5991,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=22305, - serialized_end=23861, + serialized_start=20030, + serialized_end=21586, ) @@ -6617,8 +6030,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=22093, - serialized_end=22177, + serialized_start=19818, + serialized_end=19902, ) _GETCONTESTEDRESOURCEVOTERSFORIDENTITYREQUEST_GETCONTESTEDRESOURCEVOTERSFORIDENTITYREQUESTV0 = _descriptor.Descriptor( @@ -6714,8 +6127,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=24048, - serialized_end=24578, + serialized_start=21773, + serialized_end=22303, ) _GETCONTESTEDRESOURCEVOTERSFORIDENTITYREQUEST = _descriptor.Descriptor( @@ -6750,8 +6163,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=23864, - serialized_end=24589, + serialized_start=21589, + serialized_end=22314, ) @@ -6789,8 +6202,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=25129, - serialized_end=25196, + serialized_start=22854, + serialized_end=22921, ) _GETCONTESTEDRESOURCEVOTERSFORIDENTITYRESPONSE_GETCONTESTEDRESOURCEVOTERSFORIDENTITYRESPONSEV0 = _descriptor.Descriptor( @@ -6839,8 +6252,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=24779, - serialized_end=25206, + serialized_start=22504, + serialized_end=22931, ) _GETCONTESTEDRESOURCEVOTERSFORIDENTITYRESPONSE = _descriptor.Descriptor( @@ -6875,8 +6288,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=24592, - serialized_end=25217, + serialized_start=22317, + serialized_end=22942, ) @@ -6914,8 +6327,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=25766, - serialized_end=25863, + serialized_start=23491, + serialized_end=23588, ) _GETCONTESTEDRESOURCEIDENTITYVOTESREQUEST_GETCONTESTEDRESOURCEIDENTITYVOTESREQUESTV0 = _descriptor.Descriptor( @@ -6985,8 +6398,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=25391, - serialized_end=25894, + serialized_start=23116, + serialized_end=23619, ) _GETCONTESTEDRESOURCEIDENTITYVOTESREQUEST = _descriptor.Descriptor( @@ -7021,8 +6434,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=25220, - serialized_end=25905, + serialized_start=22945, + serialized_end=23630, ) @@ -7060,8 +6473,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=26408, - serialized_end=26655, + serialized_start=24133, + serialized_end=24380, ) _GETCONTESTEDRESOURCEIDENTITYVOTESRESPONSE_GETCONTESTEDRESOURCEIDENTITYVOTESRESPONSEV0_RESOURCEVOTECHOICE = _descriptor.Descriptor( @@ -7104,8 +6517,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=26658, - serialized_end=26959, + serialized_start=24383, + serialized_end=24684, ) _GETCONTESTEDRESOURCEIDENTITYVOTESRESPONSE_GETCONTESTEDRESOURCEIDENTITYVOTESRESPONSEV0_CONTESTEDRESOURCEIDENTITYVOTE = _descriptor.Descriptor( @@ -7156,8 +6569,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=26962, - serialized_end=27239, + serialized_start=24687, + serialized_end=24964, ) _GETCONTESTEDRESOURCEIDENTITYVOTESRESPONSE_GETCONTESTEDRESOURCEIDENTITYVOTESRESPONSEV0 = _descriptor.Descriptor( @@ -7206,8 +6619,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=26082, - serialized_end=27249, + serialized_start=23807, + serialized_end=24974, ) _GETCONTESTEDRESOURCEIDENTITYVOTESRESPONSE = _descriptor.Descriptor( @@ -7242,8 +6655,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=25908, - serialized_end=27260, + serialized_start=23633, + serialized_end=24985, ) @@ -7281,8 +6694,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=27424, - serialized_end=27492, + serialized_start=25149, + serialized_end=25217, ) _GETPREFUNDEDSPECIALIZEDBALANCEREQUEST = _descriptor.Descriptor( @@ -7317,8 +6730,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=27263, - serialized_end=27503, + serialized_start=24988, + serialized_end=25228, ) @@ -7368,8 +6781,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=27671, - serialized_end=27860, + serialized_start=25396, + serialized_end=25585, ) _GETPREFUNDEDSPECIALIZEDBALANCERESPONSE = _descriptor.Descriptor( @@ -7404,8 +6817,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=27506, - serialized_end=27871, + serialized_start=25231, + serialized_end=25596, ) @@ -7436,8 +6849,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=28020, - serialized_end=28071, + serialized_start=25745, + serialized_end=25796, ) _GETTOTALCREDITSINPLATFORMREQUEST = _descriptor.Descriptor( @@ -7472,8 +6885,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=27874, - serialized_end=28082, + serialized_start=25599, + serialized_end=25807, ) @@ -7523,8 +6936,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=28235, - serialized_end=28419, + serialized_start=25960, + serialized_end=26144, ) _GETTOTALCREDITSINPLATFORMRESPONSE = _descriptor.Descriptor( @@ -7559,8 +6972,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=28085, - serialized_end=28430, + serialized_start=25810, + serialized_end=26155, ) @@ -7605,8 +7018,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=28549, - serialized_end=28618, + serialized_start=26274, + serialized_end=26343, ) _GETPATHELEMENTSREQUEST = _descriptor.Descriptor( @@ -7641,8 +7054,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=28433, - serialized_end=28629, + serialized_start=26158, + serialized_end=26354, ) @@ -7673,8 +7086,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=29002, - serialized_end=29030, + serialized_start=26727, + serialized_end=26755, ) _GETPATHELEMENTSRESPONSE_GETPATHELEMENTSRESPONSEV0 = _descriptor.Descriptor( @@ -7723,8 +7136,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=28752, - serialized_end=29040, + serialized_start=26477, + serialized_end=26765, ) _GETPATHELEMENTSRESPONSE = _descriptor.Descriptor( @@ -7759,8 +7172,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=28632, - serialized_end=29051, + serialized_start=26357, + serialized_end=26776, ) @@ -7784,8 +7197,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=29152, - serialized_end=29172, + serialized_start=26877, + serialized_end=26897, ) _GETSTATUSREQUEST = _descriptor.Descriptor( @@ -7820,8 +7233,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=29054, - serialized_end=29183, + serialized_start=26779, + serialized_end=26908, ) @@ -7876,8 +7289,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=30060, - serialized_end=30154, + serialized_start=27785, + serialized_end=27879, ) _GETSTATUSRESPONSE_GETSTATUSRESPONSEV0_VERSION_PROTOCOL_TENDERDASH = _descriptor.Descriptor( @@ -7914,8 +7327,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=30387, - serialized_end=30427, + serialized_start=28112, + serialized_end=28152, ) _GETSTATUSRESPONSE_GETSTATUSRESPONSEV0_VERSION_PROTOCOL_DRIVE = _descriptor.Descriptor( @@ -7952,8 +7365,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=30429, - serialized_end=30469, + serialized_start=28154, + serialized_end=28194, ) _GETSTATUSRESPONSE_GETSTATUSRESPONSEV0_VERSION_PROTOCOL = _descriptor.Descriptor( @@ -7990,8 +7403,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=30157, - serialized_end=30469, + serialized_start=27882, + serialized_end=28194, ) _GETSTATUSRESPONSE_GETSTATUSRESPONSEV0_VERSION = _descriptor.Descriptor( @@ -8028,8 +7441,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=29847, - serialized_end=30469, + serialized_start=27572, + serialized_end=28194, ) _GETSTATUSRESPONSE_GETSTATUSRESPONSEV0_TIME = _descriptor.Descriptor( @@ -8095,8 +7508,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=30471, - serialized_end=30598, + serialized_start=28196, + serialized_end=28323, ) _GETSTATUSRESPONSE_GETSTATUSRESPONSEV0_NODE = _descriptor.Descriptor( @@ -8138,8 +7551,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=30600, - serialized_end=30660, + serialized_start=28325, + serialized_end=28385, ) _GETSTATUSRESPONSE_GETSTATUSRESPONSEV0_CHAIN = _descriptor.Descriptor( @@ -8230,8 +7643,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=30663, - serialized_end=30970, + serialized_start=28388, + serialized_end=28695, ) _GETSTATUSRESPONSE_GETSTATUSRESPONSEV0_NETWORK = _descriptor.Descriptor( @@ -8275,8 +7688,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=30972, - serialized_end=31039, + serialized_start=28697, + serialized_end=28764, ) _GETSTATUSRESPONSE_GETSTATUSRESPONSEV0_STATESYNC = _descriptor.Descriptor( @@ -8355,8 +7768,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=31042, - serialized_end=31303, + serialized_start=28767, + serialized_end=29028, ) _GETSTATUSRESPONSE_GETSTATUSRESPONSEV0 = _descriptor.Descriptor( @@ -8421,8 +7834,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=29288, - serialized_end=31303, + serialized_start=27013, + serialized_end=29028, ) _GETSTATUSRESPONSE = _descriptor.Descriptor( @@ -8457,8 +7870,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=29186, - serialized_end=31314, + serialized_start=26911, + serialized_end=29039, ) @@ -8482,8 +7895,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=31451, - serialized_end=31483, + serialized_start=29176, + serialized_end=29208, ) _GETCURRENTQUORUMSINFOREQUEST = _descriptor.Descriptor( @@ -8518,8 +7931,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=31317, - serialized_end=31494, + serialized_start=29042, + serialized_end=29219, ) @@ -8564,8 +7977,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=31634, - serialized_end=31704, + serialized_start=29359, + serialized_end=29429, ) _GETCURRENTQUORUMSINFORESPONSE_VALIDATORSETV0 = _descriptor.Descriptor( @@ -8616,8 +8029,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=31707, - serialized_end=31882, + serialized_start=29432, + serialized_end=29607, ) _GETCURRENTQUORUMSINFORESPONSE_GETCURRENTQUORUMSINFORESPONSEV0 = _descriptor.Descriptor( @@ -8675,8 +8088,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=31885, - serialized_end=32159, + serialized_start=29610, + serialized_end=29884, ) _GETCURRENTQUORUMSINFORESPONSE = _descriptor.Descriptor( @@ -8711,8 +8124,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=31497, - serialized_end=32170, + serialized_start=29222, + serialized_end=29895, ) @@ -8757,8 +8170,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=32316, - serialized_end=32406, + serialized_start=30041, + serialized_end=30131, ) _GETIDENTITYTOKENBALANCESREQUEST = _descriptor.Descriptor( @@ -8793,8 +8206,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=32173, - serialized_end=32417, + serialized_start=29898, + serialized_end=30142, ) @@ -8837,8 +8250,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=32856, - serialized_end=32927, + serialized_start=30581, + serialized_end=30652, ) _GETIDENTITYTOKENBALANCESRESPONSE_GETIDENTITYTOKENBALANCESRESPONSEV0_TOKENBALANCES = _descriptor.Descriptor( @@ -8868,8 +8281,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=32930, - serialized_end=33084, + serialized_start=30655, + serialized_end=30809, ) _GETIDENTITYTOKENBALANCESRESPONSE_GETIDENTITYTOKENBALANCESRESPONSEV0 = _descriptor.Descriptor( @@ -8918,8 +8331,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=32567, - serialized_end=33094, + serialized_start=30292, + serialized_end=30819, ) _GETIDENTITYTOKENBALANCESRESPONSE = _descriptor.Descriptor( @@ -8954,8 +8367,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=32420, - serialized_end=33105, + serialized_start=30145, + serialized_end=30830, ) @@ -9000,8 +8413,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=33257, - serialized_end=33349, + serialized_start=30982, + serialized_end=31074, ) _GETIDENTITIESTOKENBALANCESREQUEST = _descriptor.Descriptor( @@ -9036,8 +8449,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=33108, - serialized_end=33360, + serialized_start=30833, + serialized_end=31085, ) @@ -9080,8 +8493,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=33828, - serialized_end=33910, + serialized_start=31553, + serialized_end=31635, ) _GETIDENTITIESTOKENBALANCESRESPONSE_GETIDENTITIESTOKENBALANCESRESPONSEV0_IDENTITYTOKENBALANCES = _descriptor.Descriptor( @@ -9111,8 +8524,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=33913, - serialized_end=34096, + serialized_start=31638, + serialized_end=31821, ) _GETIDENTITIESTOKENBALANCESRESPONSE_GETIDENTITIESTOKENBALANCESRESPONSEV0 = _descriptor.Descriptor( @@ -9161,8 +8574,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=33516, - serialized_end=34106, + serialized_start=31241, + serialized_end=31831, ) _GETIDENTITIESTOKENBALANCESRESPONSE = _descriptor.Descriptor( @@ -9197,8 +8610,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=33363, - serialized_end=34117, + serialized_start=31088, + serialized_end=31842, ) @@ -9243,8 +8656,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=34254, - serialized_end=34341, + serialized_start=31979, + serialized_end=32066, ) _GETIDENTITYTOKENINFOSREQUEST = _descriptor.Descriptor( @@ -9279,8 +8692,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=34120, - serialized_end=34352, + serialized_start=31845, + serialized_end=32077, ) @@ -9311,8 +8724,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=34766, - serialized_end=34806, + serialized_start=32491, + serialized_end=32531, ) _GETIDENTITYTOKENINFOSRESPONSE_GETIDENTITYTOKENINFOSRESPONSEV0_TOKENINFOENTRY = _descriptor.Descriptor( @@ -9354,8 +8767,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=34809, - serialized_end=34985, + serialized_start=32534, + serialized_end=32710, ) _GETIDENTITYTOKENINFOSRESPONSE_GETIDENTITYTOKENINFOSRESPONSEV0_TOKENINFOS = _descriptor.Descriptor( @@ -9385,8 +8798,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=34988, - serialized_end=35126, + serialized_start=32713, + serialized_end=32851, ) _GETIDENTITYTOKENINFOSRESPONSE_GETIDENTITYTOKENINFOSRESPONSEV0 = _descriptor.Descriptor( @@ -9435,8 +8848,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=34493, - serialized_end=35136, + serialized_start=32218, + serialized_end=32861, ) _GETIDENTITYTOKENINFOSRESPONSE = _descriptor.Descriptor( @@ -9471,8 +8884,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=34355, - serialized_end=35147, + serialized_start=32080, + serialized_end=32872, ) @@ -9517,8 +8930,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=35290, - serialized_end=35379, + serialized_start=33015, + serialized_end=33104, ) _GETIDENTITIESTOKENINFOSREQUEST = _descriptor.Descriptor( @@ -9553,8 +8966,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=35150, - serialized_end=35390, + serialized_start=32875, + serialized_end=33115, ) @@ -9585,8 +8998,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=34766, - serialized_end=34806, + serialized_start=32491, + serialized_end=32531, ) _GETIDENTITIESTOKENINFOSRESPONSE_GETIDENTITIESTOKENINFOSRESPONSEV0_TOKENINFOENTRY = _descriptor.Descriptor( @@ -9628,8 +9041,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=35877, - serialized_end=36060, + serialized_start=33602, + serialized_end=33785, ) _GETIDENTITIESTOKENINFOSRESPONSE_GETIDENTITIESTOKENINFOSRESPONSEV0_IDENTITYTOKENINFOS = _descriptor.Descriptor( @@ -9659,8 +9072,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=36063, - serialized_end=36214, + serialized_start=33788, + serialized_end=33939, ) _GETIDENTITIESTOKENINFOSRESPONSE_GETIDENTITIESTOKENINFOSRESPONSEV0 = _descriptor.Descriptor( @@ -9709,8 +9122,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=35537, - serialized_end=36224, + serialized_start=33262, + serialized_end=33949, ) _GETIDENTITIESTOKENINFOSRESPONSE = _descriptor.Descriptor( @@ -9745,8 +9158,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=35393, - serialized_end=36235, + serialized_start=33118, + serialized_end=33960, ) @@ -9784,8 +9197,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=36357, - serialized_end=36418, + serialized_start=34082, + serialized_end=34143, ) _GETTOKENSTATUSESREQUEST = _descriptor.Descriptor( @@ -9820,8 +9233,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=36238, - serialized_end=36429, + serialized_start=33963, + serialized_end=34154, ) @@ -9864,8 +9277,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=36819, - serialized_end=36887, + serialized_start=34544, + serialized_end=34612, ) _GETTOKENSTATUSESRESPONSE_GETTOKENSTATUSESRESPONSEV0_TOKENSTATUSES = _descriptor.Descriptor( @@ -9895,8 +9308,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=36890, - serialized_end=37026, + serialized_start=34615, + serialized_end=34751, ) _GETTOKENSTATUSESRESPONSE_GETTOKENSTATUSESRESPONSEV0 = _descriptor.Descriptor( @@ -9945,8 +9358,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=36555, - serialized_end=37036, + serialized_start=34280, + serialized_end=34761, ) _GETTOKENSTATUSESRESPONSE = _descriptor.Descriptor( @@ -9981,8 +9394,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=36432, - serialized_end=37047, + serialized_start=34157, + serialized_end=34772, ) @@ -10037,8 +9450,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=37480, - serialized_end=37634, + serialized_start=35205, + serialized_end=35359, ) _GETTOKENPREPROGRAMMEDDISTRIBUTIONSREQUEST_GETTOKENPREPROGRAMMEDDISTRIBUTIONSREQUESTV0 = _descriptor.Descriptor( @@ -10099,8 +9512,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=37224, - serialized_end=37662, + serialized_start=34949, + serialized_end=35387, ) _GETTOKENPREPROGRAMMEDDISTRIBUTIONSREQUEST = _descriptor.Descriptor( @@ -10135,8 +9548,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=37050, - serialized_end=37673, + serialized_start=34775, + serialized_end=35398, ) @@ -10174,8 +9587,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=38184, - serialized_end=38246, + serialized_start=35909, + serialized_end=35971, ) _GETTOKENPREPROGRAMMEDDISTRIBUTIONSRESPONSE_GETTOKENPREPROGRAMMEDDISTRIBUTIONSRESPONSEV0_TOKENTIMEDDISTRIBUTIONENTRY = _descriptor.Descriptor( @@ -10212,8 +9625,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=38249, - serialized_end=38461, + serialized_start=35974, + serialized_end=36186, ) _GETTOKENPREPROGRAMMEDDISTRIBUTIONSRESPONSE_GETTOKENPREPROGRAMMEDDISTRIBUTIONSRESPONSEV0_TOKENDISTRIBUTIONS = _descriptor.Descriptor( @@ -10243,8 +9656,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=38464, - serialized_end=38659, + serialized_start=36189, + serialized_end=36384, ) _GETTOKENPREPROGRAMMEDDISTRIBUTIONSRESPONSE_GETTOKENPREPROGRAMMEDDISTRIBUTIONSRESPONSEV0 = _descriptor.Descriptor( @@ -10293,8 +9706,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=37854, - serialized_end=38669, + serialized_start=35579, + serialized_end=36394, ) _GETTOKENPREPROGRAMMEDDISTRIBUTIONSRESPONSE = _descriptor.Descriptor( @@ -10329,8 +9742,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=37676, - serialized_end=38680, + serialized_start=35401, + serialized_end=36405, ) @@ -10368,8 +9781,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=38811, - serialized_end=38874, + serialized_start=36536, + serialized_end=36599, ) _GETTOKENTOTALSUPPLYREQUEST = _descriptor.Descriptor( @@ -10404,8 +9817,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=38683, - serialized_end=38885, + serialized_start=36408, + serialized_end=36610, ) @@ -10450,8 +9863,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=39306, - serialized_end=39426, + serialized_start=37031, + serialized_end=37151, ) _GETTOKENTOTALSUPPLYRESPONSE_GETTOKENTOTALSUPPLYRESPONSEV0 = _descriptor.Descriptor( @@ -10500,8 +9913,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=39020, - serialized_end=39436, + serialized_start=36745, + serialized_end=37161, ) _GETTOKENTOTALSUPPLYRESPONSE = _descriptor.Descriptor( @@ -10536,8 +9949,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=38888, - serialized_end=39447, + serialized_start=36613, + serialized_end=37172, ) @@ -10582,8 +9995,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=39557, - serialized_end=39649, + serialized_start=37282, + serialized_end=37374, ) _GETGROUPINFOREQUEST = _descriptor.Descriptor( @@ -10618,8 +10031,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=39450, - serialized_end=39660, + serialized_start=37175, + serialized_end=37385, ) @@ -10657,8 +10070,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=40018, - serialized_end=40070, + serialized_start=37743, + serialized_end=37795, ) _GETGROUPINFORESPONSE_GETGROUPINFORESPONSEV0_GROUPINFOENTRY = _descriptor.Descriptor( @@ -10695,8 +10108,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=40073, - serialized_end=40225, + serialized_start=37798, + serialized_end=37950, ) _GETGROUPINFORESPONSE_GETGROUPINFORESPONSEV0_GROUPINFO = _descriptor.Descriptor( @@ -10731,8 +10144,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=40228, - serialized_end=40366, + serialized_start=37953, + serialized_end=38091, ) _GETGROUPINFORESPONSE_GETGROUPINFORESPONSEV0 = _descriptor.Descriptor( @@ -10781,8 +10194,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=39774, - serialized_end=40376, + serialized_start=37499, + serialized_end=38101, ) _GETGROUPINFORESPONSE = _descriptor.Descriptor( @@ -10817,8 +10230,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=39663, - serialized_end=40387, + serialized_start=37388, + serialized_end=38112, ) @@ -10856,8 +10269,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=40500, - serialized_end=40617, + serialized_start=38225, + serialized_end=38342, ) _GETGROUPINFOSREQUEST_GETGROUPINFOSREQUESTV0 = _descriptor.Descriptor( @@ -10918,8 +10331,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=40620, - serialized_end=40872, + serialized_start=38345, + serialized_end=38597, ) _GETGROUPINFOSREQUEST = _descriptor.Descriptor( @@ -10954,8 +10367,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=40390, - serialized_end=40883, + serialized_start=38115, + serialized_end=38608, ) @@ -10993,8 +10406,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=40018, - serialized_end=40070, + serialized_start=37743, + serialized_end=37795, ) _GETGROUPINFOSRESPONSE_GETGROUPINFOSRESPONSEV0_GROUPPOSITIONINFOENTRY = _descriptor.Descriptor( @@ -11038,8 +10451,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=41304, - serialized_end=41499, + serialized_start=39029, + serialized_end=39224, ) _GETGROUPINFOSRESPONSE_GETGROUPINFOSRESPONSEV0_GROUPINFOS = _descriptor.Descriptor( @@ -11069,8 +10482,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=41502, - serialized_end=41632, + serialized_start=39227, + serialized_end=39357, ) _GETGROUPINFOSRESPONSE_GETGROUPINFOSRESPONSEV0 = _descriptor.Descriptor( @@ -11119,8 +10532,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=41000, - serialized_end=41642, + serialized_start=38725, + serialized_end=39367, ) _GETGROUPINFOSRESPONSE = _descriptor.Descriptor( @@ -11155,8 +10568,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=40886, - serialized_end=41653, + serialized_start=38611, + serialized_end=39378, ) @@ -11194,8 +10607,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=41772, - serialized_end=41848, + serialized_start=39497, + serialized_end=39573, ) _GETGROUPACTIONSREQUEST_GETGROUPACTIONSREQUESTV0 = _descriptor.Descriptor( @@ -11270,8 +10683,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=41851, - serialized_end=42179, + serialized_start=39576, + serialized_end=39904, ) _GETGROUPACTIONSREQUEST = _descriptor.Descriptor( @@ -11307,8 +10720,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=41656, - serialized_end=42230, + serialized_start=39381, + serialized_end=39955, ) @@ -11358,8 +10771,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=42612, - serialized_end=42703, + serialized_start=40337, + serialized_end=40428, ) _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_BURNEVENT = _descriptor.Descriptor( @@ -11401,8 +10814,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=42705, - serialized_end=42774, + serialized_start=40430, + serialized_end=40499, ) _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_FREEZEEVENT = _descriptor.Descriptor( @@ -11444,8 +10857,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=42776, - serialized_end=42850, + serialized_start=40501, + serialized_end=40575, ) _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_UNFREEZEEVENT = _descriptor.Descriptor( @@ -11487,8 +10900,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=42852, - serialized_end=42928, + serialized_start=40577, + serialized_end=40653, ) _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_DESTROYFROZENFUNDSEVENT = _descriptor.Descriptor( @@ -11537,8 +10950,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=42930, - serialized_end=43032, + serialized_start=40655, + serialized_end=40757, ) _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_SHAREDENCRYPTEDNOTE = _descriptor.Descriptor( @@ -11582,8 +10995,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=43034, - serialized_end=43134, + serialized_start=40759, + serialized_end=40859, ) _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_PERSONALENCRYPTEDNOTE = _descriptor.Descriptor( @@ -11627,8 +11040,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=43136, - serialized_end=43259, + serialized_start=40861, + serialized_end=40984, ) _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_EMERGENCYACTIONEVENT = _descriptor.Descriptor( @@ -11671,8 +11084,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=43262, - serialized_end=43495, + serialized_start=40987, + serialized_end=41220, ) _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_TOKENCONFIGUPDATEEVENT = _descriptor.Descriptor( @@ -11714,8 +11127,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=43497, - serialized_end=43597, + serialized_start=41222, + serialized_end=41322, ) _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_GROUPACTIONEVENT = _descriptor.Descriptor( @@ -11764,8 +11177,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=43600, - serialized_end=43980, + serialized_start=41325, + serialized_end=41705, ) _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_DOCUMENTEVENT = _descriptor.Descriptor( @@ -11800,8 +11213,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=43983, - serialized_end=44122, + serialized_start=41708, + serialized_end=41847, ) _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_DOCUMENTCREATEEVENT = _descriptor.Descriptor( @@ -11831,8 +11244,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=44124, - serialized_end=44171, + serialized_start=41849, + serialized_end=41896, ) _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_CONTRACTUPDATEEVENT = _descriptor.Descriptor( @@ -11862,8 +11275,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=44173, - serialized_end=44220, + serialized_start=41898, + serialized_end=41945, ) _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_CONTRACTEVENT = _descriptor.Descriptor( @@ -11898,8 +11311,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=44223, - serialized_end=44362, + serialized_start=41948, + serialized_end=42087, ) _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_TOKENEVENT = _descriptor.Descriptor( @@ -11976,8 +11389,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=44365, - serialized_end=45208, + serialized_start=42090, + serialized_end=42933, ) _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_GROUPACTIONENTRY = _descriptor.Descriptor( @@ -12014,8 +11427,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=45211, - serialized_end=45358, + serialized_start=42936, + serialized_end=43083, ) _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_GROUPACTIONS = _descriptor.Descriptor( @@ -12045,8 +11458,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=45361, - serialized_end=45493, + serialized_start=43086, + serialized_end=43218, ) _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0 = _descriptor.Descriptor( @@ -12095,8 +11508,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=42353, - serialized_end=45503, + serialized_start=40078, + serialized_end=43228, ) _GETGROUPACTIONSRESPONSE = _descriptor.Descriptor( @@ -12131,8 +11544,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=42233, - serialized_end=45514, + serialized_start=39958, + serialized_end=43239, ) @@ -12191,8 +11604,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=45652, - serialized_end=45858, + serialized_start=43377, + serialized_end=43583, ) _GETGROUPACTIONSIGNERSREQUEST = _descriptor.Descriptor( @@ -12228,8 +11641,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=45517, - serialized_end=45909, + serialized_start=43242, + serialized_end=43634, ) @@ -12267,8 +11680,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=46341, - serialized_end=46394, + serialized_start=44066, + serialized_end=44119, ) _GETGROUPACTIONSIGNERSRESPONSE_GETGROUPACTIONSIGNERSRESPONSEV0_GROUPACTIONSIGNERS = _descriptor.Descriptor( @@ -12298,8 +11711,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=46397, - serialized_end=46542, + serialized_start=44122, + serialized_end=44267, ) _GETGROUPACTIONSIGNERSRESPONSE_GETGROUPACTIONSIGNERSRESPONSEV0 = _descriptor.Descriptor( @@ -12348,8 +11761,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=46050, - serialized_end=46552, + serialized_start=43775, + serialized_end=44277, ) _GETGROUPACTIONSIGNERSRESPONSE = _descriptor.Descriptor( @@ -12384,8 +11797,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=45912, - serialized_end=46563, + serialized_start=43637, + serialized_end=44288, ) _GETIDENTITYREQUEST_GETIDENTITYREQUESTV0.containing_type = _GETIDENTITYREQUEST @@ -12618,44 +12031,6 @@ _GETIDENTITIESBALANCESRESPONSE.oneofs_by_name['version'].fields.append( _GETIDENTITIESBALANCESRESPONSE.fields_by_name['v0']) _GETIDENTITIESBALANCESRESPONSE.fields_by_name['v0'].containing_oneof = _GETIDENTITIESBALANCESRESPONSE.oneofs_by_name['version'] -_GETPROOFSREQUEST_GETPROOFSREQUESTV0_DOCUMENTREQUEST.fields_by_name['document_contested_status'].enum_type = _GETPROOFSREQUEST_GETPROOFSREQUESTV0_DOCUMENTREQUEST_DOCUMENTCONTESTEDSTATUS -_GETPROOFSREQUEST_GETPROOFSREQUESTV0_DOCUMENTREQUEST.containing_type = _GETPROOFSREQUEST_GETPROOFSREQUESTV0 -_GETPROOFSREQUEST_GETPROOFSREQUESTV0_DOCUMENTREQUEST_DOCUMENTCONTESTEDSTATUS.containing_type = _GETPROOFSREQUEST_GETPROOFSREQUESTV0_DOCUMENTREQUEST -_GETPROOFSREQUEST_GETPROOFSREQUESTV0_IDENTITYREQUEST.fields_by_name['request_type'].enum_type = _GETPROOFSREQUEST_GETPROOFSREQUESTV0_IDENTITYREQUEST_TYPE -_GETPROOFSREQUEST_GETPROOFSREQUESTV0_IDENTITYREQUEST.containing_type = _GETPROOFSREQUEST_GETPROOFSREQUESTV0 -_GETPROOFSREQUEST_GETPROOFSREQUESTV0_IDENTITYREQUEST_TYPE.containing_type = _GETPROOFSREQUEST_GETPROOFSREQUESTV0_IDENTITYREQUEST -_GETPROOFSREQUEST_GETPROOFSREQUESTV0_CONTRACTREQUEST.containing_type = _GETPROOFSREQUEST_GETPROOFSREQUESTV0 -_GETPROOFSREQUEST_GETPROOFSREQUESTV0_VOTESTATUSREQUEST_CONTESTEDRESOURCEVOTESTATUSREQUEST.containing_type = _GETPROOFSREQUEST_GETPROOFSREQUESTV0_VOTESTATUSREQUEST -_GETPROOFSREQUEST_GETPROOFSREQUESTV0_VOTESTATUSREQUEST.fields_by_name['contested_resource_vote_status_request'].message_type = _GETPROOFSREQUEST_GETPROOFSREQUESTV0_VOTESTATUSREQUEST_CONTESTEDRESOURCEVOTESTATUSREQUEST -_GETPROOFSREQUEST_GETPROOFSREQUESTV0_VOTESTATUSREQUEST.containing_type = _GETPROOFSREQUEST_GETPROOFSREQUESTV0 -_GETPROOFSREQUEST_GETPROOFSREQUESTV0_VOTESTATUSREQUEST.oneofs_by_name['request_type'].fields.append( - _GETPROOFSREQUEST_GETPROOFSREQUESTV0_VOTESTATUSREQUEST.fields_by_name['contested_resource_vote_status_request']) -_GETPROOFSREQUEST_GETPROOFSREQUESTV0_VOTESTATUSREQUEST.fields_by_name['contested_resource_vote_status_request'].containing_oneof = _GETPROOFSREQUEST_GETPROOFSREQUESTV0_VOTESTATUSREQUEST.oneofs_by_name['request_type'] -_GETPROOFSREQUEST_GETPROOFSREQUESTV0_IDENTITYTOKENBALANCEREQUEST.containing_type = _GETPROOFSREQUEST_GETPROOFSREQUESTV0 -_GETPROOFSREQUEST_GETPROOFSREQUESTV0_IDENTITYTOKENINFOREQUEST.containing_type = _GETPROOFSREQUEST_GETPROOFSREQUESTV0 -_GETPROOFSREQUEST_GETPROOFSREQUESTV0_TOKENSTATUSREQUEST.containing_type = _GETPROOFSREQUEST_GETPROOFSREQUESTV0 -_GETPROOFSREQUEST_GETPROOFSREQUESTV0.fields_by_name['identities'].message_type = _GETPROOFSREQUEST_GETPROOFSREQUESTV0_IDENTITYREQUEST -_GETPROOFSREQUEST_GETPROOFSREQUESTV0.fields_by_name['contracts'].message_type = _GETPROOFSREQUEST_GETPROOFSREQUESTV0_CONTRACTREQUEST -_GETPROOFSREQUEST_GETPROOFSREQUESTV0.fields_by_name['documents'].message_type = _GETPROOFSREQUEST_GETPROOFSREQUESTV0_DOCUMENTREQUEST -_GETPROOFSREQUEST_GETPROOFSREQUESTV0.fields_by_name['votes'].message_type = _GETPROOFSREQUEST_GETPROOFSREQUESTV0_VOTESTATUSREQUEST -_GETPROOFSREQUEST_GETPROOFSREQUESTV0.fields_by_name['identity_token_balances'].message_type = _GETPROOFSREQUEST_GETPROOFSREQUESTV0_IDENTITYTOKENBALANCEREQUEST -_GETPROOFSREQUEST_GETPROOFSREQUESTV0.fields_by_name['identity_token_infos'].message_type = _GETPROOFSREQUEST_GETPROOFSREQUESTV0_IDENTITYTOKENINFOREQUEST -_GETPROOFSREQUEST_GETPROOFSREQUESTV0.fields_by_name['token_statuses'].message_type = _GETPROOFSREQUEST_GETPROOFSREQUESTV0_TOKENSTATUSREQUEST -_GETPROOFSREQUEST_GETPROOFSREQUESTV0.containing_type = _GETPROOFSREQUEST -_GETPROOFSREQUEST.fields_by_name['v0'].message_type = _GETPROOFSREQUEST_GETPROOFSREQUESTV0 -_GETPROOFSREQUEST.oneofs_by_name['version'].fields.append( - _GETPROOFSREQUEST.fields_by_name['v0']) -_GETPROOFSREQUEST.fields_by_name['v0'].containing_oneof = _GETPROOFSREQUEST.oneofs_by_name['version'] -_GETPROOFSRESPONSE_GETPROOFSRESPONSEV0.fields_by_name['proof'].message_type = _PROOF -_GETPROOFSRESPONSE_GETPROOFSRESPONSEV0.fields_by_name['metadata'].message_type = _RESPONSEMETADATA -_GETPROOFSRESPONSE_GETPROOFSRESPONSEV0.containing_type = _GETPROOFSRESPONSE -_GETPROOFSRESPONSE_GETPROOFSRESPONSEV0.oneofs_by_name['result'].fields.append( - _GETPROOFSRESPONSE_GETPROOFSRESPONSEV0.fields_by_name['proof']) -_GETPROOFSRESPONSE_GETPROOFSRESPONSEV0.fields_by_name['proof'].containing_oneof = _GETPROOFSRESPONSE_GETPROOFSRESPONSEV0.oneofs_by_name['result'] -_GETPROOFSRESPONSE.fields_by_name['v0'].message_type = _GETPROOFSRESPONSE_GETPROOFSRESPONSEV0 -_GETPROOFSRESPONSE.oneofs_by_name['version'].fields.append( - _GETPROOFSRESPONSE.fields_by_name['v0']) -_GETPROOFSRESPONSE.fields_by_name['v0'].containing_oneof = _GETPROOFSRESPONSE.oneofs_by_name['version'] _GETDATACONTRACTREQUEST_GETDATACONTRACTREQUESTV0.containing_type = _GETDATACONTRACTREQUEST _GETDATACONTRACTREQUEST.fields_by_name['v0'].message_type = _GETDATACONTRACTREQUEST_GETDATACONTRACTREQUESTV0 _GETDATACONTRACTREQUEST.oneofs_by_name['version'].fields.append( @@ -13589,8 +12964,6 @@ DESCRIPTOR.message_types_by_name['GetEvonodesProposedEpochBlocksByRangeRequest'] = _GETEVONODESPROPOSEDEPOCHBLOCKSBYRANGEREQUEST DESCRIPTOR.message_types_by_name['GetIdentitiesBalancesRequest'] = _GETIDENTITIESBALANCESREQUEST DESCRIPTOR.message_types_by_name['GetIdentitiesBalancesResponse'] = _GETIDENTITIESBALANCESRESPONSE -DESCRIPTOR.message_types_by_name['GetProofsRequest'] = _GETPROOFSREQUEST -DESCRIPTOR.message_types_by_name['GetProofsResponse'] = _GETPROOFSRESPONSE DESCRIPTOR.message_types_by_name['GetDataContractRequest'] = _GETDATACONTRACTREQUEST DESCRIPTOR.message_types_by_name['GetDataContractResponse'] = _GETDATACONTRACTRESPONSE DESCRIPTOR.message_types_by_name['GetDataContractsRequest'] = _GETDATACONTRACTSREQUEST @@ -14099,100 +13472,6 @@ _sym_db.RegisterMessage(GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance) _sym_db.RegisterMessage(GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances) -GetProofsRequest = _reflection.GeneratedProtocolMessageType('GetProofsRequest', (_message.Message,), { - - 'GetProofsRequestV0' : _reflection.GeneratedProtocolMessageType('GetProofsRequestV0', (_message.Message,), { - - 'DocumentRequest' : _reflection.GeneratedProtocolMessageType('DocumentRequest', (_message.Message,), { - 'DESCRIPTOR' : _GETPROOFSREQUEST_GETPROOFSREQUESTV0_DOCUMENTREQUEST, - '__module__' : 'platform_pb2' - # @@protoc_insertion_point(class_scope:org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest) - }) - , - - 'IdentityRequest' : _reflection.GeneratedProtocolMessageType('IdentityRequest', (_message.Message,), { - 'DESCRIPTOR' : _GETPROOFSREQUEST_GETPROOFSREQUESTV0_IDENTITYREQUEST, - '__module__' : 'platform_pb2' - # @@protoc_insertion_point(class_scope:org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityRequest) - }) - , - - 'ContractRequest' : _reflection.GeneratedProtocolMessageType('ContractRequest', (_message.Message,), { - 'DESCRIPTOR' : _GETPROOFSREQUEST_GETPROOFSREQUESTV0_CONTRACTREQUEST, - '__module__' : 'platform_pb2' - # @@protoc_insertion_point(class_scope:org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.ContractRequest) - }) - , - - 'VoteStatusRequest' : _reflection.GeneratedProtocolMessageType('VoteStatusRequest', (_message.Message,), { - - 'ContestedResourceVoteStatusRequest' : _reflection.GeneratedProtocolMessageType('ContestedResourceVoteStatusRequest', (_message.Message,), { - 'DESCRIPTOR' : _GETPROOFSREQUEST_GETPROOFSREQUESTV0_VOTESTATUSREQUEST_CONTESTEDRESOURCEVOTESTATUSREQUEST, - '__module__' : 'platform_pb2' - # @@protoc_insertion_point(class_scope:org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest) - }) - , - 'DESCRIPTOR' : _GETPROOFSREQUEST_GETPROOFSREQUESTV0_VOTESTATUSREQUEST, - '__module__' : 'platform_pb2' - # @@protoc_insertion_point(class_scope:org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest) - }) - , - - 'IdentityTokenBalanceRequest' : _reflection.GeneratedProtocolMessageType('IdentityTokenBalanceRequest', (_message.Message,), { - 'DESCRIPTOR' : _GETPROOFSREQUEST_GETPROOFSREQUESTV0_IDENTITYTOKENBALANCEREQUEST, - '__module__' : 'platform_pb2' - # @@protoc_insertion_point(class_scope:org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenBalanceRequest) - }) - , - - 'IdentityTokenInfoRequest' : _reflection.GeneratedProtocolMessageType('IdentityTokenInfoRequest', (_message.Message,), { - 'DESCRIPTOR' : _GETPROOFSREQUEST_GETPROOFSREQUESTV0_IDENTITYTOKENINFOREQUEST, - '__module__' : 'platform_pb2' - # @@protoc_insertion_point(class_scope:org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenInfoRequest) - }) - , - - 'TokenStatusRequest' : _reflection.GeneratedProtocolMessageType('TokenStatusRequest', (_message.Message,), { - 'DESCRIPTOR' : _GETPROOFSREQUEST_GETPROOFSREQUESTV0_TOKENSTATUSREQUEST, - '__module__' : 'platform_pb2' - # @@protoc_insertion_point(class_scope:org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.TokenStatusRequest) - }) - , - 'DESCRIPTOR' : _GETPROOFSREQUEST_GETPROOFSREQUESTV0, - '__module__' : 'platform_pb2' - # @@protoc_insertion_point(class_scope:org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0) - }) - , - 'DESCRIPTOR' : _GETPROOFSREQUEST, - '__module__' : 'platform_pb2' - # @@protoc_insertion_point(class_scope:org.dash.platform.dapi.v0.GetProofsRequest) - }) -_sym_db.RegisterMessage(GetProofsRequest) -_sym_db.RegisterMessage(GetProofsRequest.GetProofsRequestV0) -_sym_db.RegisterMessage(GetProofsRequest.GetProofsRequestV0.DocumentRequest) -_sym_db.RegisterMessage(GetProofsRequest.GetProofsRequestV0.IdentityRequest) -_sym_db.RegisterMessage(GetProofsRequest.GetProofsRequestV0.ContractRequest) -_sym_db.RegisterMessage(GetProofsRequest.GetProofsRequestV0.VoteStatusRequest) -_sym_db.RegisterMessage(GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest) -_sym_db.RegisterMessage(GetProofsRequest.GetProofsRequestV0.IdentityTokenBalanceRequest) -_sym_db.RegisterMessage(GetProofsRequest.GetProofsRequestV0.IdentityTokenInfoRequest) -_sym_db.RegisterMessage(GetProofsRequest.GetProofsRequestV0.TokenStatusRequest) - -GetProofsResponse = _reflection.GeneratedProtocolMessageType('GetProofsResponse', (_message.Message,), { - - 'GetProofsResponseV0' : _reflection.GeneratedProtocolMessageType('GetProofsResponseV0', (_message.Message,), { - 'DESCRIPTOR' : _GETPROOFSRESPONSE_GETPROOFSRESPONSEV0, - '__module__' : 'platform_pb2' - # @@protoc_insertion_point(class_scope:org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0) - }) - , - 'DESCRIPTOR' : _GETPROOFSRESPONSE, - '__module__' : 'platform_pb2' - # @@protoc_insertion_point(class_scope:org.dash.platform.dapi.v0.GetProofsResponse) - }) -_sym_db.RegisterMessage(GetProofsResponse) -_sym_db.RegisterMessage(GetProofsResponse.GetProofsResponseV0) - GetDataContractRequest = _reflection.GeneratedProtocolMessageType('GetDataContractRequest', (_message.Message,), { 'GetDataContractRequestV0' : _reflection.GeneratedProtocolMessageType('GetDataContractRequestV0', (_message.Message,), { @@ -15855,8 +15134,8 @@ index=0, serialized_options=None, create_key=_descriptor._internal_create_key, - serialized_start=46658, - serialized_end=52828, + serialized_start=44383, + serialized_end=50449, methods=[ _descriptor.MethodDescriptor( name='broadcastStateTransition', @@ -15968,20 +15247,10 @@ serialized_options=None, create_key=_descriptor._internal_create_key, ), - _descriptor.MethodDescriptor( - name='getProofs', - full_name='org.dash.platform.dapi.v0.Platform.getProofs', - index=11, - containing_service=None, - input_type=_GETPROOFSREQUEST, - output_type=_GETPROOFSRESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), _descriptor.MethodDescriptor( name='getDataContract', full_name='org.dash.platform.dapi.v0.Platform.getDataContract', - index=12, + index=11, containing_service=None, input_type=_GETDATACONTRACTREQUEST, output_type=_GETDATACONTRACTRESPONSE, @@ -15991,7 +15260,7 @@ _descriptor.MethodDescriptor( name='getDataContractHistory', full_name='org.dash.platform.dapi.v0.Platform.getDataContractHistory', - index=13, + index=12, containing_service=None, input_type=_GETDATACONTRACTHISTORYREQUEST, output_type=_GETDATACONTRACTHISTORYRESPONSE, @@ -16001,7 +15270,7 @@ _descriptor.MethodDescriptor( name='getDataContracts', full_name='org.dash.platform.dapi.v0.Platform.getDataContracts', - index=14, + index=13, containing_service=None, input_type=_GETDATACONTRACTSREQUEST, output_type=_GETDATACONTRACTSRESPONSE, @@ -16011,7 +15280,7 @@ _descriptor.MethodDescriptor( name='getDocuments', full_name='org.dash.platform.dapi.v0.Platform.getDocuments', - index=15, + index=14, containing_service=None, input_type=_GETDOCUMENTSREQUEST, output_type=_GETDOCUMENTSRESPONSE, @@ -16021,7 +15290,7 @@ _descriptor.MethodDescriptor( name='getIdentityByPublicKeyHash', full_name='org.dash.platform.dapi.v0.Platform.getIdentityByPublicKeyHash', - index=16, + index=15, containing_service=None, input_type=_GETIDENTITYBYPUBLICKEYHASHREQUEST, output_type=_GETIDENTITYBYPUBLICKEYHASHRESPONSE, @@ -16031,7 +15300,7 @@ _descriptor.MethodDescriptor( name='waitForStateTransitionResult', full_name='org.dash.platform.dapi.v0.Platform.waitForStateTransitionResult', - index=17, + index=16, containing_service=None, input_type=_WAITFORSTATETRANSITIONRESULTREQUEST, output_type=_WAITFORSTATETRANSITIONRESULTRESPONSE, @@ -16041,7 +15310,7 @@ _descriptor.MethodDescriptor( name='getConsensusParams', full_name='org.dash.platform.dapi.v0.Platform.getConsensusParams', - index=18, + index=17, containing_service=None, input_type=_GETCONSENSUSPARAMSREQUEST, output_type=_GETCONSENSUSPARAMSRESPONSE, @@ -16051,7 +15320,7 @@ _descriptor.MethodDescriptor( name='getProtocolVersionUpgradeState', full_name='org.dash.platform.dapi.v0.Platform.getProtocolVersionUpgradeState', - index=19, + index=18, containing_service=None, input_type=_GETPROTOCOLVERSIONUPGRADESTATEREQUEST, output_type=_GETPROTOCOLVERSIONUPGRADESTATERESPONSE, @@ -16061,7 +15330,7 @@ _descriptor.MethodDescriptor( name='getProtocolVersionUpgradeVoteStatus', full_name='org.dash.platform.dapi.v0.Platform.getProtocolVersionUpgradeVoteStatus', - index=20, + index=19, containing_service=None, input_type=_GETPROTOCOLVERSIONUPGRADEVOTESTATUSREQUEST, output_type=_GETPROTOCOLVERSIONUPGRADEVOTESTATUSRESPONSE, @@ -16071,7 +15340,7 @@ _descriptor.MethodDescriptor( name='getEpochsInfo', full_name='org.dash.platform.dapi.v0.Platform.getEpochsInfo', - index=21, + index=20, containing_service=None, input_type=_GETEPOCHSINFOREQUEST, output_type=_GETEPOCHSINFORESPONSE, @@ -16081,7 +15350,7 @@ _descriptor.MethodDescriptor( name='getContestedResources', full_name='org.dash.platform.dapi.v0.Platform.getContestedResources', - index=22, + index=21, containing_service=None, input_type=_GETCONTESTEDRESOURCESREQUEST, output_type=_GETCONTESTEDRESOURCESRESPONSE, @@ -16091,7 +15360,7 @@ _descriptor.MethodDescriptor( name='getContestedResourceVoteState', full_name='org.dash.platform.dapi.v0.Platform.getContestedResourceVoteState', - index=23, + index=22, containing_service=None, input_type=_GETCONTESTEDRESOURCEVOTESTATEREQUEST, output_type=_GETCONTESTEDRESOURCEVOTESTATERESPONSE, @@ -16101,7 +15370,7 @@ _descriptor.MethodDescriptor( name='getContestedResourceVotersForIdentity', full_name='org.dash.platform.dapi.v0.Platform.getContestedResourceVotersForIdentity', - index=24, + index=23, containing_service=None, input_type=_GETCONTESTEDRESOURCEVOTERSFORIDENTITYREQUEST, output_type=_GETCONTESTEDRESOURCEVOTERSFORIDENTITYRESPONSE, @@ -16111,7 +15380,7 @@ _descriptor.MethodDescriptor( name='getContestedResourceIdentityVotes', full_name='org.dash.platform.dapi.v0.Platform.getContestedResourceIdentityVotes', - index=25, + index=24, containing_service=None, input_type=_GETCONTESTEDRESOURCEIDENTITYVOTESREQUEST, output_type=_GETCONTESTEDRESOURCEIDENTITYVOTESRESPONSE, @@ -16121,7 +15390,7 @@ _descriptor.MethodDescriptor( name='getVotePollsByEndDate', full_name='org.dash.platform.dapi.v0.Platform.getVotePollsByEndDate', - index=26, + index=25, containing_service=None, input_type=_GETVOTEPOLLSBYENDDATEREQUEST, output_type=_GETVOTEPOLLSBYENDDATERESPONSE, @@ -16131,7 +15400,7 @@ _descriptor.MethodDescriptor( name='getPrefundedSpecializedBalance', full_name='org.dash.platform.dapi.v0.Platform.getPrefundedSpecializedBalance', - index=27, + index=26, containing_service=None, input_type=_GETPREFUNDEDSPECIALIZEDBALANCEREQUEST, output_type=_GETPREFUNDEDSPECIALIZEDBALANCERESPONSE, @@ -16141,7 +15410,7 @@ _descriptor.MethodDescriptor( name='getTotalCreditsInPlatform', full_name='org.dash.platform.dapi.v0.Platform.getTotalCreditsInPlatform', - index=28, + index=27, containing_service=None, input_type=_GETTOTALCREDITSINPLATFORMREQUEST, output_type=_GETTOTALCREDITSINPLATFORMRESPONSE, @@ -16151,7 +15420,7 @@ _descriptor.MethodDescriptor( name='getPathElements', full_name='org.dash.platform.dapi.v0.Platform.getPathElements', - index=29, + index=28, containing_service=None, input_type=_GETPATHELEMENTSREQUEST, output_type=_GETPATHELEMENTSRESPONSE, @@ -16161,7 +15430,7 @@ _descriptor.MethodDescriptor( name='getStatus', full_name='org.dash.platform.dapi.v0.Platform.getStatus', - index=30, + index=29, containing_service=None, input_type=_GETSTATUSREQUEST, output_type=_GETSTATUSRESPONSE, @@ -16171,7 +15440,7 @@ _descriptor.MethodDescriptor( name='getCurrentQuorumsInfo', full_name='org.dash.platform.dapi.v0.Platform.getCurrentQuorumsInfo', - index=31, + index=30, containing_service=None, input_type=_GETCURRENTQUORUMSINFOREQUEST, output_type=_GETCURRENTQUORUMSINFORESPONSE, @@ -16181,7 +15450,7 @@ _descriptor.MethodDescriptor( name='getIdentityTokenBalances', full_name='org.dash.platform.dapi.v0.Platform.getIdentityTokenBalances', - index=32, + index=31, containing_service=None, input_type=_GETIDENTITYTOKENBALANCESREQUEST, output_type=_GETIDENTITYTOKENBALANCESRESPONSE, @@ -16191,7 +15460,7 @@ _descriptor.MethodDescriptor( name='getIdentitiesTokenBalances', full_name='org.dash.platform.dapi.v0.Platform.getIdentitiesTokenBalances', - index=33, + index=32, containing_service=None, input_type=_GETIDENTITIESTOKENBALANCESREQUEST, output_type=_GETIDENTITIESTOKENBALANCESRESPONSE, @@ -16201,7 +15470,7 @@ _descriptor.MethodDescriptor( name='getIdentityTokenInfos', full_name='org.dash.platform.dapi.v0.Platform.getIdentityTokenInfos', - index=34, + index=33, containing_service=None, input_type=_GETIDENTITYTOKENINFOSREQUEST, output_type=_GETIDENTITYTOKENINFOSRESPONSE, @@ -16211,7 +15480,7 @@ _descriptor.MethodDescriptor( name='getIdentitiesTokenInfos', full_name='org.dash.platform.dapi.v0.Platform.getIdentitiesTokenInfos', - index=35, + index=34, containing_service=None, input_type=_GETIDENTITIESTOKENINFOSREQUEST, output_type=_GETIDENTITIESTOKENINFOSRESPONSE, @@ -16221,7 +15490,7 @@ _descriptor.MethodDescriptor( name='getTokenStatuses', full_name='org.dash.platform.dapi.v0.Platform.getTokenStatuses', - index=36, + index=35, containing_service=None, input_type=_GETTOKENSTATUSESREQUEST, output_type=_GETTOKENSTATUSESRESPONSE, @@ -16231,7 +15500,7 @@ _descriptor.MethodDescriptor( name='getTokenPreProgrammedDistributions', full_name='org.dash.platform.dapi.v0.Platform.getTokenPreProgrammedDistributions', - index=37, + index=36, containing_service=None, input_type=_GETTOKENPREPROGRAMMEDDISTRIBUTIONSREQUEST, output_type=_GETTOKENPREPROGRAMMEDDISTRIBUTIONSRESPONSE, @@ -16241,7 +15510,7 @@ _descriptor.MethodDescriptor( name='getTokenTotalSupply', full_name='org.dash.platform.dapi.v0.Platform.getTokenTotalSupply', - index=38, + index=37, containing_service=None, input_type=_GETTOKENTOTALSUPPLYREQUEST, output_type=_GETTOKENTOTALSUPPLYRESPONSE, @@ -16251,7 +15520,7 @@ _descriptor.MethodDescriptor( name='getGroupInfo', full_name='org.dash.platform.dapi.v0.Platform.getGroupInfo', - index=39, + index=38, containing_service=None, input_type=_GETGROUPINFOREQUEST, output_type=_GETGROUPINFORESPONSE, @@ -16261,7 +15530,7 @@ _descriptor.MethodDescriptor( name='getGroupInfos', full_name='org.dash.platform.dapi.v0.Platform.getGroupInfos', - index=40, + index=39, containing_service=None, input_type=_GETGROUPINFOSREQUEST, output_type=_GETGROUPINFOSRESPONSE, @@ -16271,7 +15540,7 @@ _descriptor.MethodDescriptor( name='getGroupActions', full_name='org.dash.platform.dapi.v0.Platform.getGroupActions', - index=41, + index=40, containing_service=None, input_type=_GETGROUPACTIONSREQUEST, output_type=_GETGROUPACTIONSRESPONSE, @@ -16281,7 +15550,7 @@ _descriptor.MethodDescriptor( name='getGroupActionSigners', full_name='org.dash.platform.dapi.v0.Platform.getGroupActionSigners', - index=42, + index=41, containing_service=None, input_type=_GETGROUPACTIONSIGNERSREQUEST, output_type=_GETGROUPACTIONSIGNERSRESPONSE, diff --git a/packages/dapi-grpc/clients/platform/v0/python/platform_pb2_grpc.py b/packages/dapi-grpc/clients/platform/v0/python/platform_pb2_grpc.py index 7b730ee7d22..369acee80e2 100644 --- a/packages/dapi-grpc/clients/platform/v0/python/platform_pb2_grpc.py +++ b/packages/dapi-grpc/clients/platform/v0/python/platform_pb2_grpc.py @@ -69,11 +69,6 @@ def __init__(self, channel): request_serializer=platform__pb2.GetEvonodesProposedEpochBlocksByRangeRequest.SerializeToString, response_deserializer=platform__pb2.GetEvonodesProposedEpochBlocksResponse.FromString, ) - self.getProofs = channel.unary_unary( - '/org.dash.platform.dapi.v0.Platform/getProofs', - request_serializer=platform__pb2.GetProofsRequest.SerializeToString, - response_deserializer=platform__pb2.GetProofsResponse.FromString, - ) self.getDataContract = channel.unary_unary( '/org.dash.platform.dapi.v0.Platform/getDataContract', request_serializer=platform__pb2.GetDataContractRequest.SerializeToString, @@ -300,12 +295,6 @@ def getEvonodesProposedEpochBlocksByRange(self, request, context): context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') - def getProofs(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - def getDataContract(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) @@ -555,11 +544,6 @@ def add_PlatformServicer_to_server(servicer, server): request_deserializer=platform__pb2.GetEvonodesProposedEpochBlocksByRangeRequest.FromString, response_serializer=platform__pb2.GetEvonodesProposedEpochBlocksResponse.SerializeToString, ), - 'getProofs': grpc.unary_unary_rpc_method_handler( - servicer.getProofs, - request_deserializer=platform__pb2.GetProofsRequest.FromString, - response_serializer=platform__pb2.GetProofsResponse.SerializeToString, - ), 'getDataContract': grpc.unary_unary_rpc_method_handler( servicer.getDataContract, request_deserializer=platform__pb2.GetDataContractRequest.FromString, @@ -912,23 +896,6 @@ def getEvonodesProposedEpochBlocksByRange(request, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - @staticmethod - def getProofs(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/org.dash.platform.dapi.v0.Platform/getProofs', - platform__pb2.GetProofsRequest.SerializeToString, - platform__pb2.GetProofsResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - @staticmethod def getDataContract(request, target, diff --git a/packages/dapi-grpc/clients/platform/v0/web/platform_pb.d.ts b/packages/dapi-grpc/clients/platform/v0/web/platform_pb.d.ts index cccf8127174..a58c81f9e17 100644 --- a/packages/dapi-grpc/clients/platform/v0/web/platform_pb.d.ts +++ b/packages/dapi-grpc/clients/platform/v0/web/platform_pb.d.ts @@ -1757,409 +1757,6 @@ export namespace GetIdentitiesBalancesResponse { } } -export class GetProofsRequest extends jspb.Message { - hasV0(): boolean; - clearV0(): void; - getV0(): GetProofsRequest.GetProofsRequestV0 | undefined; - setV0(value?: GetProofsRequest.GetProofsRequestV0): void; - - getVersionCase(): GetProofsRequest.VersionCase; - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): GetProofsRequest.AsObject; - static toObject(includeInstance: boolean, msg: GetProofsRequest): GetProofsRequest.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: GetProofsRequest, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): GetProofsRequest; - static deserializeBinaryFromReader(message: GetProofsRequest, reader: jspb.BinaryReader): GetProofsRequest; -} - -export namespace GetProofsRequest { - export type AsObject = { - v0?: GetProofsRequest.GetProofsRequestV0.AsObject, - } - - export class GetProofsRequestV0 extends jspb.Message { - clearIdentitiesList(): void; - getIdentitiesList(): Array; - setIdentitiesList(value: Array): void; - addIdentities(value?: GetProofsRequest.GetProofsRequestV0.IdentityRequest, index?: number): GetProofsRequest.GetProofsRequestV0.IdentityRequest; - - clearContractsList(): void; - getContractsList(): Array; - setContractsList(value: Array): void; - addContracts(value?: GetProofsRequest.GetProofsRequestV0.ContractRequest, index?: number): GetProofsRequest.GetProofsRequestV0.ContractRequest; - - clearDocumentsList(): void; - getDocumentsList(): Array; - setDocumentsList(value: Array): void; - addDocuments(value?: GetProofsRequest.GetProofsRequestV0.DocumentRequest, index?: number): GetProofsRequest.GetProofsRequestV0.DocumentRequest; - - clearVotesList(): void; - getVotesList(): Array; - setVotesList(value: Array): void; - addVotes(value?: GetProofsRequest.GetProofsRequestV0.VoteStatusRequest, index?: number): GetProofsRequest.GetProofsRequestV0.VoteStatusRequest; - - clearIdentityTokenBalancesList(): void; - getIdentityTokenBalancesList(): Array; - setIdentityTokenBalancesList(value: Array): void; - addIdentityTokenBalances(value?: GetProofsRequest.GetProofsRequestV0.IdentityTokenBalanceRequest, index?: number): GetProofsRequest.GetProofsRequestV0.IdentityTokenBalanceRequest; - - clearIdentityTokenInfosList(): void; - getIdentityTokenInfosList(): Array; - setIdentityTokenInfosList(value: Array): void; - addIdentityTokenInfos(value?: GetProofsRequest.GetProofsRequestV0.IdentityTokenInfoRequest, index?: number): GetProofsRequest.GetProofsRequestV0.IdentityTokenInfoRequest; - - clearTokenStatusesList(): void; - getTokenStatusesList(): Array; - setTokenStatusesList(value: Array): void; - addTokenStatuses(value?: GetProofsRequest.GetProofsRequestV0.TokenStatusRequest, index?: number): GetProofsRequest.GetProofsRequestV0.TokenStatusRequest; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): GetProofsRequestV0.AsObject; - static toObject(includeInstance: boolean, msg: GetProofsRequestV0): GetProofsRequestV0.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: GetProofsRequestV0, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): GetProofsRequestV0; - static deserializeBinaryFromReader(message: GetProofsRequestV0, reader: jspb.BinaryReader): GetProofsRequestV0; - } - - export namespace GetProofsRequestV0 { - export type AsObject = { - identitiesList: Array, - contractsList: Array, - documentsList: Array, - votesList: Array, - identityTokenBalancesList: Array, - identityTokenInfosList: Array, - tokenStatusesList: Array, - } - - export class DocumentRequest extends jspb.Message { - getContractId(): Uint8Array | string; - getContractId_asU8(): Uint8Array; - getContractId_asB64(): string; - setContractId(value: Uint8Array | string): void; - - getDocumentType(): string; - setDocumentType(value: string): void; - - getDocumentTypeKeepsHistory(): boolean; - setDocumentTypeKeepsHistory(value: boolean): void; - - getDocumentId(): Uint8Array | string; - getDocumentId_asU8(): Uint8Array; - getDocumentId_asB64(): string; - setDocumentId(value: Uint8Array | string): void; - - getDocumentContestedStatus(): GetProofsRequest.GetProofsRequestV0.DocumentRequest.DocumentContestedStatusMap[keyof GetProofsRequest.GetProofsRequestV0.DocumentRequest.DocumentContestedStatusMap]; - setDocumentContestedStatus(value: GetProofsRequest.GetProofsRequestV0.DocumentRequest.DocumentContestedStatusMap[keyof GetProofsRequest.GetProofsRequestV0.DocumentRequest.DocumentContestedStatusMap]): void; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): DocumentRequest.AsObject; - static toObject(includeInstance: boolean, msg: DocumentRequest): DocumentRequest.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: DocumentRequest, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): DocumentRequest; - static deserializeBinaryFromReader(message: DocumentRequest, reader: jspb.BinaryReader): DocumentRequest; - } - - export namespace DocumentRequest { - export type AsObject = { - contractId: Uint8Array | string, - documentType: string, - documentTypeKeepsHistory: boolean, - documentId: Uint8Array | string, - documentContestedStatus: GetProofsRequest.GetProofsRequestV0.DocumentRequest.DocumentContestedStatusMap[keyof GetProofsRequest.GetProofsRequestV0.DocumentRequest.DocumentContestedStatusMap], - } - - export interface DocumentContestedStatusMap { - NOT_CONTESTED: 0; - MAYBE_CONTESTED: 1; - CONTESTED: 2; - } - - export const DocumentContestedStatus: DocumentContestedStatusMap; - } - - export class IdentityRequest extends jspb.Message { - getIdentityId(): Uint8Array | string; - getIdentityId_asU8(): Uint8Array; - getIdentityId_asB64(): string; - setIdentityId(value: Uint8Array | string): void; - - getRequestType(): GetProofsRequest.GetProofsRequestV0.IdentityRequest.TypeMap[keyof GetProofsRequest.GetProofsRequestV0.IdentityRequest.TypeMap]; - setRequestType(value: GetProofsRequest.GetProofsRequestV0.IdentityRequest.TypeMap[keyof GetProofsRequest.GetProofsRequestV0.IdentityRequest.TypeMap]): void; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): IdentityRequest.AsObject; - static toObject(includeInstance: boolean, msg: IdentityRequest): IdentityRequest.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: IdentityRequest, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): IdentityRequest; - static deserializeBinaryFromReader(message: IdentityRequest, reader: jspb.BinaryReader): IdentityRequest; - } - - export namespace IdentityRequest { - export type AsObject = { - identityId: Uint8Array | string, - requestType: GetProofsRequest.GetProofsRequestV0.IdentityRequest.TypeMap[keyof GetProofsRequest.GetProofsRequestV0.IdentityRequest.TypeMap], - } - - export interface TypeMap { - FULL_IDENTITY: 0; - BALANCE: 1; - KEYS: 2; - REVISION: 3; - } - - export const Type: TypeMap; - } - - export class ContractRequest extends jspb.Message { - getContractId(): Uint8Array | string; - getContractId_asU8(): Uint8Array; - getContractId_asB64(): string; - setContractId(value: Uint8Array | string): void; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): ContractRequest.AsObject; - static toObject(includeInstance: boolean, msg: ContractRequest): ContractRequest.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: ContractRequest, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): ContractRequest; - static deserializeBinaryFromReader(message: ContractRequest, reader: jspb.BinaryReader): ContractRequest; - } - - export namespace ContractRequest { - export type AsObject = { - contractId: Uint8Array | string, - } - } - - export class VoteStatusRequest extends jspb.Message { - hasContestedResourceVoteStatusRequest(): boolean; - clearContestedResourceVoteStatusRequest(): void; - getContestedResourceVoteStatusRequest(): GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest | undefined; - setContestedResourceVoteStatusRequest(value?: GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest): void; - - getRequestTypeCase(): VoteStatusRequest.RequestTypeCase; - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): VoteStatusRequest.AsObject; - static toObject(includeInstance: boolean, msg: VoteStatusRequest): VoteStatusRequest.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: VoteStatusRequest, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): VoteStatusRequest; - static deserializeBinaryFromReader(message: VoteStatusRequest, reader: jspb.BinaryReader): VoteStatusRequest; - } - - export namespace VoteStatusRequest { - export type AsObject = { - contestedResourceVoteStatusRequest?: GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest.AsObject, - } - - export class ContestedResourceVoteStatusRequest extends jspb.Message { - getContractId(): Uint8Array | string; - getContractId_asU8(): Uint8Array; - getContractId_asB64(): string; - setContractId(value: Uint8Array | string): void; - - getDocumentTypeName(): string; - setDocumentTypeName(value: string): void; - - getIndexName(): string; - setIndexName(value: string): void; - - clearIndexValuesList(): void; - getIndexValuesList(): Array; - getIndexValuesList_asU8(): Array; - getIndexValuesList_asB64(): Array; - setIndexValuesList(value: Array): void; - addIndexValues(value: Uint8Array | string, index?: number): Uint8Array | string; - - getVoterIdentifier(): Uint8Array | string; - getVoterIdentifier_asU8(): Uint8Array; - getVoterIdentifier_asB64(): string; - setVoterIdentifier(value: Uint8Array | string): void; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): ContestedResourceVoteStatusRequest.AsObject; - static toObject(includeInstance: boolean, msg: ContestedResourceVoteStatusRequest): ContestedResourceVoteStatusRequest.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: ContestedResourceVoteStatusRequest, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): ContestedResourceVoteStatusRequest; - static deserializeBinaryFromReader(message: ContestedResourceVoteStatusRequest, reader: jspb.BinaryReader): ContestedResourceVoteStatusRequest; - } - - export namespace ContestedResourceVoteStatusRequest { - export type AsObject = { - contractId: Uint8Array | string, - documentTypeName: string, - indexName: string, - indexValuesList: Array, - voterIdentifier: Uint8Array | string, - } - } - - export enum RequestTypeCase { - REQUEST_TYPE_NOT_SET = 0, - CONTESTED_RESOURCE_VOTE_STATUS_REQUEST = 1, - } - } - - export class IdentityTokenBalanceRequest extends jspb.Message { - getTokenId(): Uint8Array | string; - getTokenId_asU8(): Uint8Array; - getTokenId_asB64(): string; - setTokenId(value: Uint8Array | string): void; - - getIdentityId(): Uint8Array | string; - getIdentityId_asU8(): Uint8Array; - getIdentityId_asB64(): string; - setIdentityId(value: Uint8Array | string): void; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): IdentityTokenBalanceRequest.AsObject; - static toObject(includeInstance: boolean, msg: IdentityTokenBalanceRequest): IdentityTokenBalanceRequest.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: IdentityTokenBalanceRequest, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): IdentityTokenBalanceRequest; - static deserializeBinaryFromReader(message: IdentityTokenBalanceRequest, reader: jspb.BinaryReader): IdentityTokenBalanceRequest; - } - - export namespace IdentityTokenBalanceRequest { - export type AsObject = { - tokenId: Uint8Array | string, - identityId: Uint8Array | string, - } - } - - export class IdentityTokenInfoRequest extends jspb.Message { - getTokenId(): Uint8Array | string; - getTokenId_asU8(): Uint8Array; - getTokenId_asB64(): string; - setTokenId(value: Uint8Array | string): void; - - getIdentityId(): Uint8Array | string; - getIdentityId_asU8(): Uint8Array; - getIdentityId_asB64(): string; - setIdentityId(value: Uint8Array | string): void; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): IdentityTokenInfoRequest.AsObject; - static toObject(includeInstance: boolean, msg: IdentityTokenInfoRequest): IdentityTokenInfoRequest.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: IdentityTokenInfoRequest, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): IdentityTokenInfoRequest; - static deserializeBinaryFromReader(message: IdentityTokenInfoRequest, reader: jspb.BinaryReader): IdentityTokenInfoRequest; - } - - export namespace IdentityTokenInfoRequest { - export type AsObject = { - tokenId: Uint8Array | string, - identityId: Uint8Array | string, - } - } - - export class TokenStatusRequest extends jspb.Message { - getTokenId(): Uint8Array | string; - getTokenId_asU8(): Uint8Array; - getTokenId_asB64(): string; - setTokenId(value: Uint8Array | string): void; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): TokenStatusRequest.AsObject; - static toObject(includeInstance: boolean, msg: TokenStatusRequest): TokenStatusRequest.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: TokenStatusRequest, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): TokenStatusRequest; - static deserializeBinaryFromReader(message: TokenStatusRequest, reader: jspb.BinaryReader): TokenStatusRequest; - } - - export namespace TokenStatusRequest { - export type AsObject = { - tokenId: Uint8Array | string, - } - } - } - - export enum VersionCase { - VERSION_NOT_SET = 0, - V0 = 1, - } -} - -export class GetProofsResponse extends jspb.Message { - hasV0(): boolean; - clearV0(): void; - getV0(): GetProofsResponse.GetProofsResponseV0 | undefined; - setV0(value?: GetProofsResponse.GetProofsResponseV0): void; - - getVersionCase(): GetProofsResponse.VersionCase; - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): GetProofsResponse.AsObject; - static toObject(includeInstance: boolean, msg: GetProofsResponse): GetProofsResponse.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: GetProofsResponse, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): GetProofsResponse; - static deserializeBinaryFromReader(message: GetProofsResponse, reader: jspb.BinaryReader): GetProofsResponse; -} - -export namespace GetProofsResponse { - export type AsObject = { - v0?: GetProofsResponse.GetProofsResponseV0.AsObject, - } - - export class GetProofsResponseV0 extends jspb.Message { - hasProof(): boolean; - clearProof(): void; - getProof(): Proof | undefined; - setProof(value?: Proof): void; - - hasMetadata(): boolean; - clearMetadata(): void; - getMetadata(): ResponseMetadata | undefined; - setMetadata(value?: ResponseMetadata): void; - - getResultCase(): GetProofsResponseV0.ResultCase; - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): GetProofsResponseV0.AsObject; - static toObject(includeInstance: boolean, msg: GetProofsResponseV0): GetProofsResponseV0.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: GetProofsResponseV0, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): GetProofsResponseV0; - static deserializeBinaryFromReader(message: GetProofsResponseV0, reader: jspb.BinaryReader): GetProofsResponseV0; - } - - export namespace GetProofsResponseV0 { - export type AsObject = { - proof?: Proof.AsObject, - metadata?: ResponseMetadata.AsObject, - } - - export enum ResultCase { - RESULT_NOT_SET = 0, - PROOF = 1, - } - } - - export enum VersionCase { - VERSION_NOT_SET = 0, - V0 = 1, - } -} - export class GetDataContractRequest extends jspb.Message { hasV0(): boolean; clearV0(): void; diff --git a/packages/dapi-grpc/clients/platform/v0/web/platform_pb.js b/packages/dapi-grpc/clients/platform/v0/web/platform_pb.js index db423372350..dacdc9f126d 100644 --- a/packages/dapi-grpc/clients/platform/v0/web/platform_pb.js +++ b/packages/dapi-grpc/clients/platform/v0/web/platform_pb.js @@ -324,24 +324,6 @@ goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanc goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0', null, { proto }); goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0.ResultCase', null, { proto }); goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.VersionCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetProofsRequest', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.ContractRequest', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest.DocumentContestedStatus', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityRequest', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityRequest.Type', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenBalanceRequest', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenInfoRequest', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.TokenStatusRequest', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.RequestTypeCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetProofsRequest.VersionCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetProofsResponse', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0.ResultCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetProofsResponse.VersionCase', null, { proto }); goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest', null, { proto }); goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0', null, { proto }); goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.VersionCase', null, { proto }); @@ -1636,258 +1618,6 @@ if (goog.DEBUG && !COMPILED) { */ proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances.displayName = 'proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances'; } -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, proto.org.dash.platform.dapi.v0.GetProofsRequest.oneofGroups_); -}; -goog.inherits(proto.org.dash.platform.dapi.v0.GetProofsRequest, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.org.dash.platform.dapi.v0.GetProofsRequest.displayName = 'proto.org.dash.platform.dapi.v0.GetProofsRequest'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0 = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.repeatedFields_, null); -}; -goog.inherits(proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.displayName = 'proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest.displayName = 'proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityRequest = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityRequest, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityRequest.displayName = 'proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityRequest'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.ContractRequest = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.ContractRequest, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.ContractRequest.displayName = 'proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.ContractRequest'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.oneofGroups_); -}; -goog.inherits(proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.displayName = 'proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest.repeatedFields_, null); -}; -goog.inherits(proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest.displayName = 'proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenBalanceRequest = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenBalanceRequest, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenBalanceRequest.displayName = 'proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenBalanceRequest'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenInfoRequest = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenInfoRequest, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenInfoRequest.displayName = 'proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenInfoRequest'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.TokenStatusRequest = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.TokenStatusRequest, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.TokenStatusRequest.displayName = 'proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.TokenStatusRequest'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.org.dash.platform.dapi.v0.GetProofsResponse = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, proto.org.dash.platform.dapi.v0.GetProofsResponse.oneofGroups_); -}; -goog.inherits(proto.org.dash.platform.dapi.v0.GetProofsResponse, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.org.dash.platform.dapi.v0.GetProofsResponse.displayName = 'proto.org.dash.platform.dapi.v0.GetProofsResponse'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0 = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, proto.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0.oneofGroups_); -}; -goog.inherits(proto.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0.displayName = 'proto.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0'; -} /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a @@ -18272,2812 +18002,6 @@ proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.prototype.hasV0 = -/** - * Oneof group definitions for this message. Each group defines the field - * numbers belonging to that group. When of these fields' value is set, all - * other fields in the group are cleared. During deserialization, if multiple - * fields are encountered for a group, only the last value seen will be kept. - * @private {!Array>} - * @const - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.oneofGroups_ = [[1]]; - -/** - * @enum {number} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.VersionCase = { - VERSION_NOT_SET: 0, - V0: 1 -}; - -/** - * @return {proto.org.dash.platform.dapi.v0.GetProofsRequest.VersionCase} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.prototype.getVersionCase = function() { - return /** @type {proto.org.dash.platform.dapi.v0.GetProofsRequest.VersionCase} */(jspb.Message.computeOneofCase(this, proto.org.dash.platform.dapi.v0.GetProofsRequest.oneofGroups_[0])); -}; - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.prototype.toObject = function(opt_includeInstance) { - return proto.org.dash.platform.dapi.v0.GetProofsRequest.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.org.dash.platform.dapi.v0.GetProofsRequest} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.toObject = function(includeInstance, msg) { - var f, obj = { - v0: (f = msg.getV0()) && proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.toObject(includeInstance, f) - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.org.dash.platform.dapi.v0.GetProofsRequest} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.org.dash.platform.dapi.v0.GetProofsRequest; - return proto.org.dash.platform.dapi.v0.GetProofsRequest.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.org.dash.platform.dapi.v0.GetProofsRequest} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.org.dash.platform.dapi.v0.GetProofsRequest} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = new proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0; - reader.readMessage(value,proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.deserializeBinaryFromReader); - msg.setV0(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.org.dash.platform.dapi.v0.GetProofsRequest.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.org.dash.platform.dapi.v0.GetProofsRequest} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getV0(); - if (f != null) { - writer.writeMessage( - 1, - f, - proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.serializeBinaryToWriter - ); - } -}; - - - -/** - * List of repeated fields within this message type. - * @private {!Array} - * @const - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.repeatedFields_ = [1,2,3,4,5,6,7]; - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.prototype.toObject = function(opt_includeInstance) { - return proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.toObject = function(includeInstance, msg) { - var f, obj = { - identitiesList: jspb.Message.toObjectList(msg.getIdentitiesList(), - proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityRequest.toObject, includeInstance), - contractsList: jspb.Message.toObjectList(msg.getContractsList(), - proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.ContractRequest.toObject, includeInstance), - documentsList: jspb.Message.toObjectList(msg.getDocumentsList(), - proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest.toObject, includeInstance), - votesList: jspb.Message.toObjectList(msg.getVotesList(), - proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.toObject, includeInstance), - identityTokenBalancesList: jspb.Message.toObjectList(msg.getIdentityTokenBalancesList(), - proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenBalanceRequest.toObject, includeInstance), - identityTokenInfosList: jspb.Message.toObjectList(msg.getIdentityTokenInfosList(), - proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenInfoRequest.toObject, includeInstance), - tokenStatusesList: jspb.Message.toObjectList(msg.getTokenStatusesList(), - proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.TokenStatusRequest.toObject, includeInstance) - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0; - return proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = new proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityRequest; - reader.readMessage(value,proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityRequest.deserializeBinaryFromReader); - msg.addIdentities(value); - break; - case 2: - var value = new proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.ContractRequest; - reader.readMessage(value,proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.ContractRequest.deserializeBinaryFromReader); - msg.addContracts(value); - break; - case 3: - var value = new proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest; - reader.readMessage(value,proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest.deserializeBinaryFromReader); - msg.addDocuments(value); - break; - case 4: - var value = new proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest; - reader.readMessage(value,proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.deserializeBinaryFromReader); - msg.addVotes(value); - break; - case 5: - var value = new proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenBalanceRequest; - reader.readMessage(value,proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenBalanceRequest.deserializeBinaryFromReader); - msg.addIdentityTokenBalances(value); - break; - case 6: - var value = new proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenInfoRequest; - reader.readMessage(value,proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenInfoRequest.deserializeBinaryFromReader); - msg.addIdentityTokenInfos(value); - break; - case 7: - var value = new proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.TokenStatusRequest; - reader.readMessage(value,proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.TokenStatusRequest.deserializeBinaryFromReader); - msg.addTokenStatuses(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getIdentitiesList(); - if (f.length > 0) { - writer.writeRepeatedMessage( - 1, - f, - proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityRequest.serializeBinaryToWriter - ); - } - f = message.getContractsList(); - if (f.length > 0) { - writer.writeRepeatedMessage( - 2, - f, - proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.ContractRequest.serializeBinaryToWriter - ); - } - f = message.getDocumentsList(); - if (f.length > 0) { - writer.writeRepeatedMessage( - 3, - f, - proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest.serializeBinaryToWriter - ); - } - f = message.getVotesList(); - if (f.length > 0) { - writer.writeRepeatedMessage( - 4, - f, - proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.serializeBinaryToWriter - ); - } - f = message.getIdentityTokenBalancesList(); - if (f.length > 0) { - writer.writeRepeatedMessage( - 5, - f, - proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenBalanceRequest.serializeBinaryToWriter - ); - } - f = message.getIdentityTokenInfosList(); - if (f.length > 0) { - writer.writeRepeatedMessage( - 6, - f, - proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenInfoRequest.serializeBinaryToWriter - ); - } - f = message.getTokenStatusesList(); - if (f.length > 0) { - writer.writeRepeatedMessage( - 7, - f, - proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.TokenStatusRequest.serializeBinaryToWriter - ); - } -}; - - - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest.prototype.toObject = function(opt_includeInstance) { - return proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest.toObject = function(includeInstance, msg) { - var f, obj = { - contractId: msg.getContractId_asB64(), - documentType: jspb.Message.getFieldWithDefault(msg, 2, ""), - documentTypeKeepsHistory: jspb.Message.getBooleanFieldWithDefault(msg, 3, false), - documentId: msg.getDocumentId_asB64(), - documentContestedStatus: jspb.Message.getFieldWithDefault(msg, 5, 0) - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest; - return proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.setContractId(value); - break; - case 2: - var value = /** @type {string} */ (reader.readString()); - msg.setDocumentType(value); - break; - case 3: - var value = /** @type {boolean} */ (reader.readBool()); - msg.setDocumentTypeKeepsHistory(value); - break; - case 4: - var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.setDocumentId(value); - break; - case 5: - var value = /** @type {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest.DocumentContestedStatus} */ (reader.readEnum()); - msg.setDocumentContestedStatus(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getContractId_asU8(); - if (f.length > 0) { - writer.writeBytes( - 1, - f - ); - } - f = message.getDocumentType(); - if (f.length > 0) { - writer.writeString( - 2, - f - ); - } - f = message.getDocumentTypeKeepsHistory(); - if (f) { - writer.writeBool( - 3, - f - ); - } - f = message.getDocumentId_asU8(); - if (f.length > 0) { - writer.writeBytes( - 4, - f - ); - } - f = message.getDocumentContestedStatus(); - if (f !== 0.0) { - writer.writeEnum( - 5, - f - ); - } -}; - - -/** - * @enum {number} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest.DocumentContestedStatus = { - NOT_CONTESTED: 0, - MAYBE_CONTESTED: 1, - CONTESTED: 2 -}; - -/** - * optional bytes contract_id = 1; - * @return {string} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest.prototype.getContractId = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * optional bytes contract_id = 1; - * This is a type-conversion wrapper around `getContractId()` - * @return {string} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest.prototype.getContractId_asB64 = function() { - return /** @type {string} */ (jspb.Message.bytesAsB64( - this.getContractId())); -}; - - -/** - * optional bytes contract_id = 1; - * Note that Uint8Array is not supported on all browsers. - * @see http://caniuse.com/Uint8Array - * This is a type-conversion wrapper around `getContractId()` - * @return {!Uint8Array} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest.prototype.getContractId_asU8 = function() { - return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( - this.getContractId())); -}; - - -/** - * @param {!(string|Uint8Array)} value - * @return {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest} returns this - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest.prototype.setContractId = function(value) { - return jspb.Message.setProto3BytesField(this, 1, value); -}; - - -/** - * optional string document_type = 2; - * @return {string} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest.prototype.getDocumentType = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); -}; - - -/** - * @param {string} value - * @return {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest} returns this - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest.prototype.setDocumentType = function(value) { - return jspb.Message.setProto3StringField(this, 2, value); -}; - - -/** - * optional bool document_type_keeps_history = 3; - * @return {boolean} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest.prototype.getDocumentTypeKeepsHistory = function() { - return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 3, false)); -}; - - -/** - * @param {boolean} value - * @return {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest} returns this - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest.prototype.setDocumentTypeKeepsHistory = function(value) { - return jspb.Message.setProto3BooleanField(this, 3, value); -}; - - -/** - * optional bytes document_id = 4; - * @return {string} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest.prototype.getDocumentId = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")); -}; - - -/** - * optional bytes document_id = 4; - * This is a type-conversion wrapper around `getDocumentId()` - * @return {string} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest.prototype.getDocumentId_asB64 = function() { - return /** @type {string} */ (jspb.Message.bytesAsB64( - this.getDocumentId())); -}; - - -/** - * optional bytes document_id = 4; - * Note that Uint8Array is not supported on all browsers. - * @see http://caniuse.com/Uint8Array - * This is a type-conversion wrapper around `getDocumentId()` - * @return {!Uint8Array} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest.prototype.getDocumentId_asU8 = function() { - return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( - this.getDocumentId())); -}; - - -/** - * @param {!(string|Uint8Array)} value - * @return {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest} returns this - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest.prototype.setDocumentId = function(value) { - return jspb.Message.setProto3BytesField(this, 4, value); -}; - - -/** - * optional DocumentContestedStatus document_contested_status = 5; - * @return {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest.DocumentContestedStatus} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest.prototype.getDocumentContestedStatus = function() { - return /** @type {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest.DocumentContestedStatus} */ (jspb.Message.getFieldWithDefault(this, 5, 0)); -}; - - -/** - * @param {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest.DocumentContestedStatus} value - * @return {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest} returns this - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest.prototype.setDocumentContestedStatus = function(value) { - return jspb.Message.setProto3EnumField(this, 5, value); -}; - - - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityRequest.prototype.toObject = function(opt_includeInstance) { - return proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityRequest.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityRequest} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityRequest.toObject = function(includeInstance, msg) { - var f, obj = { - identityId: msg.getIdentityId_asB64(), - requestType: jspb.Message.getFieldWithDefault(msg, 2, 0) - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityRequest} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityRequest.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityRequest; - return proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityRequest.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityRequest} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityRequest} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityRequest.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.setIdentityId(value); - break; - case 2: - var value = /** @type {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityRequest.Type} */ (reader.readEnum()); - msg.setRequestType(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityRequest.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityRequest.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityRequest} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityRequest.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getIdentityId_asU8(); - if (f.length > 0) { - writer.writeBytes( - 1, - f - ); - } - f = message.getRequestType(); - if (f !== 0.0) { - writer.writeEnum( - 2, - f - ); - } -}; - - -/** - * @enum {number} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityRequest.Type = { - FULL_IDENTITY: 0, - BALANCE: 1, - KEYS: 2, - REVISION: 3 -}; - -/** - * optional bytes identity_id = 1; - * @return {string} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityRequest.prototype.getIdentityId = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * optional bytes identity_id = 1; - * This is a type-conversion wrapper around `getIdentityId()` - * @return {string} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityRequest.prototype.getIdentityId_asB64 = function() { - return /** @type {string} */ (jspb.Message.bytesAsB64( - this.getIdentityId())); -}; - - -/** - * optional bytes identity_id = 1; - * Note that Uint8Array is not supported on all browsers. - * @see http://caniuse.com/Uint8Array - * This is a type-conversion wrapper around `getIdentityId()` - * @return {!Uint8Array} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityRequest.prototype.getIdentityId_asU8 = function() { - return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( - this.getIdentityId())); -}; - - -/** - * @param {!(string|Uint8Array)} value - * @return {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityRequest} returns this - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityRequest.prototype.setIdentityId = function(value) { - return jspb.Message.setProto3BytesField(this, 1, value); -}; - - -/** - * optional Type request_type = 2; - * @return {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityRequest.Type} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityRequest.prototype.getRequestType = function() { - return /** @type {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityRequest.Type} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); -}; - - -/** - * @param {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityRequest.Type} value - * @return {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityRequest} returns this - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityRequest.prototype.setRequestType = function(value) { - return jspb.Message.setProto3EnumField(this, 2, value); -}; - - - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.ContractRequest.prototype.toObject = function(opt_includeInstance) { - return proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.ContractRequest.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.ContractRequest} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.ContractRequest.toObject = function(includeInstance, msg) { - var f, obj = { - contractId: msg.getContractId_asB64() - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.ContractRequest} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.ContractRequest.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.ContractRequest; - return proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.ContractRequest.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.ContractRequest} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.ContractRequest} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.ContractRequest.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.setContractId(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.ContractRequest.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.ContractRequest.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.ContractRequest} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.ContractRequest.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getContractId_asU8(); - if (f.length > 0) { - writer.writeBytes( - 1, - f - ); - } -}; - - -/** - * optional bytes contract_id = 1; - * @return {string} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.ContractRequest.prototype.getContractId = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * optional bytes contract_id = 1; - * This is a type-conversion wrapper around `getContractId()` - * @return {string} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.ContractRequest.prototype.getContractId_asB64 = function() { - return /** @type {string} */ (jspb.Message.bytesAsB64( - this.getContractId())); -}; - - -/** - * optional bytes contract_id = 1; - * Note that Uint8Array is not supported on all browsers. - * @see http://caniuse.com/Uint8Array - * This is a type-conversion wrapper around `getContractId()` - * @return {!Uint8Array} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.ContractRequest.prototype.getContractId_asU8 = function() { - return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( - this.getContractId())); -}; - - -/** - * @param {!(string|Uint8Array)} value - * @return {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.ContractRequest} returns this - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.ContractRequest.prototype.setContractId = function(value) { - return jspb.Message.setProto3BytesField(this, 1, value); -}; - - - -/** - * Oneof group definitions for this message. Each group defines the field - * numbers belonging to that group. When of these fields' value is set, all - * other fields in the group are cleared. During deserialization, if multiple - * fields are encountered for a group, only the last value seen will be kept. - * @private {!Array>} - * @const - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.oneofGroups_ = [[1]]; - -/** - * @enum {number} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.RequestTypeCase = { - REQUEST_TYPE_NOT_SET: 0, - CONTESTED_RESOURCE_VOTE_STATUS_REQUEST: 1 -}; - -/** - * @return {proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.RequestTypeCase} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.prototype.getRequestTypeCase = function() { - return /** @type {proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.RequestTypeCase} */(jspb.Message.computeOneofCase(this, proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.oneofGroups_[0])); -}; - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.prototype.toObject = function(opt_includeInstance) { - return proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.toObject = function(includeInstance, msg) { - var f, obj = { - contestedResourceVoteStatusRequest: (f = msg.getContestedResourceVoteStatusRequest()) && proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest.toObject(includeInstance, f) - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest; - return proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = new proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest; - reader.readMessage(value,proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest.deserializeBinaryFromReader); - msg.setContestedResourceVoteStatusRequest(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getContestedResourceVoteStatusRequest(); - if (f != null) { - writer.writeMessage( - 1, - f, - proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest.serializeBinaryToWriter - ); - } -}; - - - -/** - * List of repeated fields within this message type. - * @private {!Array} - * @const - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest.repeatedFields_ = [4]; - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest.prototype.toObject = function(opt_includeInstance) { - return proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest.toObject = function(includeInstance, msg) { - var f, obj = { - contractId: msg.getContractId_asB64(), - documentTypeName: jspb.Message.getFieldWithDefault(msg, 2, ""), - indexName: jspb.Message.getFieldWithDefault(msg, 3, ""), - indexValuesList: msg.getIndexValuesList_asB64(), - voterIdentifier: msg.getVoterIdentifier_asB64() - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest; - return proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.setContractId(value); - break; - case 2: - var value = /** @type {string} */ (reader.readString()); - msg.setDocumentTypeName(value); - break; - case 3: - var value = /** @type {string} */ (reader.readString()); - msg.setIndexName(value); - break; - case 4: - var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.addIndexValues(value); - break; - case 5: - var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.setVoterIdentifier(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getContractId_asU8(); - if (f.length > 0) { - writer.writeBytes( - 1, - f - ); - } - f = message.getDocumentTypeName(); - if (f.length > 0) { - writer.writeString( - 2, - f - ); - } - f = message.getIndexName(); - if (f.length > 0) { - writer.writeString( - 3, - f - ); - } - f = message.getIndexValuesList_asU8(); - if (f.length > 0) { - writer.writeRepeatedBytes( - 4, - f - ); - } - f = message.getVoterIdentifier_asU8(); - if (f.length > 0) { - writer.writeBytes( - 5, - f - ); - } -}; - - -/** - * optional bytes contract_id = 1; - * @return {string} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest.prototype.getContractId = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * optional bytes contract_id = 1; - * This is a type-conversion wrapper around `getContractId()` - * @return {string} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest.prototype.getContractId_asB64 = function() { - return /** @type {string} */ (jspb.Message.bytesAsB64( - this.getContractId())); -}; - - -/** - * optional bytes contract_id = 1; - * Note that Uint8Array is not supported on all browsers. - * @see http://caniuse.com/Uint8Array - * This is a type-conversion wrapper around `getContractId()` - * @return {!Uint8Array} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest.prototype.getContractId_asU8 = function() { - return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( - this.getContractId())); -}; - - -/** - * @param {!(string|Uint8Array)} value - * @return {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest} returns this - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest.prototype.setContractId = function(value) { - return jspb.Message.setProto3BytesField(this, 1, value); -}; - - -/** - * optional string document_type_name = 2; - * @return {string} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest.prototype.getDocumentTypeName = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); -}; - - -/** - * @param {string} value - * @return {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest} returns this - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest.prototype.setDocumentTypeName = function(value) { - return jspb.Message.setProto3StringField(this, 2, value); -}; - - -/** - * optional string index_name = 3; - * @return {string} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest.prototype.getIndexName = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); -}; - - -/** - * @param {string} value - * @return {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest} returns this - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest.prototype.setIndexName = function(value) { - return jspb.Message.setProto3StringField(this, 3, value); -}; - - -/** - * repeated bytes index_values = 4; - * @return {!Array} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest.prototype.getIndexValuesList = function() { - return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 4)); -}; - - -/** - * repeated bytes index_values = 4; - * This is a type-conversion wrapper around `getIndexValuesList()` - * @return {!Array} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest.prototype.getIndexValuesList_asB64 = function() { - return /** @type {!Array} */ (jspb.Message.bytesListAsB64( - this.getIndexValuesList())); -}; - - -/** - * repeated bytes index_values = 4; - * Note that Uint8Array is not supported on all browsers. - * @see http://caniuse.com/Uint8Array - * This is a type-conversion wrapper around `getIndexValuesList()` - * @return {!Array} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest.prototype.getIndexValuesList_asU8 = function() { - return /** @type {!Array} */ (jspb.Message.bytesListAsU8( - this.getIndexValuesList())); -}; - - -/** - * @param {!(Array|Array)} value - * @return {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest} returns this - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest.prototype.setIndexValuesList = function(value) { - return jspb.Message.setField(this, 4, value || []); -}; - - -/** - * @param {!(string|Uint8Array)} value - * @param {number=} opt_index - * @return {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest} returns this - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest.prototype.addIndexValues = function(value, opt_index) { - return jspb.Message.addToRepeatedField(this, 4, value, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - * @return {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest} returns this - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest.prototype.clearIndexValuesList = function() { - return this.setIndexValuesList([]); -}; - - -/** - * optional bytes voter_identifier = 5; - * @return {string} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest.prototype.getVoterIdentifier = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 5, "")); -}; - - -/** - * optional bytes voter_identifier = 5; - * This is a type-conversion wrapper around `getVoterIdentifier()` - * @return {string} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest.prototype.getVoterIdentifier_asB64 = function() { - return /** @type {string} */ (jspb.Message.bytesAsB64( - this.getVoterIdentifier())); -}; - - -/** - * optional bytes voter_identifier = 5; - * Note that Uint8Array is not supported on all browsers. - * @see http://caniuse.com/Uint8Array - * This is a type-conversion wrapper around `getVoterIdentifier()` - * @return {!Uint8Array} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest.prototype.getVoterIdentifier_asU8 = function() { - return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( - this.getVoterIdentifier())); -}; - - -/** - * @param {!(string|Uint8Array)} value - * @return {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest} returns this - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest.prototype.setVoterIdentifier = function(value) { - return jspb.Message.setProto3BytesField(this, 5, value); -}; - - -/** - * optional ContestedResourceVoteStatusRequest contested_resource_vote_status_request = 1; - * @return {?proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.prototype.getContestedResourceVoteStatusRequest = function() { - return /** @type{?proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest} */ ( - jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest, 1)); -}; - - -/** - * @param {?proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest|undefined} value - * @return {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest} returns this -*/ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.prototype.setContestedResourceVoteStatusRequest = function(value) { - return jspb.Message.setOneofWrapperField(this, 1, proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.oneofGroups_[0], value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest} returns this - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.prototype.clearContestedResourceVoteStatusRequest = function() { - return this.setContestedResourceVoteStatusRequest(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.prototype.hasContestedResourceVoteStatusRequest = function() { - return jspb.Message.getField(this, 1) != null; -}; - - - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenBalanceRequest.prototype.toObject = function(opt_includeInstance) { - return proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenBalanceRequest.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenBalanceRequest} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenBalanceRequest.toObject = function(includeInstance, msg) { - var f, obj = { - tokenId: msg.getTokenId_asB64(), - identityId: msg.getIdentityId_asB64() - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenBalanceRequest} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenBalanceRequest.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenBalanceRequest; - return proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenBalanceRequest.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenBalanceRequest} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenBalanceRequest} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenBalanceRequest.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.setTokenId(value); - break; - case 2: - var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.setIdentityId(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenBalanceRequest.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenBalanceRequest.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenBalanceRequest} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenBalanceRequest.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getTokenId_asU8(); - if (f.length > 0) { - writer.writeBytes( - 1, - f - ); - } - f = message.getIdentityId_asU8(); - if (f.length > 0) { - writer.writeBytes( - 2, - f - ); - } -}; - - -/** - * optional bytes token_id = 1; - * @return {string} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenBalanceRequest.prototype.getTokenId = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * optional bytes token_id = 1; - * This is a type-conversion wrapper around `getTokenId()` - * @return {string} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenBalanceRequest.prototype.getTokenId_asB64 = function() { - return /** @type {string} */ (jspb.Message.bytesAsB64( - this.getTokenId())); -}; - - -/** - * optional bytes token_id = 1; - * Note that Uint8Array is not supported on all browsers. - * @see http://caniuse.com/Uint8Array - * This is a type-conversion wrapper around `getTokenId()` - * @return {!Uint8Array} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenBalanceRequest.prototype.getTokenId_asU8 = function() { - return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( - this.getTokenId())); -}; - - -/** - * @param {!(string|Uint8Array)} value - * @return {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenBalanceRequest} returns this - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenBalanceRequest.prototype.setTokenId = function(value) { - return jspb.Message.setProto3BytesField(this, 1, value); -}; - - -/** - * optional bytes identity_id = 2; - * @return {string} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenBalanceRequest.prototype.getIdentityId = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); -}; - - -/** - * optional bytes identity_id = 2; - * This is a type-conversion wrapper around `getIdentityId()` - * @return {string} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenBalanceRequest.prototype.getIdentityId_asB64 = function() { - return /** @type {string} */ (jspb.Message.bytesAsB64( - this.getIdentityId())); -}; - - -/** - * optional bytes identity_id = 2; - * Note that Uint8Array is not supported on all browsers. - * @see http://caniuse.com/Uint8Array - * This is a type-conversion wrapper around `getIdentityId()` - * @return {!Uint8Array} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenBalanceRequest.prototype.getIdentityId_asU8 = function() { - return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( - this.getIdentityId())); -}; - - -/** - * @param {!(string|Uint8Array)} value - * @return {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenBalanceRequest} returns this - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenBalanceRequest.prototype.setIdentityId = function(value) { - return jspb.Message.setProto3BytesField(this, 2, value); -}; - - - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenInfoRequest.prototype.toObject = function(opt_includeInstance) { - return proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenInfoRequest.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenInfoRequest} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenInfoRequest.toObject = function(includeInstance, msg) { - var f, obj = { - tokenId: msg.getTokenId_asB64(), - identityId: msg.getIdentityId_asB64() - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenInfoRequest} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenInfoRequest.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenInfoRequest; - return proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenInfoRequest.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenInfoRequest} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenInfoRequest} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenInfoRequest.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.setTokenId(value); - break; - case 2: - var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.setIdentityId(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenInfoRequest.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenInfoRequest.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenInfoRequest} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenInfoRequest.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getTokenId_asU8(); - if (f.length > 0) { - writer.writeBytes( - 1, - f - ); - } - f = message.getIdentityId_asU8(); - if (f.length > 0) { - writer.writeBytes( - 2, - f - ); - } -}; - - -/** - * optional bytes token_id = 1; - * @return {string} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenInfoRequest.prototype.getTokenId = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * optional bytes token_id = 1; - * This is a type-conversion wrapper around `getTokenId()` - * @return {string} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenInfoRequest.prototype.getTokenId_asB64 = function() { - return /** @type {string} */ (jspb.Message.bytesAsB64( - this.getTokenId())); -}; - - -/** - * optional bytes token_id = 1; - * Note that Uint8Array is not supported on all browsers. - * @see http://caniuse.com/Uint8Array - * This is a type-conversion wrapper around `getTokenId()` - * @return {!Uint8Array} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenInfoRequest.prototype.getTokenId_asU8 = function() { - return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( - this.getTokenId())); -}; - - -/** - * @param {!(string|Uint8Array)} value - * @return {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenInfoRequest} returns this - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenInfoRequest.prototype.setTokenId = function(value) { - return jspb.Message.setProto3BytesField(this, 1, value); -}; - - -/** - * optional bytes identity_id = 2; - * @return {string} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenInfoRequest.prototype.getIdentityId = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); -}; - - -/** - * optional bytes identity_id = 2; - * This is a type-conversion wrapper around `getIdentityId()` - * @return {string} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenInfoRequest.prototype.getIdentityId_asB64 = function() { - return /** @type {string} */ (jspb.Message.bytesAsB64( - this.getIdentityId())); -}; - - -/** - * optional bytes identity_id = 2; - * Note that Uint8Array is not supported on all browsers. - * @see http://caniuse.com/Uint8Array - * This is a type-conversion wrapper around `getIdentityId()` - * @return {!Uint8Array} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenInfoRequest.prototype.getIdentityId_asU8 = function() { - return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( - this.getIdentityId())); -}; - - -/** - * @param {!(string|Uint8Array)} value - * @return {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenInfoRequest} returns this - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenInfoRequest.prototype.setIdentityId = function(value) { - return jspb.Message.setProto3BytesField(this, 2, value); -}; - - - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.TokenStatusRequest.prototype.toObject = function(opt_includeInstance) { - return proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.TokenStatusRequest.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.TokenStatusRequest} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.TokenStatusRequest.toObject = function(includeInstance, msg) { - var f, obj = { - tokenId: msg.getTokenId_asB64() - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.TokenStatusRequest} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.TokenStatusRequest.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.TokenStatusRequest; - return proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.TokenStatusRequest.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.TokenStatusRequest} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.TokenStatusRequest} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.TokenStatusRequest.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.setTokenId(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.TokenStatusRequest.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.TokenStatusRequest.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.TokenStatusRequest} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.TokenStatusRequest.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getTokenId_asU8(); - if (f.length > 0) { - writer.writeBytes( - 1, - f - ); - } -}; - - -/** - * optional bytes token_id = 1; - * @return {string} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.TokenStatusRequest.prototype.getTokenId = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * optional bytes token_id = 1; - * This is a type-conversion wrapper around `getTokenId()` - * @return {string} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.TokenStatusRequest.prototype.getTokenId_asB64 = function() { - return /** @type {string} */ (jspb.Message.bytesAsB64( - this.getTokenId())); -}; - - -/** - * optional bytes token_id = 1; - * Note that Uint8Array is not supported on all browsers. - * @see http://caniuse.com/Uint8Array - * This is a type-conversion wrapper around `getTokenId()` - * @return {!Uint8Array} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.TokenStatusRequest.prototype.getTokenId_asU8 = function() { - return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( - this.getTokenId())); -}; - - -/** - * @param {!(string|Uint8Array)} value - * @return {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.TokenStatusRequest} returns this - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.TokenStatusRequest.prototype.setTokenId = function(value) { - return jspb.Message.setProto3BytesField(this, 1, value); -}; - - -/** - * repeated IdentityRequest identities = 1; - * @return {!Array} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.prototype.getIdentitiesList = function() { - return /** @type{!Array} */ ( - jspb.Message.getRepeatedWrapperField(this, proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityRequest, 1)); -}; - - -/** - * @param {!Array} value - * @return {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0} returns this -*/ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.prototype.setIdentitiesList = function(value) { - return jspb.Message.setRepeatedWrapperField(this, 1, value); -}; - - -/** - * @param {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityRequest=} opt_value - * @param {number=} opt_index - * @return {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityRequest} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.prototype.addIdentities = function(opt_value, opt_index) { - return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityRequest, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - * @return {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0} returns this - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.prototype.clearIdentitiesList = function() { - return this.setIdentitiesList([]); -}; - - -/** - * repeated ContractRequest contracts = 2; - * @return {!Array} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.prototype.getContractsList = function() { - return /** @type{!Array} */ ( - jspb.Message.getRepeatedWrapperField(this, proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.ContractRequest, 2)); -}; - - -/** - * @param {!Array} value - * @return {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0} returns this -*/ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.prototype.setContractsList = function(value) { - return jspb.Message.setRepeatedWrapperField(this, 2, value); -}; - - -/** - * @param {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.ContractRequest=} opt_value - * @param {number=} opt_index - * @return {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.ContractRequest} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.prototype.addContracts = function(opt_value, opt_index) { - return jspb.Message.addToRepeatedWrapperField(this, 2, opt_value, proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.ContractRequest, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - * @return {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0} returns this - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.prototype.clearContractsList = function() { - return this.setContractsList([]); -}; - - -/** - * repeated DocumentRequest documents = 3; - * @return {!Array} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.prototype.getDocumentsList = function() { - return /** @type{!Array} */ ( - jspb.Message.getRepeatedWrapperField(this, proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest, 3)); -}; - - -/** - * @param {!Array} value - * @return {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0} returns this -*/ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.prototype.setDocumentsList = function(value) { - return jspb.Message.setRepeatedWrapperField(this, 3, value); -}; - - -/** - * @param {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest=} opt_value - * @param {number=} opt_index - * @return {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.prototype.addDocuments = function(opt_value, opt_index) { - return jspb.Message.addToRepeatedWrapperField(this, 3, opt_value, proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - * @return {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0} returns this - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.prototype.clearDocumentsList = function() { - return this.setDocumentsList([]); -}; - - -/** - * repeated VoteStatusRequest votes = 4; - * @return {!Array} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.prototype.getVotesList = function() { - return /** @type{!Array} */ ( - jspb.Message.getRepeatedWrapperField(this, proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest, 4)); -}; - - -/** - * @param {!Array} value - * @return {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0} returns this -*/ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.prototype.setVotesList = function(value) { - return jspb.Message.setRepeatedWrapperField(this, 4, value); -}; - - -/** - * @param {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest=} opt_value - * @param {number=} opt_index - * @return {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.prototype.addVotes = function(opt_value, opt_index) { - return jspb.Message.addToRepeatedWrapperField(this, 4, opt_value, proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - * @return {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0} returns this - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.prototype.clearVotesList = function() { - return this.setVotesList([]); -}; - - -/** - * repeated IdentityTokenBalanceRequest identity_token_balances = 5; - * @return {!Array} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.prototype.getIdentityTokenBalancesList = function() { - return /** @type{!Array} */ ( - jspb.Message.getRepeatedWrapperField(this, proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenBalanceRequest, 5)); -}; - - -/** - * @param {!Array} value - * @return {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0} returns this -*/ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.prototype.setIdentityTokenBalancesList = function(value) { - return jspb.Message.setRepeatedWrapperField(this, 5, value); -}; - - -/** - * @param {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenBalanceRequest=} opt_value - * @param {number=} opt_index - * @return {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenBalanceRequest} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.prototype.addIdentityTokenBalances = function(opt_value, opt_index) { - return jspb.Message.addToRepeatedWrapperField(this, 5, opt_value, proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenBalanceRequest, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - * @return {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0} returns this - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.prototype.clearIdentityTokenBalancesList = function() { - return this.setIdentityTokenBalancesList([]); -}; - - -/** - * repeated IdentityTokenInfoRequest identity_token_infos = 6; - * @return {!Array} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.prototype.getIdentityTokenInfosList = function() { - return /** @type{!Array} */ ( - jspb.Message.getRepeatedWrapperField(this, proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenInfoRequest, 6)); -}; - - -/** - * @param {!Array} value - * @return {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0} returns this -*/ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.prototype.setIdentityTokenInfosList = function(value) { - return jspb.Message.setRepeatedWrapperField(this, 6, value); -}; - - -/** - * @param {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenInfoRequest=} opt_value - * @param {number=} opt_index - * @return {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenInfoRequest} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.prototype.addIdentityTokenInfos = function(opt_value, opt_index) { - return jspb.Message.addToRepeatedWrapperField(this, 6, opt_value, proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenInfoRequest, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - * @return {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0} returns this - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.prototype.clearIdentityTokenInfosList = function() { - return this.setIdentityTokenInfosList([]); -}; - - -/** - * repeated TokenStatusRequest token_statuses = 7; - * @return {!Array} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.prototype.getTokenStatusesList = function() { - return /** @type{!Array} */ ( - jspb.Message.getRepeatedWrapperField(this, proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.TokenStatusRequest, 7)); -}; - - -/** - * @param {!Array} value - * @return {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0} returns this -*/ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.prototype.setTokenStatusesList = function(value) { - return jspb.Message.setRepeatedWrapperField(this, 7, value); -}; - - -/** - * @param {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.TokenStatusRequest=} opt_value - * @param {number=} opt_index - * @return {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.TokenStatusRequest} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.prototype.addTokenStatuses = function(opt_value, opt_index) { - return jspb.Message.addToRepeatedWrapperField(this, 7, opt_value, proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.TokenStatusRequest, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - * @return {!proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0} returns this - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.prototype.clearTokenStatusesList = function() { - return this.setTokenStatusesList([]); -}; - - -/** - * optional GetProofsRequestV0 v0 = 1; - * @return {?proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.prototype.getV0 = function() { - return /** @type{?proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0} */ ( - jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0, 1)); -}; - - -/** - * @param {?proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0|undefined} value - * @return {!proto.org.dash.platform.dapi.v0.GetProofsRequest} returns this -*/ -proto.org.dash.platform.dapi.v0.GetProofsRequest.prototype.setV0 = function(value) { - return jspb.Message.setOneofWrapperField(this, 1, proto.org.dash.platform.dapi.v0.GetProofsRequest.oneofGroups_[0], value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.org.dash.platform.dapi.v0.GetProofsRequest} returns this - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.prototype.clearV0 = function() { - return this.setV0(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.org.dash.platform.dapi.v0.GetProofsRequest.prototype.hasV0 = function() { - return jspb.Message.getField(this, 1) != null; -}; - - - -/** - * Oneof group definitions for this message. Each group defines the field - * numbers belonging to that group. When of these fields' value is set, all - * other fields in the group are cleared. During deserialization, if multiple - * fields are encountered for a group, only the last value seen will be kept. - * @private {!Array>} - * @const - */ -proto.org.dash.platform.dapi.v0.GetProofsResponse.oneofGroups_ = [[1]]; - -/** - * @enum {number} - */ -proto.org.dash.platform.dapi.v0.GetProofsResponse.VersionCase = { - VERSION_NOT_SET: 0, - V0: 1 -}; - -/** - * @return {proto.org.dash.platform.dapi.v0.GetProofsResponse.VersionCase} - */ -proto.org.dash.platform.dapi.v0.GetProofsResponse.prototype.getVersionCase = function() { - return /** @type {proto.org.dash.platform.dapi.v0.GetProofsResponse.VersionCase} */(jspb.Message.computeOneofCase(this, proto.org.dash.platform.dapi.v0.GetProofsResponse.oneofGroups_[0])); -}; - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.org.dash.platform.dapi.v0.GetProofsResponse.prototype.toObject = function(opt_includeInstance) { - return proto.org.dash.platform.dapi.v0.GetProofsResponse.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.org.dash.platform.dapi.v0.GetProofsResponse} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.org.dash.platform.dapi.v0.GetProofsResponse.toObject = function(includeInstance, msg) { - var f, obj = { - v0: (f = msg.getV0()) && proto.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0.toObject(includeInstance, f) - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.org.dash.platform.dapi.v0.GetProofsResponse} - */ -proto.org.dash.platform.dapi.v0.GetProofsResponse.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.org.dash.platform.dapi.v0.GetProofsResponse; - return proto.org.dash.platform.dapi.v0.GetProofsResponse.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.org.dash.platform.dapi.v0.GetProofsResponse} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.org.dash.platform.dapi.v0.GetProofsResponse} - */ -proto.org.dash.platform.dapi.v0.GetProofsResponse.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = new proto.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0; - reader.readMessage(value,proto.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0.deserializeBinaryFromReader); - msg.setV0(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.org.dash.platform.dapi.v0.GetProofsResponse.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.org.dash.platform.dapi.v0.GetProofsResponse.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.org.dash.platform.dapi.v0.GetProofsResponse} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.org.dash.platform.dapi.v0.GetProofsResponse.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getV0(); - if (f != null) { - writer.writeMessage( - 1, - f, - proto.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0.serializeBinaryToWriter - ); - } -}; - - - -/** - * Oneof group definitions for this message. Each group defines the field - * numbers belonging to that group. When of these fields' value is set, all - * other fields in the group are cleared. During deserialization, if multiple - * fields are encountered for a group, only the last value seen will be kept. - * @private {!Array>} - * @const - */ -proto.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0.oneofGroups_ = [[1]]; - -/** - * @enum {number} - */ -proto.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0.ResultCase = { - RESULT_NOT_SET: 0, - PROOF: 1 -}; - -/** - * @return {proto.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0.ResultCase} - */ -proto.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0.prototype.getResultCase = function() { - return /** @type {proto.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0.ResultCase} */(jspb.Message.computeOneofCase(this, proto.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0.oneofGroups_[0])); -}; - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0.prototype.toObject = function(opt_includeInstance) { - return proto.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0.toObject = function(includeInstance, msg) { - var f, obj = { - proof: (f = msg.getProof()) && proto.org.dash.platform.dapi.v0.Proof.toObject(includeInstance, f), - metadata: (f = msg.getMetadata()) && proto.org.dash.platform.dapi.v0.ResponseMetadata.toObject(includeInstance, f) - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0} - */ -proto.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0; - return proto.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0} - */ -proto.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = new proto.org.dash.platform.dapi.v0.Proof; - reader.readMessage(value,proto.org.dash.platform.dapi.v0.Proof.deserializeBinaryFromReader); - msg.setProof(value); - break; - case 2: - var value = new proto.org.dash.platform.dapi.v0.ResponseMetadata; - reader.readMessage(value,proto.org.dash.platform.dapi.v0.ResponseMetadata.deserializeBinaryFromReader); - msg.setMetadata(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getProof(); - if (f != null) { - writer.writeMessage( - 1, - f, - proto.org.dash.platform.dapi.v0.Proof.serializeBinaryToWriter - ); - } - f = message.getMetadata(); - if (f != null) { - writer.writeMessage( - 2, - f, - proto.org.dash.platform.dapi.v0.ResponseMetadata.serializeBinaryToWriter - ); - } -}; - - -/** - * optional Proof proof = 1; - * @return {?proto.org.dash.platform.dapi.v0.Proof} - */ -proto.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0.prototype.getProof = function() { - return /** @type{?proto.org.dash.platform.dapi.v0.Proof} */ ( - jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.Proof, 1)); -}; - - -/** - * @param {?proto.org.dash.platform.dapi.v0.Proof|undefined} value - * @return {!proto.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0} returns this -*/ -proto.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0.prototype.setProof = function(value) { - return jspb.Message.setOneofWrapperField(this, 1, proto.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0.oneofGroups_[0], value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0} returns this - */ -proto.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0.prototype.clearProof = function() { - return this.setProof(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0.prototype.hasProof = function() { - return jspb.Message.getField(this, 1) != null; -}; - - -/** - * optional ResponseMetadata metadata = 2; - * @return {?proto.org.dash.platform.dapi.v0.ResponseMetadata} - */ -proto.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0.prototype.getMetadata = function() { - return /** @type{?proto.org.dash.platform.dapi.v0.ResponseMetadata} */ ( - jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.ResponseMetadata, 2)); -}; - - -/** - * @param {?proto.org.dash.platform.dapi.v0.ResponseMetadata|undefined} value - * @return {!proto.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0} returns this -*/ -proto.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0.prototype.setMetadata = function(value) { - return jspb.Message.setWrapperField(this, 2, value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0} returns this - */ -proto.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0.prototype.clearMetadata = function() { - return this.setMetadata(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0.prototype.hasMetadata = function() { - return jspb.Message.getField(this, 2) != null; -}; - - -/** - * optional GetProofsResponseV0 v0 = 1; - * @return {?proto.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0} - */ -proto.org.dash.platform.dapi.v0.GetProofsResponse.prototype.getV0 = function() { - return /** @type{?proto.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0} */ ( - jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0, 1)); -}; - - -/** - * @param {?proto.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0|undefined} value - * @return {!proto.org.dash.platform.dapi.v0.GetProofsResponse} returns this -*/ -proto.org.dash.platform.dapi.v0.GetProofsResponse.prototype.setV0 = function(value) { - return jspb.Message.setOneofWrapperField(this, 1, proto.org.dash.platform.dapi.v0.GetProofsResponse.oneofGroups_[0], value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.org.dash.platform.dapi.v0.GetProofsResponse} returns this - */ -proto.org.dash.platform.dapi.v0.GetProofsResponse.prototype.clearV0 = function() { - return this.setV0(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.org.dash.platform.dapi.v0.GetProofsResponse.prototype.hasV0 = function() { - return jspb.Message.getField(this, 1) != null; -}; - - - /** * Oneof group definitions for this message. Each group defines the field * numbers belonging to that group. When of these fields' value is set, all diff --git a/packages/dapi-grpc/clients/platform/v0/web/platform_pb_service.d.ts b/packages/dapi-grpc/clients/platform/v0/web/platform_pb_service.d.ts index 78116e10177..fa991277d83 100644 --- a/packages/dapi-grpc/clients/platform/v0/web/platform_pb_service.d.ts +++ b/packages/dapi-grpc/clients/platform/v0/web/platform_pb_service.d.ts @@ -103,15 +103,6 @@ type PlatformgetEvonodesProposedEpochBlocksByRange = { readonly responseType: typeof platform_pb.GetEvonodesProposedEpochBlocksResponse; }; -type PlatformgetProofs = { - readonly methodName: string; - readonly service: typeof Platform; - readonly requestStream: false; - readonly responseStream: false; - readonly requestType: typeof platform_pb.GetProofsRequest; - readonly responseType: typeof platform_pb.GetProofsResponse; -}; - type PlatformgetDataContract = { readonly methodName: string; readonly service: typeof Platform; @@ -404,7 +395,6 @@ export class Platform { static readonly getIdentityBalanceAndRevision: PlatformgetIdentityBalanceAndRevision; static readonly getEvonodesProposedEpochBlocksByIds: PlatformgetEvonodesProposedEpochBlocksByIds; static readonly getEvonodesProposedEpochBlocksByRange: PlatformgetEvonodesProposedEpochBlocksByRange; - static readonly getProofs: PlatformgetProofs; static readonly getDataContract: PlatformgetDataContract; static readonly getDataContractHistory: PlatformgetDataContractHistory; static readonly getDataContracts: PlatformgetDataContracts; @@ -569,15 +559,6 @@ export class PlatformClient { requestMessage: platform_pb.GetEvonodesProposedEpochBlocksByRangeRequest, callback: (error: ServiceError|null, responseMessage: platform_pb.GetEvonodesProposedEpochBlocksResponse|null) => void ): UnaryResponse; - getProofs( - requestMessage: platform_pb.GetProofsRequest, - metadata: grpc.Metadata, - callback: (error: ServiceError|null, responseMessage: platform_pb.GetProofsResponse|null) => void - ): UnaryResponse; - getProofs( - requestMessage: platform_pb.GetProofsRequest, - callback: (error: ServiceError|null, responseMessage: platform_pb.GetProofsResponse|null) => void - ): UnaryResponse; getDataContract( requestMessage: platform_pb.GetDataContractRequest, metadata: grpc.Metadata, diff --git a/packages/dapi-grpc/clients/platform/v0/web/platform_pb_service.js b/packages/dapi-grpc/clients/platform/v0/web/platform_pb_service.js index 3a5bab94009..cebb7ab2c46 100644 --- a/packages/dapi-grpc/clients/platform/v0/web/platform_pb_service.js +++ b/packages/dapi-grpc/clients/platform/v0/web/platform_pb_service.js @@ -109,15 +109,6 @@ Platform.getEvonodesProposedEpochBlocksByRange = { responseType: platform_pb.GetEvonodesProposedEpochBlocksResponse }; -Platform.getProofs = { - methodName: "getProofs", - service: Platform, - requestStream: false, - responseStream: false, - requestType: platform_pb.GetProofsRequest, - responseType: platform_pb.GetProofsResponse -}; - Platform.getDataContract = { methodName: "getDataContract", service: Platform, @@ -745,37 +736,6 @@ PlatformClient.prototype.getEvonodesProposedEpochBlocksByRange = function getEvo }; }; -PlatformClient.prototype.getProofs = function getProofs(requestMessage, metadata, callback) { - if (arguments.length === 2) { - callback = arguments[1]; - } - var client = grpc.unary(Platform.getProofs, { - request: requestMessage, - host: this.serviceHost, - metadata: metadata, - transport: this.options.transport, - debug: this.options.debug, - onEnd: function (response) { - if (callback) { - if (response.status !== grpc.Code.OK) { - var err = new Error(response.statusMessage); - err.code = response.status; - err.metadata = response.trailers; - callback(err, null); - } else { - callback(null, response.message); - } - } - } - }); - return { - cancel: function () { - callback = null; - client.close(); - } - }; -}; - PlatformClient.prototype.getDataContract = function getDataContract(requestMessage, metadata, callback) { if (arguments.length === 2) { callback = arguments[1]; diff --git a/packages/dapi-grpc/protos/drive/v0/drive.proto b/packages/dapi-grpc/protos/drive/v0/drive.proto new file mode 100644 index 00000000000..bc4dd40e3a9 --- /dev/null +++ b/packages/dapi-grpc/protos/drive/v0/drive.proto @@ -0,0 +1,18 @@ +syntax = "proto3"; + +package org.dash.platform.drive.v0; + +import "platform.proto"; + +service DriveInternal { + rpc getProofs(GetProofsRequest) returns (GetProofsResponse); +} + +message GetProofsRequest { + bytes state_transition = 1; +} + +message GetProofsResponse { + org.dash.platform.dapi.v0.Proof proof = 1; // Cryptographic proof for the requested data + org.dash.platform.dapi.v0.ResponseMetadata metadata = 2; // Metadata about the blockchain state +} diff --git a/packages/dapi-grpc/protos/platform/v0/platform.proto b/packages/dapi-grpc/protos/platform/v0/platform.proto index 905ef6c1d23..89767bce9d0 100644 --- a/packages/dapi-grpc/protos/platform/v0/platform.proto +++ b/packages/dapi-grpc/protos/platform/v0/platform.proto @@ -24,7 +24,6 @@ service Platform { returns (GetEvonodesProposedEpochBlocksResponse); rpc getEvonodesProposedEpochBlocksByRange(GetEvonodesProposedEpochBlocksByRangeRequest) returns (GetEvonodesProposedEpochBlocksResponse); - rpc getProofs(GetProofsRequest) returns (GetProofsResponse); rpc getDataContract(GetDataContractRequest) returns (GetDataContractResponse); rpc getDataContractHistory(GetDataContractHistoryRequest) returns (GetDataContractHistoryResponse); @@ -404,86 +403,6 @@ message GetIdentitiesBalancesResponse { oneof version { GetIdentitiesBalancesResponseV0 v0 = 1; } } -message GetProofsRequest { - message GetProofsRequestV0 { - // DocumentRequest specifies a request for a document proof - message DocumentRequest { - enum DocumentContestedStatus { - NOT_CONTESTED = 0; - MAYBE_CONTESTED = 1; - CONTESTED = 2; - } - bytes contract_id = 1; // ID of the contract the document belongs to - string document_type = 2; // Type of document being requested - bool document_type_keeps_history = 3; // Indicates if the document type keeps a history of changes - bytes document_id = 4; // ID of the specific document being requested - DocumentContestedStatus document_contested_status = 5; - } - - // IdentityRequest specifies a request for an identity proof - message IdentityRequest { - enum Type { - FULL_IDENTITY = 0; // Request for the full identity - BALANCE = 1; // Request for the identity's balance - KEYS = 2; // Request for the identity's keys - REVISION = 3; // Request for the identity's revision - } - bytes identity_id = 1; // ID of the identity for which the proof is requested - Type request_type = 2; // Type of identity request - } - - // ContractRequest specifies a request for a data contract proof. - message ContractRequest { bytes contract_id = 1; } // ID of the contract for which the proof is requested - - message VoteStatusRequest { - message ContestedResourceVoteStatusRequest { - bytes contract_id = 1; - string document_type_name = 2; - string index_name = 3; - repeated bytes index_values = 4; - bytes voter_identifier = 5; - } - - oneof request_type { ContestedResourceVoteStatusRequest contested_resource_vote_status_request = 1; } - } - - message IdentityTokenBalanceRequest { - bytes token_id = 1; - bytes identity_id = 2; - } - - message IdentityTokenInfoRequest { - bytes token_id = 1; - bytes identity_id = 2; - } - - message TokenStatusRequest { - bytes token_id = 1; - } - - repeated IdentityRequest identities = 1; // List of identity requests - repeated ContractRequest contracts = 2; // List of contract requests - repeated DocumentRequest documents = 3; // List of document requests - repeated VoteStatusRequest votes = 4; - repeated IdentityTokenBalanceRequest identity_token_balances = 5; - repeated IdentityTokenInfoRequest identity_token_infos = 6; - repeated TokenStatusRequest token_statuses = 7; - } - - oneof version { GetProofsRequestV0 v0 = 1; } -} - -message GetProofsResponse { - message GetProofsResponseV0 { - oneof result { - Proof proof = 1; // Cryptographic proof for the requested data - } - - ResponseMetadata metadata = 2; // Metadata about the blockchain state - } - oneof version { GetProofsResponseV0 v0 = 1; } -} - message GetDataContractRequest { message GetDataContractRequestV0 { bytes id = 1; // The ID of the data contract being requested @@ -1584,7 +1503,7 @@ message GetGroupActionsRequest { bytes start_action_id = 1; bool start_action_id_included = 2; } - + message GetGroupActionsRequestV0 { bytes contract_id = 1; uint32 group_contract_position = 2; @@ -1765,4 +1684,4 @@ message GetGroupActionSignersResponse { oneof version { GetGroupActionSignersResponseV0 v0 = 1; } -} \ No newline at end of file +} diff --git a/packages/dapi-grpc/scripts/build.sh b/packages/dapi-grpc/scripts/build.sh index 421d38e5c1f..41e113f1579 100755 --- a/packages/dapi-grpc/scripts/build.sh +++ b/packages/dapi-grpc/scripts/build.sh @@ -14,8 +14,12 @@ CORE_CLIENTS_PATH="$PWD/clients/core/v0" PLATFORM_PROTO_PATH="$PWD/protos/platform/v0" PLATFORM_CLIENTS_PATH="$PWD/clients/platform/v0" +DRIVE_PROTO_PATH="$PWD/protos/drive/v0" +DRIVE_CLIENTS_PATH="$PWD/clients/drive/v0" + CORE_WEB_OUT_PATH="$CORE_CLIENTS_PATH/web" PLATFORM_WEB_OUT_PATH="$PLATFORM_CLIENTS_PATH/web" +DRIVE_WEB_OUT_PATH="$DRIVE_CLIENTS_PATH/web" CORE_JAVA_OUT_PATH="$CORE_CLIENTS_PATH/java" PLATFORM_JAVA_OUT_PATH="$PLATFORM_CLIENTS_PATH/java" @@ -62,6 +66,40 @@ pbjs \ -o "$CORE_CLIENTS_PATH/nodejs/core_pbjs.js" \ "$CORE_PROTO_PATH/core.proto" +##################################################### +# Generate JavaScript client for `DriveInternal` service # +##################################################### + +rm -rf "${DRIVE_WEB_OUT_PATH:?}/*" || true + +docker run -v "$DRIVE_PROTO_PATH:$DRIVE_PROTO_PATH" \ + -v "$DRIVE_WEB_OUT_PATH:$DRIVE_WEB_OUT_PATH" \ + -v "$PLATFORM_PROTO_PATH:$PLATFORM_PROTO_PATH" \ + --rm \ + "$PROTOC_IMAGE" \ + --js_out="import_style=commonjs:$DRIVE_WEB_OUT_PATH" \ + --ts_out="service=grpc-web:$DRIVE_WEB_OUT_PATH" \ + -I="$DRIVE_PROTO_PATH" \ + -I="$PLATFORM_PROTO_PATH" \ + "drive.proto" + +# Clean node message classes + +rm -rf "$DRIVE_CLIENTS_PATH/nodejs/*_protoc.js" || true +rm -rf "$DRIVE_CLIENTS_PATH/nodejs/*_pbjs.js" || true + +# Copy compiled modules with message classes + +cp "$DRIVE_WEB_OUT_PATH/drive_pb.js" "$DRIVE_CLIENTS_PATH/nodejs/drive_protoc.js" + +pbjs \ + -t static-module \ + -w commonjs \ + -r platform_root \ + -p "$PLATFORM_PROTO_PATH" \ + -o "$DRIVE_CLIENTS_PATH/nodejs/drive_pbjs.js" \ + "$DRIVE_PROTO_PATH/drive.proto" + ##################################################### # Generate JavaScript client for `Platform` service # ##################################################### diff --git a/packages/dapi-grpc/scripts/patch-protobuf-js.sh b/packages/dapi-grpc/scripts/patch-protobuf-js.sh index 39b5a2a85ea..147a69ed4f3 100755 --- a/packages/dapi-grpc/scripts/patch-protobuf-js.sh +++ b/packages/dapi-grpc/scripts/patch-protobuf-js.sh @@ -2,8 +2,7 @@ # shellcheck disable=SC2250 set -e -files=$(find "$PWD/clients/core/v0/web" "$PWD/clients/core/v0/nodejs" "$PWD/clients/platform/v0/web" "$PWD/clients/platform/v0/nodejs" -name "*_pb.js" -o -name "*_protoc.js") -OS=$(uname) +files=$(find "$PWD/clients/core/v0/web" "$PWD/clients/core/v0/nodejs" "$PWD/clients/platform/v0/web" "$PWD/clients/platform/v0/nodejs" "$PWD/clients/drive/v0/web" "$PWD/clients/drive/v0/nodejs" -name "*_pb.js" -o -name "*_protoc.js") OS=$(uname) function replace_in_file() { if [[ "$OS" = 'Darwin' ]]; then diff --git a/packages/dapi/lib/externalApis/drive/fetchProofForStateTransitionFactory.js b/packages/dapi/lib/externalApis/drive/fetchProofForStateTransitionFactory.js index 6b04a739e31..95ce9b3304e 100644 --- a/packages/dapi/lib/externalApis/drive/fetchProofForStateTransitionFactory.js +++ b/packages/dapi/lib/externalApis/drive/fetchProofForStateTransitionFactory.js @@ -14,30 +14,61 @@ const { GetDataContractRequest } = require('@dashevo/dapi-grpc/clients/platform/ const { contractId: tokensHistoryContractIdString } = require('@dashevo/token-history-contract/lib/systemIds'); const bs58 = require('bs58'); -function keepsHistory(batchedTransition, tokenConfiguration) { - switch (batchedTransition.getTransitionType()) { - case TokenTransitionType.Burn: { - return tokenConfiguration.keepsHistory().keepsBurningHistory(); +} if (stateTransition.isIdentityStateTransition()) { + const { IdentityRequest } = GetProofsRequestV0; + + const identitiesList = modifiedIds.flatMap((id) => { + const stType = stateTransition.getType(); + let proofRequests; + + if (stType === StateTransitionTypes.IdentityCreditTransfer) { + proofRequests = new IdentityRequest(); + proofRequests.setIdentityId(id.toBuffer()); + proofRequests.setRequestType(IdentityRequest.Type.BALANCE); + } else if (stType === StateTransitionTypes.IdentityTopUp) { + const proofRequestsBalance = new IdentityRequest(); + proofRequestsBalance.setIdentityId(id.toBuffer()); + proofRequestsBalance.setRequestType(IdentityRequest.Type.BALANCE); + + const proofRequestsRevision = new IdentityRequest(); + proofRequestsRevision.setIdentityId(id.toBuffer()); + proofRequestsRevision.setRequestType(IdentityRequest.Type.REVISION); + + proofRequests = [proofRequestsBalance, proofRequestsRevision]; + } else { + proofRequests = new IdentityRequest(); + proofRequests.setIdentityId(id.toBuffer()); + proofRequests.setRequestType(IdentityRequest.Type.FULL_IDENTITY); } - case TokenTransitionType.Mint: { - return tokenConfiguration.keepsHistory().keepsMintingHistory(); - } - case TokenTransitionType.Transfer: { - return tokenConfiguration.keepsHistory().keepsTransferHistory(); - } - case TokenTransitionType.Freeze: - case TokenTransitionType.Unfreeze: { - return tokenConfiguration.keepsHistory().keepsFreezingHistory(); - } - case TokenTransitionType.Claim: - case TokenTransitionType.ConfigUpdate: - case TokenTransitionType.EmergencyAction: - case TokenTransitionType.DestroyFrozenFunds: { - return true; - } - default: - return false; + + return proofRequests; + }); + + requestV0.setIdentitiesList(identitiesList); +} if (stateTransition.isVotingStateTransition()) { + const { VoteStatusRequest } = GetProofsRequestV0; + const { ContestedResourceVoteStatusRequest } = VoteStatusRequest; + + const contestedResourceVoteStatusRequest = new ContestedResourceVoteStatusRequest(); + + const contestedVotePoll = stateTransition.getContestedDocumentResourceVotePoll(); + + if (!contestedVotePoll) { + throw new Error('Masternode vote state transition should have a contested vote poll'); } + + contestedResourceVoteStatusRequest.setContractId(contestedVotePoll.contractId.toBuffer()); + contestedResourceVoteStatusRequest.setDocumentTypeName(contestedVotePoll.documentTypeName); + contestedResourceVoteStatusRequest.setIndexName(contestedVotePoll.indexName); + contestedResourceVoteStatusRequest.setIndexValuesList(contestedVotePoll.indexValues); + contestedResourceVoteStatusRequest.setVoterIdentifier( + stateTransition.getProTxHash().toBuffer(), + ); + + const voteStatus = new VoteStatusRequest(); + voteStatus.setContestedResourceVoteStatusRequest(contestedResourceVoteStatusRequest); + + requestV0.setVotesList([voteStatus]); } /** @@ -48,238 +79,16 @@ function keepsHistory(batchedTransition, tokenConfiguration) { function fetchProofForStateTransitionFactory(driveClient, dpp) { const tokensHistoryContractIdBuffer = bs58.decode(tokensHistoryContractIdString); + /** * @typedef {fetchProofForStateTransition} - * @param {AbstractStateTransition} stateTransition + * @param {Uint8Array} stateTransition * @return {Promise} */ async function fetchProofForStateTransition(stateTransition) { - const modifiedIds = stateTransition.getModifiedDataIds(); - - const { GetProofsRequestV0 } = GetProofsRequest; - - const requestV0 = new GetProofsRequestV0(); - - const dataContractsCache = {}; - - if (stateTransition.isDocumentStateTransition()) { - const { - DocumentRequest, - IdentityTokenBalanceRequest, - IdentityTokenInfoRequest, - TokenStatusRequest, - } = GetProofsRequestV0; - - const documentsList = []; - const identityTokenBalancesList = []; - const identityTokenInfosList = []; - const tokenStatusesList = []; - - for (const batchedTransition of stateTransition.getTransitions()) { - // Fetch data contract to determine correct recipient identity - const dataContractId = batchedTransition.getDataContractId(); - const dataContractIdString = dataContractId.toString(); - - if (batchedTransition instanceof TokenTransition) { - if (!dataContractsCache[dataContractIdString]) { - const dataContractRequestV0 = new GetDataContractRequest.GetDataContractRequestV0(); - dataContractRequestV0.setId(dataContractId.toBuffer()); - - const dataContractRequest = new GetDataContractRequest(); - dataContractRequest.setV0(dataContractRequestV0); - - const dataContractResponse = await driveClient.getDataContract(dataContractRequest); - - const dataContractBuffer = Buffer.from( - dataContractResponse.getV0().getDataContract_asU8(), - ); - - dataContractsCache[dataContractIdString] = await dpp.dataContract - .createFromBuffer(dataContractBuffer, { skipValidation: true }); - } - - const dataContract = dataContractsCache[dataContractIdString]; - - const tokenConfiguration = dataContract.getTokenConfiguration( - batchedTransition.getTokenContractPosition(), - ); - - // In case if we keep history for token events we can provide better proof - // for clients - if (keepsHistory(batchedTransition, tokenConfiguration)) { - const documentRequest = new DocumentRequest(); - documentRequest.setContractId(tokensHistoryContractIdBuffer); - documentRequest.setDocumentType(batchedTransition.getHistoricalDocumentTypeName()); - - const documentId = batchedTransition.getHistoricalDocumentId( - stateTransition.getOwnerId(), - batchedTransition.getIdentityContractNonce(), - ); - - documentRequest.setDocumentId(documentId.toBuffer()); - - documentsList.push(documentRequest); - } else { - // If not we can provide only balance / supply proofs - switch (batchedTransition.getTransitionType()) { - case TokenTransitionType.Burn: { - const request = new IdentityTokenBalanceRequest(); - request.setTokenId(batchedTransition.getTokenId().toBuffer()); - request.setIdentityId(stateTransition.getOwnerId().toBuffer()); - - identityTokenBalancesList.push(request); - break; - } - case TokenTransitionType.Mint: { - const request = new IdentityTokenBalanceRequest(); - request.setTokenId(batchedTransition.getTokenId().toBuffer()); - request.setIdentityId( - batchedTransition.toTransition().getRecipientId(tokenConfiguration).toBuffer(), - ); - - identityTokenBalancesList.push(request); - break; - } - case TokenTransitionType.Transfer: { - const requestSender = new IdentityTokenBalanceRequest(); - requestSender.setTokenId(batchedTransition.getTokenId().toBuffer()); - requestSender.setIdentityId(stateTransition.getOwnerId().toBuffer()); - - const requestRecipient = new IdentityTokenBalanceRequest(); - requestRecipient.setTokenId(batchedTransition.getTokenId().toBuffer()); - requestRecipient.setIdentityId( - batchedTransition.toTransition().getRecipientId().toBuffer(), - ); - - identityTokenBalancesList.push(requestSender, requestRecipient); - break; - } - case TokenTransitionType.EmergencyAction: - { - const request = new TokenStatusRequest(); - - request.setTokenId(batchedTransition.getTokenId().toBuffer()); - - tokenStatusesList.push(request); - break; - } - case TokenTransitionType.Freeze: - case TokenTransitionType.Unfreeze: { - const request = new IdentityTokenInfoRequest(); - request.setTokenId(batchedTransition.getTokenId().toBuffer()); - request.setIdentityId( - batchedTransition.toTransition().getFrozenIdentityId().toBuffer(), - ); - - identityTokenInfosList.push(request); - break; - } - default: - throw new Error(`Unsupported token transition type ${batchedTransition.getTransitionType()}`); - } - } - } else if (batchedTransition instanceof DocumentTransition) { - const documentRequest = new DocumentRequest(); - documentRequest.setContractId(batchedTransition.getDataContractId().toBuffer()); - documentRequest.setDocumentType(batchedTransition.getType()); - documentRequest.setDocumentId(batchedTransition.getId().toBuffer()); - - const status = batchedTransition.hasPrefundedBalance() - ? DocumentRequest.DocumentContestedStatus.CONTESTED - : DocumentRequest.DocumentContestedStatus.NOT_CONTESTED; - - documentRequest.setDocumentContestedStatus(status); - - documentsList.push(documentRequest); - } else { - throw new Error(`Unsupported batched transition type ${batchedTransition.constructor.name}`); - } - } - - if (documentsList.length > 0) { - requestV0.setDocumentsList(documentsList); - } - - if (identityTokenBalancesList.length > 0) { - requestV0.setIdentityTokenBalancesList(identityTokenBalancesList); - } - - if (identityTokenInfosList.length > 0) { - requestV0.setIdentityTokenInfosList(identityTokenInfosList); - } - - if (tokenStatusesList.length > 0) { - requestV0.setTokenStatusesList(tokenStatusesList); - } - } if (stateTransition.isIdentityStateTransition()) { - const { IdentityRequest } = GetProofsRequestV0; - - const identitiesList = modifiedIds.flatMap((id) => { - const stType = stateTransition.getType(); - let proofRequests; - - if (stType === StateTransitionTypes.IdentityCreditTransfer) { - proofRequests = new IdentityRequest(); - proofRequests.setIdentityId(id.toBuffer()); - proofRequests.setRequestType(IdentityRequest.Type.BALANCE); - } else if (stType === StateTransitionTypes.IdentityTopUp) { - const proofRequestsBalance = new IdentityRequest(); - proofRequestsBalance.setIdentityId(id.toBuffer()); - proofRequestsBalance.setRequestType(IdentityRequest.Type.BALANCE); - - const proofRequestsRevision = new IdentityRequest(); - proofRequestsRevision.setIdentityId(id.toBuffer()); - proofRequestsRevision.setRequestType(IdentityRequest.Type.REVISION); - - proofRequests = [proofRequestsBalance, proofRequestsRevision]; - } else { - proofRequests = new IdentityRequest(); - proofRequests.setIdentityId(id.toBuffer()); - proofRequests.setRequestType(IdentityRequest.Type.FULL_IDENTITY); - } - - return proofRequests; - }); - - requestV0.setIdentitiesList(identitiesList); - } if (stateTransition.isDataContractStateTransition()) { - const { ContractRequest } = GetProofsRequestV0; - - const contractsList = modifiedIds.map((id) => { - const identityRequest = new ContractRequest(); - identityRequest.setContractId(id.toBuffer()); - return identityRequest; - }); - - requestV0.setContractsList(contractsList); - } if (stateTransition.isVotingStateTransition()) { - const { VoteStatusRequest } = GetProofsRequestV0; - const { ContestedResourceVoteStatusRequest } = VoteStatusRequest; - - const contestedResourceVoteStatusRequest = new ContestedResourceVoteStatusRequest(); - - const contestedVotePoll = stateTransition.getContestedDocumentResourceVotePoll(); - - if (!contestedVotePoll) { - throw new Error('Masternode vote state transition should have a contested vote poll'); - } - - contestedResourceVoteStatusRequest.setContractId(contestedVotePoll.contractId.toBuffer()); - contestedResourceVoteStatusRequest.setDocumentTypeName(contestedVotePoll.documentTypeName); - contestedResourceVoteStatusRequest.setIndexName(contestedVotePoll.indexName); - contestedResourceVoteStatusRequest.setIndexValuesList(contestedVotePoll.indexValues); - contestedResourceVoteStatusRequest.setVoterIdentifier( - stateTransition.getProTxHash().toBuffer(), - ); - - const voteStatus = new VoteStatusRequest(); - voteStatus.setContestedResourceVoteStatusRequest(contestedResourceVoteStatusRequest); - - requestV0.setVotesList([voteStatus]); - } - const request = new GetProofsRequest(); - request.setV0(requestV0); + + request.setStateTransition(stateTransition); return driveClient.getProofs(request); } diff --git a/packages/dapi/lib/grpcServer/handlers/platform/waitForStateTransitionResultHandlerFactory.js b/packages/dapi/lib/grpcServer/handlers/platform/waitForStateTransitionResultHandlerFactory.js index 104a8f2671a..70e1ed233e8 100644 --- a/packages/dapi/lib/grpcServer/handlers/platform/waitForStateTransitionResultHandlerFactory.js +++ b/packages/dapi/lib/grpcServer/handlers/platform/waitForStateTransitionResultHandlerFactory.js @@ -112,19 +112,17 @@ function waitForStateTransitionResultHandlerFactory( v0.setError(error); response.setV0(v0); + return response; } if (prove) { - const stateTransition = await dpp.stateTransition.createFromBuffer( - result.getTransaction(), - { skipValidation: true }, - ); + const stateTransitionProof = await fetchProofForStateTransition(result.getTransaction()); - const stateTransitionProof = await fetchProofForStateTransition(stateTransition); v0.setMetadata(stateTransitionProof.getV0().getMetadata()); v0.setProof(stateTransitionProof.getV0().getProof()); } + response.setV0(v0); return response; diff --git a/packages/rs-drive-abci/src/query/proofs/mod.rs b/packages/rs-drive-abci/src/query/proofs/mod.rs index 6921e014d53..9574e2c1de1 100644 --- a/packages/rs-drive-abci/src/query/proofs/mod.rs +++ b/packages/rs-drive-abci/src/query/proofs/mod.rs @@ -1,10 +1,10 @@ +use crate::abci::AbciError; +use crate::error::execution::ExecutionError; use crate::error::query::QueryError; use crate::error::Error; use crate::platform_types::platform::Platform; use crate::platform_types::platform_state::PlatformState; use crate::query::QueryValidationResult; -use dapi_grpc::platform::v0::get_proofs_request::Version as RequestVersion; -use dapi_grpc::platform::v0::get_proofs_response::Version as ResponseVersion; use dapi_grpc::platform::v0::{GetProofsRequest, GetProofsResponse}; use dpp::version::PlatformVersion; @@ -14,40 +14,17 @@ impl Platform { /// Querying of platform proofs pub fn query_proofs( &self, - GetProofsRequest { version }: GetProofsRequest, + request: GetProofsRequest, platform_state: &PlatformState, platform_version: &PlatformVersion, ) -> Result, Error> { - let Some(version) = version else { - return Ok(QueryValidationResult::new_with_error( - QueryError::DecodingError("could not decode identity keys query".to_string()), - )); - }; - - let feature_version_bounds = &platform_version.drive_abci.query.proofs_query; - - let feature_version = match &version { - RequestVersion::V0(_) => 0, - }; - if !feature_version_bounds.check_version(feature_version) { - return Ok(QueryValidationResult::new_with_error( - QueryError::UnsupportedQueryVersion( - "proofs".to_string(), - feature_version_bounds.min_version, - feature_version_bounds.max_version, - platform_version.protocol_version, - feature_version, - ), - )); - } - match version { - RequestVersion::V0(request_v0) => { - let result = self.query_proofs_v0(request_v0, platform_state, platform_version)?; - - Ok(result.map(|response_v0| GetProofsResponse { - version: Some(ResponseVersion::V0(response_v0)), - })) - } + match platform_version.drive_abci.query.proofs_query { + 0 => self.query_proofs_v0(request, platform_state, platform_version), + version => Err(Error::Execution(ExecutionError::UnknownVersionMismatch { + method: "query_proofs".to_string(), + known_versions: vec![0], + received: version, + })), } } } diff --git a/packages/rs-drive-abci/src/query/proofs/v0/mod.rs b/packages/rs-drive-abci/src/query/proofs/v0/mod.rs index bdd37055003..437f1a5d1fc 100644 --- a/packages/rs-drive-abci/src/query/proofs/v0/mod.rs +++ b/packages/rs-drive-abci/src/query/proofs/v0/mod.rs @@ -3,51 +3,351 @@ use crate::error::Error; use crate::platform_types::platform::Platform; use crate::platform_types::platform_state::PlatformState; use crate::query::QueryValidationResult; -use dapi_grpc::platform::v0::get_proofs_request::get_proofs_request_v0::vote_status_request::RequestType; -use dapi_grpc::platform::v0::get_proofs_request::get_proofs_request_v0::{ - IdentityTokenBalanceRequest, IdentityTokenInfoRequest, TokenStatusRequest, -}; -use dapi_grpc::platform::v0::get_proofs_request::GetProofsRequestV0; -use dapi_grpc::platform::v0::get_proofs_response::{get_proofs_response_v0, GetProofsResponseV0}; -use dpp::check_validation_result_with_data; -use dpp::platform_value::Bytes32; +use dapi_grpc::platform::v0::{GetProofsRequest, GetProofsResponse}; +use dpp::balances::credits::TokenAmount; +use dpp::block::block_info::BlockInfo; +use dpp::data_contract::accessors::v0::DataContractV0Getters; +use dpp::data_contract::accessors::v1::DataContractV1Getters; +use dpp::data_contract::associated_token::token_configuration::accessors::v0::TokenConfigurationV0Getters; +use dpp::data_contract::associated_token::token_keeps_history_rules::accessors::v0::TokenKeepsHistoryRulesV0Getters; +use dpp::data_contract::document_type::accessors::DocumentTypeV0Getters; +use dpp::data_contract::TokenConfiguration; +use dpp::data_contracts::SystemDataContract; +use dpp::document::property_names::PRICE; +use dpp::document::Document; +use dpp::fee::Credits; +use dpp::identity::PartialIdentity; use dpp::prelude::Identifier; -use dpp::validation::ValidationResult; -use dpp::version::PlatformVersion; -use dpp::voting::vote_polls::contested_document_resource_vote_poll::ContestedDocumentResourceVotePoll; +use dpp::serialization::PlatformDeserializable; +use dpp::state_transition::batch_transition::accessors::DocumentsBatchTransitionAccessorsV0; +use dpp::state_transition::batch_transition::batched_transition::document_transition::{ + DocumentTransition, DocumentTransitionV0Methods, +}; +use dpp::state_transition::batch_transition::batched_transition::token_transition::{ + TokenTransition, TokenTransitionV0Methods, +}; +use dpp::state_transition::batch_transition::batched_transition::BatchedTransitionRef; +use dpp::state_transition::batch_transition::document_base_transition::v0::v0_methods::DocumentBaseTransitionV0Methods; +use dpp::state_transition::batch_transition::document_create_transition::v0::v0_methods::DocumentCreateTransitionV0Methods; +use dpp::state_transition::batch_transition::token_base_transition::v0::v0_methods::TokenBaseTransitionV0Methods; +use dpp::state_transition::batch_transition::token_mint_transition::v0::v0_methods::TokenMintTransitionV0Methods; +use dpp::state_transition::batch_transition::token_transfer_transition::v0::v0_methods::TokenTransferTransitionV0Methods; +use dpp::state_transition::identity_create_transition::accessors::IdentityCreateTransitionAccessorsV0; +use dpp::state_transition::identity_credit_transfer_transition::accessors::IdentityCreditTransferTransitionAccessorsV0; +use dpp::state_transition::identity_credit_withdrawal_transition::accessors::IdentityCreditWithdrawalTransitionAccessorsV0; +use dpp::state_transition::identity_topup_transition::accessors::IdentityTopUpTransitionAccessorsV0; +use dpp::state_transition::identity_update_transition::accessors::IdentityUpdateTransitionAccessorsV0; +use dpp::state_transition::proof_result::StateTransitionProofResult::{ + VerifiedDocuments, VerifiedPartialIdentity, VerifiedTokenActionWithDocument, + VerifiedTokenBalance, VerifiedTokenIdentitiesBalances, VerifiedTokenIdentityInfo, +}; +use dpp::state_transition::{StateTransition, StateTransitionLike}; +use dpp::system_data_contracts::load_system_data_contract; +use dpp::tokens::info::v0::IdentityTokenInfoV0Accessors; +use dpp::voting::vote_polls::VotePoll; +use dpp::voting::votes::Vote; +use drive::drive::identity::key::fetch::IdentityKeysRequest; use drive::drive::identity::{IdentityDriveQuery, IdentityProveRequestType}; -use drive::query::identity_token_balance_drive_query::IdentityTokenBalanceDriveQuery; -use drive::query::identity_token_info_drive_query::IdentityTokenInfoDriveQuery; -use drive::query::token_status_drive_query::TokenStatusDriveQuery; -use drive::query::{IdentityBasedVoteDriveQuery, SingleDocumentDriveQuery}; +use drive::drive::Drive; +use drive::error::proof::ProofError; +use drive::query::{PathQuery, SingleDocumentDriveQuery, SingleDocumentDriveQueryContestedStatus}; +use drive::verify::RootHash; +use platform_version::version::PlatformVersion; +use std::collections::BTreeMap; + +fn contract_ids_to_non_historical_path_query(contract_ids: &[Identifier]) -> PathQuery { + let contract_ids = contract_ids.iter().map(|id| id.0).collect(); + + let mut path_query = Drive::fetch_non_historical_contracts_query(contract_ids); + path_query.query.limit = None; + path_query +} impl Platform { pub(super) fn query_proofs_v0( &self, - GetProofsRequestV0 { - identities, - contracts, - documents, - votes, - identity_token_balances, - identity_token_infos, - token_statuses, - }: GetProofsRequestV0, + GetProofsRequest { + state_transition: state_transition_bytes, + }: GetProofsRequest, platform_state: &PlatformState, platform_version: &PlatformVersion, - ) -> Result, Error> { - let contract_ids = check_validation_result_with_data!(contracts - .into_iter() - .map(|contract_request| { - Bytes32::from_vec(contract_request.contract_id) - .map(|bytes| (bytes.0, None)) - .map_err(|_| { - QueryError::InvalidArgument( - "id must be a valid identifier (32 bytes long)".to_string(), - ) - }) - }) - .collect::)>, QueryError>>()); + ) -> Result, Error> { + let state_transition: StateTransition = + StateTransition::deserialize_from_bytes(&state_transition_bytes)?; + + let path_query = match state_transition { + StateTransition::DataContractCreate(st) => { + contract_ids_to_non_historical_path_query(&st.modified_data_ids()) + } + StateTransition::DataContractUpdate(st) => { + contract_ids_to_non_historical_path_query(&st.modified_data_ids()) + } + StateTransition::Batch(st) => { + if st.transitions_len() > 1 { + return Err(QueryError::Proof(ProofError::InvalidTransition( + "batch state transition must have only one batched transition".to_string(), + )) + .into()); + } + let Some(transition) = st.first_transition() else { + return Err(QueryError::Proof(ProofError::InvalidTransition( + "batch state transition must have one batched transition".to_string(), + )) + .into()); + }; + + let owner_id = st.owner_id(); + + match transition { + BatchedTransitionRef::Document(document_transition) => { + let data_contract_id = document_transition.data_contract_id(); + + let Some(contract_fetch_info) = self.drive.get_contract_with_fetch_info( + data_contract_id.to_buffer(), + false, + None, + platform_version, + )? + else { + return Err(drive::error::Error::Proof(ProofError::UnknownContract( + format!("unknown contract with id {}", data_contract_id), + )) + .into()); + }; + + let contract = &contract_fetch_info.contract; + + let document_type = contract + .document_type_for_name(document_transition.document_type_name()) + .map_err(|e| { + drive::error::Error::Proof(ProofError::UnknownContract(format!( + "cannot fetch contract for document {} with id {}: {}", + document_transition.document_type_name(), + document_transition.data_contract_id(), + e + ))) + })?; + + let contested_status = + if let DocumentTransition::Create(create_transition) = + document_transition + { + if create_transition.prefunded_voting_balance().is_some() { + SingleDocumentDriveQueryContestedStatus::Contested + } else { + SingleDocumentDriveQueryContestedStatus::NotContested + } + } else { + SingleDocumentDriveQueryContestedStatus::NotContested + }; + + let query = SingleDocumentDriveQuery { + contract_id: document_transition.data_contract_id().into_buffer(), + document_type_name: document_transition.document_type_name().clone(), + document_type_keeps_history: document_type.documents_keep_history(), + document_id: document_transition.base().id().into_buffer(), + block_time_ms: None, //None because we want latest + contested_status, + }; + + let mut path_query = query.construct_path_query(platform_version).ok()?; + path_query.query.limit = None; + path_query + } + BatchedTransitionRef::Token(token_transition) => { + //todo group actions + let data_contract_id = token_transition.data_contract_id(); + let token_id = token_transition.token_id(); + + let Some(contract_fetch_info) = self.drive.get_contract_with_fetch_info( + data_contract_id.to_buffer(), + false, + None, + platform_version, + )? + else { + return Err(drive::error::Error::Proof(ProofError::UnknownContract( + format!("unknown contract with id {}", data_contract_id), + )) + .into()); + }; + + let contract = &contract_fetch_info.contract; + + let identity_contract_nonce = + token_transition.base().identity_contract_nonce(); + + let token_history_document_type_name = + token_transition.historical_document_type_name().to_string(); + + let token_history_contract = + self.drive.cache.system_data_contracts.load_token_history(); + + let token_history_document_type = + token_transition.historical_document_type(&token_history_contract)?; + + let token_config = contract.expected_token_configuration( + token_transition.base().token_contract_position(), + )?; + + let keeps_historical_document = token_config.keeps_history(); + + match token_transition { + TokenTransition::Burn(_) => { + if keeps_historical_document.keeps_burning_history() { + create_token_historical_document_query( + token_transition, + token_config, + owner_id, + platform_version, + )? + } else { + Drive::token_balance_for_identity_id_query( + token_id.to_buffer(), + owner_id.to_buffer(), + ) + } + } + TokenTransition::Mint(token_mint_transition) => { + if keeps_historical_document.keeps_minting_history() { + create_token_historical_document_query( + token_transition, + token_config, + owner_id, + platform_version, + )? + } else { + let recipient_id = + token_mint_transition.recipient_id(token_config)?; + + Drive::token_balance_for_identity_id_query( + token_id.into_buffer(), + recipient_id.into_buffer(), + ) + } + } + TokenTransition::Transfer(token_transfer_transition) => { + if keeps_historical_document.keeps_transfer_history() { + create_token_historical_document_query( + token_transition, + token_config, + owner_id, + platform_version, + )? + } else { + let recipient_id = token_transfer_transition.recipient_id(); + let identity_ids = + [owner_id.to_buffer(), recipient_id.to_buffer()]; + + Drive::token_balances_for_identity_ids_query( + token_id.into_buffer(), + &identity_ids, + ) + } + } + TokenTransition::Freeze(token_freeze_transition) => { + if keeps_historical_document.keeps_freezing_history() { + create_token_historical_document_query( + token_transition, + token_config, + owner_id, + platform_version, + )? + } else { + Drive::token_info_for_identity_id_query( + token_id.to_buffer(), + owner_id.to_buffer(), + ) + } + } + TokenTransition::Unfreeze(token_unfreeze_transition) => { + if keeps_historical_document.keeps_freezing_history() { + create_token_historical_document_query( + token_transition, + token_config, + owner_id, + platform_version, + )? + } else { + Drive::token_info_for_identity_id_query( + token_id.to_buffer(), + owner_id.to_buffer(), + ) + } + } + TokenTransition::DestroyFrozenFunds(_) + | TokenTransition::EmergencyAction(_) + | TokenTransition::ConfigUpdate(_) + | TokenTransition::Claim(_) => create_token_historical_document_query( + token_transition, + token_config, + owner_id, + platform_version, + )?, + } + } + } + } + StateTransition::IdentityCreate(st) => Drive::full_identity_query( + &st.identity_id().into_buffer(), + &platform_version.drive.grove_version, + )?, + StateTransition::IdentityTopUp(st) => { + // we expect to get a new balance and revision + Drive::revision_and_balance_path_query( + st.identity_id().to_buffer(), + &platform_version.drive.grove_version, + )? + } + StateTransition::IdentityCreditWithdrawal(st) => { + Drive::identity_balance_query(&st.identity_id().to_buffer()) + } + StateTransition::IdentityUpdate(st) => Drive::identity_all_keys_query( + &st.identity_id().to_buffer(), + &platform_version.drive.grove_version, + )?, + StateTransition::IdentityCreditTransfer(st) => { + let sender_query = Drive::identity_balance_query(&st.identity_id().into_buffer()); + let recipient_query = + Drive::identity_balance_query(&st.recipient_id().into_buffer()); + + PathQuery::merge( + vec![&sender_query, &recipient_query], + &platform_version.drive.grove_version, + )? + } + StateTransition::MasternodeVote(st) => { + let pro_tx_hash = masternode_vote.pro_tx_hash(); + let vote = masternode_vote.vote(); + let contract = match vote { + Vote::ResourceVote(resource_vote) => match resource_vote.vote_poll() { + VotePoll::ContestedDocumentResourceVotePoll( + contested_document_resource_vote_poll, + ) => known_contracts_provider_fn( + &contested_document_resource_vote_poll.contract_id, + )? + .ok_or(drive::error::Error::Proof( + ProofError::UnknownContract(format!( + "unknown contract with id {}", + contested_document_resource_vote_poll.contract_id + )), + ))?, + }, + }; + + Drive:: + + // we expect to get a vote that matches the state transition + πlet(root_hash, vote) = Drive::verify_masternode_vote( + proof, + pro_tx_hash.to_buffer(), + vote, + &contract, + false, + platform_version, + )?; + } + }; let identity_requests = check_validation_result_with_data!(identities .into_iter() @@ -76,37 +376,6 @@ impl Platform { }) .collect::, QueryError>>()); - let document_queries = check_validation_result_with_data!(documents - .into_iter() - .map(|document_proof_request| { - let contract_id: Identifier = - document_proof_request.contract_id.try_into().map_err(|_| { - QueryError::InvalidArgument( - "id must be a valid identifier (32 bytes long)".to_string(), - ) - })?; - let document_id: Identifier = - document_proof_request.document_id.try_into().map_err(|_| { - QueryError::InvalidArgument( - "id must be a valid identifier (32 bytes long)".to_string(), - ) - })?; - - let contested_status = document_proof_request - .document_contested_status - .try_into()?; - - Ok(SingleDocumentDriveQuery { - contract_id: contract_id.into_buffer(), - document_type_name: document_proof_request.document_type, - document_type_keeps_history: document_proof_request.document_type_keeps_history, - document_id: document_id.into_buffer(), - block_time_ms: None, //None because we want latest - contested_status, - }) - }) - .collect::, QueryError>>()); - let vote_queries = check_validation_result_with_data!(votes .into_iter() .filter_map(|vote_proof_request| { @@ -235,6 +504,37 @@ impl Platform { } } +fn create_token_historical_document_query( + token_transition: &TokenTransition, + token_config: &TokenConfiguration, + owner_id: Identifier, + platform_version: &PlatformVersion, +) -> Result { + let token_history_contract = + load_system_data_contract(SystemDataContract::TokenHistory, platform_version)?; + + let Some(token_event) = token_transition.associated_token_event(token_config, owner_id)? else { + unreachable!("verify_token_historical_event must be called only for token transitions that have an associated token event"); + }; + + let token_id = token_transition.token_id(); + let owner_nonce = token_transition.base().identity_contract_nonce(); + + let query = SingleDocumentDriveQuery { + contract_id: token_history_contract.id().into_buffer(), + document_type_name: token_event.associated_document_type_name().to_string(), + document_type_keeps_history: false, + document_id: token_event + .associated_document_id(token_id, owner_id, owner_nonce) + .to_buffer(), + block_time_ms: None, //None because we want latest + contested_status: SingleDocumentDriveQueryContestedStatus::NotContested, + }; + + let token_history_document_type = token_history_contract + .document_type_for_name(token_event.associated_document_type_name())?; +} + #[cfg(test)] mod tests { use super::*; diff --git a/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_query_versions/mod.rs b/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_query_versions/mod.rs index 7a5d65bd3ea..32bbf30423b 100644 --- a/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_query_versions/mod.rs +++ b/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_query_versions/mod.rs @@ -6,7 +6,7 @@ use versioned_feature_core::{FeatureVersion, FeatureVersionBounds}; pub struct DriveAbciQueryVersions { pub max_returned_elements: u16, pub response_metadata: FeatureVersion, - pub proofs_query: FeatureVersionBounds, + pub proofs_query: FeatureVersion, pub document_query: FeatureVersionBounds, pub prefunded_specialized_balances: DriveAbciQueryPrefundedSpecializedBalancesVersions, pub identity_based_queries: DriveAbciQueryIdentityVersions, diff --git a/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_query_versions/v1.rs b/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_query_versions/v1.rs index 494dfa6f097..ee268432199 100644 --- a/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_query_versions/v1.rs +++ b/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_query_versions/v1.rs @@ -9,11 +9,7 @@ use versioned_feature_core::FeatureVersionBounds; pub const DRIVE_ABCI_QUERY_VERSIONS_V1: DriveAbciQueryVersions = DriveAbciQueryVersions { max_returned_elements: 100, response_metadata: 0, - proofs_query: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, + proofs_query: 0, document_query: FeatureVersionBounds { min_version: 0, max_version: 0, diff --git a/packages/rs-platform-version/src/version/mocks/v2_test.rs b/packages/rs-platform-version/src/version/mocks/v2_test.rs index 3b8d73f2735..d5a376858a6 100644 --- a/packages/rs-platform-version/src/version/mocks/v2_test.rs +++ b/packages/rs-platform-version/src/version/mocks/v2_test.rs @@ -147,11 +147,7 @@ pub const TEST_PLATFORM_V2: PlatformVersion = PlatformVersion { query: DriveAbciQueryVersions { max_returned_elements: 100, response_metadata: 0, - proofs_query: FeatureVersionBounds { - min_version: 0, - max_version: 0, - default_current_version: 0, - }, + proofs_query: 0, document_query: FeatureVersionBounds { min_version: 0, max_version: 0, From 548ea2e278932f2886fafeecb7ec20f096fe3ce3 Mon Sep 17 00:00:00 2001 From: Ivan Shumkov Date: Wed, 9 Apr 2025 23:01:50 +0700 Subject: [PATCH 02/15] chore: update dapi-gprc, drive-aci and dapi --- .pnp.cjs | 1 - packages/dapi-grpc/Cargo.toml | 4 +- packages/dapi-grpc/build.rs | 3 - .../clients/drive/v0/nodejs/drive_protoc.js | 24 +- .../clients/drive/v0/web/drive_pb.d.ts | 14 +- .../clients/drive/v0/web/drive_pb.js | 24 +- packages/dapi-grpc/lib/getDriveDefinition.js | 11 + packages/dapi-grpc/node.js | 19 ++ .../dapi-grpc/protos/drive/v0/drive.proto | 2 +- packages/dapi-grpc/scripts/build.sh | 23 +- .../dapi-grpc/scripts/patch-protobuf-js.sh | 2 + packages/dapi-grpc/src/lib.rs | 23 ++ packages/dapi/lib/dpp/DriveStateRepository.js | 42 --- .../fetchProofForStateTransitionFactory.js | 73 +---- .../platform/getStatusHandlerFactory.js | 2 +- .../platform/platformHandlersFactory.js | 11 +- ...tForStateTransitionResultHandlerFactory.js | 2 - packages/dapi/package.json | 1 - packages/dapi/scripts/api.js | 13 +- .../templates/platform/gateway/envoy.yaml.dot | 15 - .../accessors/mod.rs | 6 + .../accessors/v0/mod.rs | 1 + .../rs-drive-abci/src/query/proofs/mod.rs | 4 +- .../rs-drive-abci/src/query/proofs/v0/mod.rs | 298 ++++-------------- packages/rs-drive-abci/src/query/service.rs | 41 +-- packages/rs-drive-abci/src/server.rs | 13 +- yarn.lock | 3 +- 27 files changed, 221 insertions(+), 454 deletions(-) create mode 100644 packages/dapi-grpc/lib/getDriveDefinition.js delete mode 100644 packages/dapi/lib/dpp/DriveStateRepository.js diff --git a/.pnp.cjs b/.pnp.cjs index c92c2a3a410..b1be42c17e5 100755 --- a/.pnp.cjs +++ b/.pnp.cjs @@ -2444,7 +2444,6 @@ const RAW_RUNTIME_STATE = ["@dashevo/dashd-rpc", "npm:19.0.0"],\ ["@dashevo/dp-services-ctl", "https://github.com/dashevo/js-dp-services-ctl.git#commit=3976076b0018c5b4632ceda4c752fc597f27a640"],\ ["@dashevo/grpc-common", "workspace:packages/js-grpc-common"],\ - ["@dashevo/token-history-contract", "workspace:packages/token-history-contract"],\ ["@dashevo/wasm-dpp", "workspace:packages/wasm-dpp"],\ ["@grpc/grpc-js", "npm:1.4.4"],\ ["@pshenmic/zeromq", "npm:6.0.0-beta.22"],\ diff --git a/packages/dapi-grpc/Cargo.toml b/packages/dapi-grpc/Cargo.toml index 85426703b00..b225efc9ad7 100644 --- a/packages/dapi-grpc/Cargo.toml +++ b/packages/dapi-grpc/Cargo.toml @@ -15,6 +15,8 @@ license = "MIT" [features] default = ["core", "platform", "client"] +# Internal Drive endpoints. Used by DAPI +drive = ["platform"] core = [] platform = [] # Re-export Dash Platform protobuf types as `dapi_grpc::platform::proto` @@ -25,7 +27,7 @@ tenderdash-proto = [] client = ["platform"] # Build tonic server code. Includes all client features and adds server-specific dependencies. -server = ["platform", "tenderdash-proto/server", "client"] +server = ["platform", "tenderdash-proto/server", "client", "drive"] serde = ["dep:serde", "dep:serde_bytes", "tenderdash-proto/serde"] mocks = ["serde", "dep:serde_json"] diff --git a/packages/dapi-grpc/build.rs b/packages/dapi-grpc/build.rs index 5a922bdf36f..4018934e93b 100644 --- a/packages/dapi-grpc/build.rs +++ b/packages/dapi-grpc/build.rs @@ -219,8 +219,6 @@ fn configure_platform(mut platform: MappingConfig) -> MappingConfig { } fn configure_drive(drive: MappingConfig) -> MappingConfig { - let platform_proto_path = abs_path(&PathBuf::from("protos/platform/v0")); - drive .message_attribute(".", r#"#[derive( ::dapi_grpc_macros::Mockable)]"#) .type_attribute( @@ -231,7 +229,6 @@ fn configure_drive(drive: MappingConfig) -> MappingConfig { ".", r#"#[cfg_attr(feature = "serde", serde(rename_all = "snake_case"))]"#, ) - .includes(&[platform_proto_path]) } /// Check for duplicate messages in the list. diff --git a/packages/dapi-grpc/clients/drive/v0/nodejs/drive_protoc.js b/packages/dapi-grpc/clients/drive/v0/nodejs/drive_protoc.js index 041dacca666..d43136990a8 100644 --- a/packages/dapi-grpc/clients/drive/v0/nodejs/drive_protoc.js +++ b/packages/dapi-grpc/clients/drive/v0/nodejs/drive_protoc.js @@ -15,8 +15,8 @@ var jspb = require('google-protobuf'); var goog = jspb; const proto = {}; -var platform_pb = require('./platform_pb.js'); -goog.object.extend(proto, platform_pb); +var platform_v0_platform_pb = require('../../../platform/v0/web/platform_pb.js'); +goog.object.extend(proto, platform_v0_platform_pb); goog.exportSymbol('proto.org.dash.platform.drive.v0.GetProofsRequest', null, { proto }); goog.exportSymbol('proto.org.dash.platform.drive.v0.GetProofsResponse', null, { proto }); /** @@ -247,8 +247,8 @@ proto.org.dash.platform.drive.v0.GetProofsResponse.prototype.toObject = function */ proto.org.dash.platform.drive.v0.GetProofsResponse.toObject = function(includeInstance, msg) { var f, obj = { - proof: (f = msg.getProof()) && platform_pb.Proof.toObject(includeInstance, f), - metadata: (f = msg.getMetadata()) && platform_pb.ResponseMetadata.toObject(includeInstance, f) + proof: (f = msg.getProof()) && platform_v0_platform_pb.Proof.toObject(includeInstance, f), + metadata: (f = msg.getMetadata()) && platform_v0_platform_pb.ResponseMetadata.toObject(includeInstance, f) }; if (includeInstance) { @@ -286,13 +286,13 @@ proto.org.dash.platform.drive.v0.GetProofsResponse.deserializeBinaryFromReader = var field = reader.getFieldNumber(); switch (field) { case 1: - var value = new platform_pb.Proof; - reader.readMessage(value,platform_pb.Proof.deserializeBinaryFromReader); + var value = new platform_v0_platform_pb.Proof; + reader.readMessage(value,platform_v0_platform_pb.Proof.deserializeBinaryFromReader); msg.setProof(value); break; case 2: - var value = new platform_pb.ResponseMetadata; - reader.readMessage(value,platform_pb.ResponseMetadata.deserializeBinaryFromReader); + var value = new platform_v0_platform_pb.ResponseMetadata; + reader.readMessage(value,platform_v0_platform_pb.ResponseMetadata.deserializeBinaryFromReader); msg.setMetadata(value); break; default: @@ -329,7 +329,7 @@ proto.org.dash.platform.drive.v0.GetProofsResponse.serializeBinaryToWriter = fun writer.writeMessage( 1, f, - platform_pb.Proof.serializeBinaryToWriter + platform_v0_platform_pb.Proof.serializeBinaryToWriter ); } f = message.getMetadata(); @@ -337,7 +337,7 @@ proto.org.dash.platform.drive.v0.GetProofsResponse.serializeBinaryToWriter = fun writer.writeMessage( 2, f, - platform_pb.ResponseMetadata.serializeBinaryToWriter + platform_v0_platform_pb.ResponseMetadata.serializeBinaryToWriter ); } }; @@ -349,7 +349,7 @@ proto.org.dash.platform.drive.v0.GetProofsResponse.serializeBinaryToWriter = fun */ proto.org.dash.platform.drive.v0.GetProofsResponse.prototype.getProof = function() { return /** @type{?proto.org.dash.platform.dapi.v0.Proof} */ ( - jspb.Message.getWrapperField(this, platform_pb.Proof, 1)); + jspb.Message.getWrapperField(this, platform_v0_platform_pb.Proof, 1)); }; @@ -386,7 +386,7 @@ proto.org.dash.platform.drive.v0.GetProofsResponse.prototype.hasProof = function */ proto.org.dash.platform.drive.v0.GetProofsResponse.prototype.getMetadata = function() { return /** @type{?proto.org.dash.platform.dapi.v0.ResponseMetadata} */ ( - jspb.Message.getWrapperField(this, platform_pb.ResponseMetadata, 2)); + jspb.Message.getWrapperField(this, platform_v0_platform_pb.ResponseMetadata, 2)); }; diff --git a/packages/dapi-grpc/clients/drive/v0/web/drive_pb.d.ts b/packages/dapi-grpc/clients/drive/v0/web/drive_pb.d.ts index a1225a6bc4d..eb5d4905513 100644 --- a/packages/dapi-grpc/clients/drive/v0/web/drive_pb.d.ts +++ b/packages/dapi-grpc/clients/drive/v0/web/drive_pb.d.ts @@ -2,7 +2,7 @@ // file: drive.proto import * as jspb from "google-protobuf"; -import * as platform_pb from "./platform_pb"; +import * as platform_v0_platform_pb from "./platform/v0/platform_pb"; export class GetProofsRequest extends jspb.Message { getStateTransition(): Uint8Array | string; @@ -29,13 +29,13 @@ export namespace GetProofsRequest { export class GetProofsResponse extends jspb.Message { hasProof(): boolean; clearProof(): void; - getProof(): platform_pb.Proof | undefined; - setProof(value?: platform_pb.Proof): void; + getProof(): platform_v0_platform_pb.Proof | undefined; + setProof(value?: platform_v0_platform_pb.Proof): void; hasMetadata(): boolean; clearMetadata(): void; - getMetadata(): platform_pb.ResponseMetadata | undefined; - setMetadata(value?: platform_pb.ResponseMetadata): void; + getMetadata(): platform_v0_platform_pb.ResponseMetadata | undefined; + setMetadata(value?: platform_v0_platform_pb.ResponseMetadata): void; serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): GetProofsResponse.AsObject; @@ -49,8 +49,8 @@ export class GetProofsResponse extends jspb.Message { export namespace GetProofsResponse { export type AsObject = { - proof?: platform_pb.Proof.AsObject, - metadata?: platform_pb.ResponseMetadata.AsObject, + proof?: platform_v0_platform_pb.Proof.AsObject, + metadata?: platform_v0_platform_pb.ResponseMetadata.AsObject, } } diff --git a/packages/dapi-grpc/clients/drive/v0/web/drive_pb.js b/packages/dapi-grpc/clients/drive/v0/web/drive_pb.js index 041dacca666..d43136990a8 100644 --- a/packages/dapi-grpc/clients/drive/v0/web/drive_pb.js +++ b/packages/dapi-grpc/clients/drive/v0/web/drive_pb.js @@ -15,8 +15,8 @@ var jspb = require('google-protobuf'); var goog = jspb; const proto = {}; -var platform_pb = require('./platform_pb.js'); -goog.object.extend(proto, platform_pb); +var platform_v0_platform_pb = require('../../../platform/v0/web/platform_pb.js'); +goog.object.extend(proto, platform_v0_platform_pb); goog.exportSymbol('proto.org.dash.platform.drive.v0.GetProofsRequest', null, { proto }); goog.exportSymbol('proto.org.dash.platform.drive.v0.GetProofsResponse', null, { proto }); /** @@ -247,8 +247,8 @@ proto.org.dash.platform.drive.v0.GetProofsResponse.prototype.toObject = function */ proto.org.dash.platform.drive.v0.GetProofsResponse.toObject = function(includeInstance, msg) { var f, obj = { - proof: (f = msg.getProof()) && platform_pb.Proof.toObject(includeInstance, f), - metadata: (f = msg.getMetadata()) && platform_pb.ResponseMetadata.toObject(includeInstance, f) + proof: (f = msg.getProof()) && platform_v0_platform_pb.Proof.toObject(includeInstance, f), + metadata: (f = msg.getMetadata()) && platform_v0_platform_pb.ResponseMetadata.toObject(includeInstance, f) }; if (includeInstance) { @@ -286,13 +286,13 @@ proto.org.dash.platform.drive.v0.GetProofsResponse.deserializeBinaryFromReader = var field = reader.getFieldNumber(); switch (field) { case 1: - var value = new platform_pb.Proof; - reader.readMessage(value,platform_pb.Proof.deserializeBinaryFromReader); + var value = new platform_v0_platform_pb.Proof; + reader.readMessage(value,platform_v0_platform_pb.Proof.deserializeBinaryFromReader); msg.setProof(value); break; case 2: - var value = new platform_pb.ResponseMetadata; - reader.readMessage(value,platform_pb.ResponseMetadata.deserializeBinaryFromReader); + var value = new platform_v0_platform_pb.ResponseMetadata; + reader.readMessage(value,platform_v0_platform_pb.ResponseMetadata.deserializeBinaryFromReader); msg.setMetadata(value); break; default: @@ -329,7 +329,7 @@ proto.org.dash.platform.drive.v0.GetProofsResponse.serializeBinaryToWriter = fun writer.writeMessage( 1, f, - platform_pb.Proof.serializeBinaryToWriter + platform_v0_platform_pb.Proof.serializeBinaryToWriter ); } f = message.getMetadata(); @@ -337,7 +337,7 @@ proto.org.dash.platform.drive.v0.GetProofsResponse.serializeBinaryToWriter = fun writer.writeMessage( 2, f, - platform_pb.ResponseMetadata.serializeBinaryToWriter + platform_v0_platform_pb.ResponseMetadata.serializeBinaryToWriter ); } }; @@ -349,7 +349,7 @@ proto.org.dash.platform.drive.v0.GetProofsResponse.serializeBinaryToWriter = fun */ proto.org.dash.platform.drive.v0.GetProofsResponse.prototype.getProof = function() { return /** @type{?proto.org.dash.platform.dapi.v0.Proof} */ ( - jspb.Message.getWrapperField(this, platform_pb.Proof, 1)); + jspb.Message.getWrapperField(this, platform_v0_platform_pb.Proof, 1)); }; @@ -386,7 +386,7 @@ proto.org.dash.platform.drive.v0.GetProofsResponse.prototype.hasProof = function */ proto.org.dash.platform.drive.v0.GetProofsResponse.prototype.getMetadata = function() { return /** @type{?proto.org.dash.platform.dapi.v0.ResponseMetadata} */ ( - jspb.Message.getWrapperField(this, platform_pb.ResponseMetadata, 2)); + jspb.Message.getWrapperField(this, platform_v0_platform_pb.ResponseMetadata, 2)); }; diff --git a/packages/dapi-grpc/lib/getDriveDefinition.js b/packages/dapi-grpc/lib/getDriveDefinition.js new file mode 100644 index 00000000000..30328fbd4c5 --- /dev/null +++ b/packages/dapi-grpc/lib/getDriveDefinition.js @@ -0,0 +1,11 @@ +const path = require('path'); + +const { loadPackageDefinition } = require('@dashevo/grpc-common'); + +function getDriveDefinition(version) { + const protoPath = path.join(__dirname, `../protos/drive/v${version}/drive.proto`); + + return loadPackageDefinition(protoPath, `org.dash.platform.drive.v${version}.DriveInternal`); +} + +module.exports = getDriveDefinition; diff --git a/packages/dapi-grpc/node.js b/packages/dapi-grpc/node.js index 0d5821f866a..76f91c1235f 100644 --- a/packages/dapi-grpc/node.js +++ b/packages/dapi-grpc/node.js @@ -1,12 +1,15 @@ const { Metadata } = require('@grpc/grpc-js/build/src/metadata'); const CorePromiseClient = require('./clients/core/v0/nodejs/CorePromiseClient'); const PlatformPromiseClient = require('./clients/platform/v0/nodejs/PlatformPromiseClient'); +const DrivePromiseClient = require('./clients/drive/v0/nodejs/DrivePromiseClient'); const protocCoreMessages = require('./clients/core/v0/nodejs/core_protoc'); const protocPlatformMessages = require('./clients/platform/v0/nodejs/platform_protoc'); +const protocDriveMessages = require('./clients/drive/v0/nodejs/drive_protoc'); const getCoreDefinition = require('./lib/getCoreDefinition'); const getPlatformDefinition = require('./lib/getPlatformDefinition'); +const getDriveDefinition = require('./lib/getDriveDefinition'); const parseMetadata = require('./lib/utils/parseMetadata'); const { @@ -33,19 +36,35 @@ const { }, } = require('./clients/platform/v0/nodejs/platform_pbjs'); +const { + org: { + dash: { + platform: { + drive: { + v0: pbjsDriveMessages, + }, + }, + }, + }, +} = require('./clients/drive/v0/nodejs/drive_pbjs'); + module.exports = { getCoreDefinition, getPlatformDefinition, + getDriveDefinition, v0: { CorePromiseClient, PlatformPromiseClient, + DrivePromiseClient, pbjs: { ...pbjsCoreMessages, ...pbjsPlatformMessages, + ...pbjsDriveMessages, }, ...protocCoreMessages, ...protocPlatformMessages, + ...protocDriveMessages, }, parseMetadata, Metadata, diff --git a/packages/dapi-grpc/protos/drive/v0/drive.proto b/packages/dapi-grpc/protos/drive/v0/drive.proto index bc4dd40e3a9..4cf11a97f1d 100644 --- a/packages/dapi-grpc/protos/drive/v0/drive.proto +++ b/packages/dapi-grpc/protos/drive/v0/drive.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package org.dash.platform.drive.v0; -import "platform.proto"; +import "platform/v0/platform.proto"; service DriveInternal { rpc getProofs(GetProofsRequest) returns (GetProofsResponse); diff --git a/packages/dapi-grpc/scripts/build.sh b/packages/dapi-grpc/scripts/build.sh index 41e113f1579..148404e9837 100755 --- a/packages/dapi-grpc/scripts/build.sh +++ b/packages/dapi-grpc/scripts/build.sh @@ -8,6 +8,8 @@ if [[ "${SKIP_GRPC_PROTO_BUILD}" == "1" ]]; then exit 0 fi +PROTOS_PATH="$PWD/protos" + CORE_PROTO_PATH="$PWD/protos/core/v0" CORE_CLIENTS_PATH="$PWD/clients/core/v0" @@ -74,13 +76,13 @@ rm -rf "${DRIVE_WEB_OUT_PATH:?}/*" || true docker run -v "$DRIVE_PROTO_PATH:$DRIVE_PROTO_PATH" \ -v "$DRIVE_WEB_OUT_PATH:$DRIVE_WEB_OUT_PATH" \ - -v "$PLATFORM_PROTO_PATH:$PLATFORM_PROTO_PATH" \ + -v "$PROTOS_PATH:$PROTOS_PATH" \ --rm \ "$PROTOC_IMAGE" \ --js_out="import_style=commonjs:$DRIVE_WEB_OUT_PATH" \ --ts_out="service=grpc-web:$DRIVE_WEB_OUT_PATH" \ -I="$DRIVE_PROTO_PATH" \ - -I="$PLATFORM_PROTO_PATH" \ + -I="$PROTOS_PATH" \ "drive.proto" # Clean node message classes @@ -96,7 +98,7 @@ pbjs \ -t static-module \ -w commonjs \ -r platform_root \ - -p "$PLATFORM_PROTO_PATH" \ + -p "$PROTOS_PATH" \ -o "$DRIVE_CLIENTS_PATH/nodejs/drive_pbjs.js" \ "$DRIVE_PROTO_PATH/drive.proto" @@ -108,11 +110,13 @@ rm -rf "${PLATFORM_WEB_OUT_PATH:?}/*" || true docker run -v "$PLATFORM_PROTO_PATH:$PLATFORM_PROTO_PATH" \ -v "$PLATFORM_WEB_OUT_PATH:$PLATFORM_WEB_OUT_PATH" \ + -v "$PROTOS_PATH:$PROTOS_PATH" \ --rm \ "$PROTOC_IMAGE" \ --js_out="import_style=commonjs:$PLATFORM_WEB_OUT_PATH" \ --ts_out="service=grpc-web:$PLATFORM_WEB_OUT_PATH" \ -I="$PLATFORM_PROTO_PATH" \ + -I="$PROTOS_PATH" \ "platform.proto" # Clean node message classes @@ -129,6 +133,7 @@ pbjs \ -w commonjs \ -r platform_root \ -o "$PLATFORM_CLIENTS_PATH/nodejs/platform_pbjs.js" \ + -p "$PROTOS_PATH" \ "$PLATFORM_PROTO_PATH/platform.proto" ################################### @@ -139,12 +144,14 @@ rm -rf "${CORE_JAVA_OUT_PATH:?}/*" || true docker run -v "$CORE_PROTO_PATH:$CORE_PROTO_PATH" \ -v "$CORE_JAVA_OUT_PATH:$CORE_JAVA_OUT_PATH" \ + -v "$PROTOS_PATH:$PROTOS_PATH" \ --rm \ "$PROTOC_IMAGE" \ --plugin=protoc-gen-grpc=/usr/bin/protoc-gen-grpc-java \ --grpc-java_out="$CORE_JAVA_OUT_PATH" \ --proto_path="$CORE_PROTO_PATH" \ -I="$CORE_PROTO_PATH" \ + -I="$PROTOS_PATH" \ "core.proto" ####################################### @@ -155,12 +162,14 @@ rm -rf "${PLATFORM_JAVA_OUT_PATH:?}/*" || true docker run -v "$PLATFORM_PROTO_PATH:$PLATFORM_PROTO_PATH" \ -v "$PLATFORM_JAVA_OUT_PATH:$PLATFORM_JAVA_OUT_PATH" \ + -v "$PROTOS_PATH:$PROTOS_PATH" \ --rm \ "$PROTOC_IMAGE" \ --plugin=protoc-gen-grpc=/usr/bin/protoc-gen-grpc-java \ --grpc-java_out="$PLATFORM_JAVA_OUT_PATH" \ --proto_path="$PLATFORM_PROTO_PATH" \ -I="$PLATFORM_PROTO_PATH" \ + -I="$PROTOS_PATH" \ "platform.proto" ########################################## @@ -171,6 +180,7 @@ rm -rf "${CORE_OBJ_C_OUT_PATH:?}/*" || true docker run -v "$CORE_PROTO_PATH:$CORE_PROTO_PATH" \ -v "$CORE_OBJ_C_OUT_PATH:$CORE_OBJ_C_OUT_PATH" \ + -v "$PROTOS_PATH:$PROTOS_PATH" \ --rm \ "$PROTOC_IMAGE" \ --plugin=protoc-gen-grpc=/usr/bin/grpc_objective_c_plugin \ @@ -178,6 +188,7 @@ docker run -v "$CORE_PROTO_PATH:$CORE_PROTO_PATH" \ --grpc_out="$CORE_OBJ_C_OUT_PATH" \ --proto_path="$CORE_PROTO_PATH" \ -I="$CORE_PROTO_PATH" \ + -I="$PROTOS_PATH" \ "core.proto" ############################################## @@ -188,6 +199,7 @@ rm -rf "${PLATFORM_OBJ_C_OUT_PATH:?}/*" || true docker run -v "$PLATFORM_PROTO_PATH:$PLATFORM_PROTO_PATH" \ -v "$PLATFORM_OBJ_C_OUT_PATH:$PLATFORM_OBJ_C_OUT_PATH" \ + -v "$PROTOS_PATH:$PROTOS_PATH" \ --rm \ "$PROTOC_IMAGE" \ --plugin=protoc-gen-grpc=/usr/bin/grpc_objective_c_plugin \ @@ -195,6 +207,7 @@ docker run -v "$PLATFORM_PROTO_PATH:$PLATFORM_PROTO_PATH" \ --grpc_out="$PLATFORM_OBJ_C_OUT_PATH" \ --proto_path="$PLATFORM_PROTO_PATH" \ -I="$PLATFORM_PROTO_PATH" \ + -I="$PROTOS_PATH" \ "platform.proto" ##################################### @@ -205,6 +218,7 @@ rm -rf "${CORE_PYTHON_OUT_PATH:?}/*" || true docker run -v "$CORE_PROTO_PATH:$CORE_PROTO_PATH" \ -v "$CORE_PYTHON_OUT_PATH:$CORE_PYTHON_OUT_PATH" \ + -v "$PROTOS_PATH:$PROTOS_PATH" \ --rm \ "$PROTOC_IMAGE" \ --plugin=protoc-gen-grpc=/usr/bin/grpc_python_plugin \ @@ -212,6 +226,7 @@ docker run -v "$CORE_PROTO_PATH:$CORE_PROTO_PATH" \ --grpc_out="$CORE_PYTHON_OUT_PATH" \ --proto_path="$CORE_PROTO_PATH" \ -I="$CORE_PROTO_PATH" \ + -I="$PROTOS_PATH" \ "core.proto" ######################################### @@ -222,6 +237,7 @@ rm -rf "${PLATFORM_PYTHON_OUT_PATH:?}/*" || true docker run -v "$PLATFORM_PROTO_PATH:$PLATFORM_PROTO_PATH" \ -v "$PLATFORM_PYTHON_OUT_PATH:$PLATFORM_PYTHON_OUT_PATH" \ + -v "$PROTOS_PATH:$PROTOS_PATH" \ --rm \ "$PROTOC_IMAGE" \ --plugin=protoc-gen-grpc=/usr/bin/grpc_python_plugin \ @@ -229,6 +245,7 @@ docker run -v "$PLATFORM_PROTO_PATH:$PLATFORM_PROTO_PATH" \ --grpc_out="$PLATFORM_PYTHON_OUT_PATH" \ --proto_path="$PLATFORM_PROTO_PATH" \ -I="$PLATFORM_PROTO_PATH" \ + -I="$PROTOS_PATH" \ "platform.proto" # Patch generated protobuf files diff --git a/packages/dapi-grpc/scripts/patch-protobuf-js.sh b/packages/dapi-grpc/scripts/patch-protobuf-js.sh index 147a69ed4f3..d046c513ff6 100755 --- a/packages/dapi-grpc/scripts/patch-protobuf-js.sh +++ b/packages/dapi-grpc/scripts/patch-protobuf-js.sh @@ -27,4 +27,6 @@ for file in $files; do echo "Error: global still present" fi + replace_in_file 's/require('\''.\/platform\/v0\/platform_pb.js'\'')/require('\''..\/..\/..\/platform\/v0\/web\/platform_pb.js'\'')/g' "$file" + done diff --git a/packages/dapi-grpc/src/lib.rs b/packages/dapi-grpc/src/lib.rs index c4258a8ff33..f1a8d876f5a 100644 --- a/packages/dapi-grpc/src/lib.rs +++ b/packages/dapi-grpc/src/lib.rs @@ -46,6 +46,29 @@ pub mod platform { pub use versioning::{VersionedGrpcMessage, VersionedGrpcResponse}; } +#[cfg(all(feature = "drive", feature = "platform"))] +pub(crate) mod dapi { + pub(crate) use crate::platform::*; +} + +#[cfg(feature = "drive")] +pub mod drive { + pub mod v0 { + #[cfg(all(feature = "server", not(target_arch = "wasm32")))] + include!("drive/server/org.dash.platform.drive.v0.rs"); + + #[cfg(all( + feature = "client", + not(feature = "server"), + not(target_arch = "wasm32") + ))] + include!("platform/client/org.dash.platform.drive.v0.rs"); + } + + #[cfg(feature = "tenderdash-proto")] + pub use tenderdash_proto as proto; +} + #[cfg(feature = "serde")] // Serde deserialization logic pub mod deserialization; diff --git a/packages/dapi/lib/dpp/DriveStateRepository.js b/packages/dapi/lib/dpp/DriveStateRepository.js deleted file mode 100644 index b1bce02926c..00000000000 --- a/packages/dapi/lib/dpp/DriveStateRepository.js +++ /dev/null @@ -1,42 +0,0 @@ -const { - v0: { - GetDataContractResponse, - }, -} = require('@dashevo/dapi-grpc'); - -/** - * @implements StateRepository - */ -class DriveStateRepository { - /** - * @param {DriveClient} driveClient - * @param {DashPlatformProtocol} dpp - */ - constructor(driveClient, dpp) { - this.driveClient = driveClient; - this.dpp = dpp; - } - - /** - * Fetches data contract from Drive - * @param {Identifier} contractIdentifier - * @return {Promise} - */ - async fetchDataContract(contractIdentifier) { - const dataContractProtoBuffer = await this.driveClient.fetchDataContract( - contractIdentifier, - false, - ); - - const dataContractResponse = GetDataContractResponse.deserializeBinary( - dataContractProtoBuffer, - ); - - return this.dpp.dataContract.createFromBuffer( - Buffer.from(dataContractResponse.getV0().getDataContract()), - { skipValidation: true }, - ); - } -} - -module.exports = DriveStateRepository; diff --git a/packages/dapi/lib/externalApis/drive/fetchProofForStateTransitionFactory.js b/packages/dapi/lib/externalApis/drive/fetchProofForStateTransitionFactory.js index 95ce9b3304e..a07eeca9dc8 100644 --- a/packages/dapi/lib/externalApis/drive/fetchProofForStateTransitionFactory.js +++ b/packages/dapi/lib/externalApis/drive/fetchProofForStateTransitionFactory.js @@ -4,82 +4,11 @@ const { }, } = require('@dashevo/dapi-grpc'); -const { - StateTransitionTypes, - TokenTransition, - DocumentTransition, - TokenTransitionType, -} = require('@dashevo/wasm-dpp'); -const { GetDataContractRequest } = require('@dashevo/dapi-grpc/clients/platform/v0/web/platform_pb'); -const { contractId: tokensHistoryContractIdString } = require('@dashevo/token-history-contract/lib/systemIds'); -const bs58 = require('bs58'); - -} if (stateTransition.isIdentityStateTransition()) { - const { IdentityRequest } = GetProofsRequestV0; - - const identitiesList = modifiedIds.flatMap((id) => { - const stType = stateTransition.getType(); - let proofRequests; - - if (stType === StateTransitionTypes.IdentityCreditTransfer) { - proofRequests = new IdentityRequest(); - proofRequests.setIdentityId(id.toBuffer()); - proofRequests.setRequestType(IdentityRequest.Type.BALANCE); - } else if (stType === StateTransitionTypes.IdentityTopUp) { - const proofRequestsBalance = new IdentityRequest(); - proofRequestsBalance.setIdentityId(id.toBuffer()); - proofRequestsBalance.setRequestType(IdentityRequest.Type.BALANCE); - - const proofRequestsRevision = new IdentityRequest(); - proofRequestsRevision.setIdentityId(id.toBuffer()); - proofRequestsRevision.setRequestType(IdentityRequest.Type.REVISION); - - proofRequests = [proofRequestsBalance, proofRequestsRevision]; - } else { - proofRequests = new IdentityRequest(); - proofRequests.setIdentityId(id.toBuffer()); - proofRequests.setRequestType(IdentityRequest.Type.FULL_IDENTITY); - } - - return proofRequests; - }); - - requestV0.setIdentitiesList(identitiesList); -} if (stateTransition.isVotingStateTransition()) { - const { VoteStatusRequest } = GetProofsRequestV0; - const { ContestedResourceVoteStatusRequest } = VoteStatusRequest; - - const contestedResourceVoteStatusRequest = new ContestedResourceVoteStatusRequest(); - - const contestedVotePoll = stateTransition.getContestedDocumentResourceVotePoll(); - - if (!contestedVotePoll) { - throw new Error('Masternode vote state transition should have a contested vote poll'); - } - - contestedResourceVoteStatusRequest.setContractId(contestedVotePoll.contractId.toBuffer()); - contestedResourceVoteStatusRequest.setDocumentTypeName(contestedVotePoll.documentTypeName); - contestedResourceVoteStatusRequest.setIndexName(contestedVotePoll.indexName); - contestedResourceVoteStatusRequest.setIndexValuesList(contestedVotePoll.indexValues); - contestedResourceVoteStatusRequest.setVoterIdentifier( - stateTransition.getProTxHash().toBuffer(), - ); - - const voteStatus = new VoteStatusRequest(); - voteStatus.setContestedResourceVoteStatusRequest(contestedResourceVoteStatusRequest); - - requestV0.setVotesList([voteStatus]); -} - /** * @param {PlatformPromiseClient} driveClient - * @param {DashPlatformProtocol} dpp * @return {fetchProofForStateTransition} */ -function fetchProofForStateTransitionFactory(driveClient, dpp) { - const tokensHistoryContractIdBuffer = bs58.decode(tokensHistoryContractIdString); - - +function fetchProofForStateTransitionFactory(driveClient) { /** * @typedef {fetchProofForStateTransition} * @param {Uint8Array} stateTransition diff --git a/packages/dapi/lib/grpcServer/handlers/platform/getStatusHandlerFactory.js b/packages/dapi/lib/grpcServer/handlers/platform/getStatusHandlerFactory.js index 055be92ba74..b91c40aac3f 100644 --- a/packages/dapi/lib/grpcServer/handlers/platform/getStatusHandlerFactory.js +++ b/packages/dapi/lib/grpcServer/handlers/platform/getStatusHandlerFactory.js @@ -215,7 +215,7 @@ function getStatusHandlerFactory(blockchainListener, driveClient, tenderdashRpcC time.setEpoch(driveStatus.time.epoch); } - time.setLocal(Date.now()); + time.setLocal(Date.now().toString()); v0.setTime(time); diff --git a/packages/dapi/lib/grpcServer/handlers/platform/platformHandlersFactory.js b/packages/dapi/lib/grpcServer/handlers/platform/platformHandlersFactory.js index d3679e7bab5..40092eb297a 100644 --- a/packages/dapi/lib/grpcServer/handlers/platform/platformHandlersFactory.js +++ b/packages/dapi/lib/grpcServer/handlers/platform/platformHandlersFactory.js @@ -60,16 +60,16 @@ const requestTenderRpcFactory = require('../../../externalApis/tenderdash/reques /** * @param {jaysonClient} rpcClient * @param {BlockchainListener} blockchainListener - * @param {PlatformPromiseClient} driveClient - * @param {DashPlatformProtocol} dpp + * @param {PlatformPromiseClient} platformClient + * @param {DrivePromiseClient} driveClient * @param {boolean} isProductionEnvironment * @returns {Object} */ function platformHandlersFactory( rpcClient, blockchainListener, + platformClient, driveClient, - dpp, isProductionEnvironment, ) { const wrapInErrorHandler = wrapInErrorHandlerFactory(logger, isProductionEnvironment); @@ -95,7 +95,7 @@ function platformHandlersFactory( ); // waitForStateTransitionResult - const fetchProofForStateTransition = fetchProofForStateTransitionFactory(driveClient, dpp); + const fetchProofForStateTransition = fetchProofForStateTransitionFactory(driveClient); const getExistingTransactionResult = getExistingTransactionResultFactory( rpcClient, @@ -110,7 +110,6 @@ function platformHandlersFactory( fetchProofForStateTransition, waitForTransactionToBeProvable, blockchainListener, - dpp, createGrpcErrorFromDriveResponse, parseInt(process.env.WAIT_FOR_ST_RESULT_TIMEOUT, 10), ); @@ -144,7 +143,7 @@ function platformHandlersFactory( // Get Status const getStatusHandler = getStatusHandlerFactory( blockchainListener, - driveClient, + platformClient, rpcClient, ); diff --git a/packages/dapi/lib/grpcServer/handlers/platform/waitForStateTransitionResultHandlerFactory.js b/packages/dapi/lib/grpcServer/handlers/platform/waitForStateTransitionResultHandlerFactory.js index 70e1ed233e8..2de5487f93e 100644 --- a/packages/dapi/lib/grpcServer/handlers/platform/waitForStateTransitionResultHandlerFactory.js +++ b/packages/dapi/lib/grpcServer/handlers/platform/waitForStateTransitionResultHandlerFactory.js @@ -23,7 +23,6 @@ const TransactionErrorResult = require('../../../externalApis/tenderdash/waitFor * @param {fetchProofForStateTransition} fetchProofForStateTransition * @param {waitForTransactionToBeProvable} waitForTransactionToBeProvable * @param {BlockchainListener} blockchainListener - * @param {DashPlatformProtocol} dpp * @param {createGrpcErrorFromDriveResponse} createGrpcErrorFromDriveResponse * @param {number} stateTransitionWaitTimeout * @return {waitForStateTransitionResultHandler} @@ -32,7 +31,6 @@ function waitForStateTransitionResultHandlerFactory( fetchProofForStateTransition, waitForTransactionToBeProvable, blockchainListener, - dpp, createGrpcErrorFromDriveResponse, stateTransitionWaitTimeout, ) { diff --git a/packages/dapi/package.json b/packages/dapi/package.json index 9a9782466b3..a66152716e9 100644 --- a/packages/dapi/package.json +++ b/packages/dapi/package.json @@ -38,7 +38,6 @@ "@dashevo/dashcore-lib": "~0.22.0", "@dashevo/dashd-rpc": "^19.0.0", "@dashevo/grpc-common": "workspace:*", - "@dashevo/token-history-contract": "workspace:*", "@dashevo/wasm-dpp": "workspace:*", "@grpc/grpc-js": "1.4.4", "@pshenmic/zeromq": "6.0.0-beta.22", diff --git a/packages/dapi/scripts/api.js b/packages/dapi/scripts/api.js index 543318165c6..bd25430a78a 100644 --- a/packages/dapi/scripts/api.js +++ b/packages/dapi/scripts/api.js @@ -13,11 +13,10 @@ const { getPlatformDefinition, v0: { PlatformPromiseClient, + DrivePromiseClient, }, } = require('@dashevo/dapi-grpc'); -const { default: loadWasmDpp, DashPlatformProtocol } = require('@dashevo/wasm-dpp'); - const { client: RpcClient } = require('jayson/promise'); // Load config from .env @@ -41,9 +40,6 @@ const platformHandlersFactory = require( const ZmqClient = require('../lib/externalApis/dashcore/ZmqClient'); async function main() { - await loadWasmDpp(); - // const blsSignatures = await loadBLS(); - /* Application start */ const configValidationResult = validateConfig(config); if (!configValidationResult.isValid) { @@ -69,7 +65,8 @@ async function main() { logger.info('Connection to ZMQ established.'); - const driveClient = new PlatformPromiseClient(`http://${config.driveRpc.host}:${config.driveRpc.port}`, undefined); + const platformClient = new PlatformPromiseClient(`http://${config.driveRpc.host}:${config.driveRpc.port}`, undefined); + const driveClient = new DrivePromiseClient(`http://${config.driveRpc.host}:${config.driveRpc.port}`, undefined); const rpcClient = RpcClient.http({ host: config.tendermintCore.host, @@ -131,8 +128,6 @@ async function main() { }); logger.info(`JSON RPC server is listening on port ${config.rpcServer.port}`); - const dpp = new DashPlatformProtocol(null, 9); - // Start GRPC server logger.info('Starting GRPC server'); @@ -144,8 +139,8 @@ async function main() { const platformHandlers = platformHandlersFactory( rpcClient, blockchainListener, + platformClient, driveClient, - dpp, isProductionEnvironment, ); diff --git a/packages/dashmate/templates/platform/gateway/envoy.yaml.dot b/packages/dashmate/templates/platform/gateway/envoy.yaml.dot index 8d9af2b18af..a3bf8820ff7 100644 --- a/packages/dashmate/templates/platform/gateway/envoy.yaml.dot +++ b/packages/dashmate/templates/platform/gateway/envoy.yaml.dot @@ -163,21 +163,6 @@ cluster: dapi_api # Upstream response timeout timeout: 10s - # getProofs endpoint only for internal use (DAPI -> Drive) - - match: - path: "/org.dash.platform.dapi.v0.Platform/getProofs" - response_headers_to_add: - - header: - key: "Content-Type" - value: "application/grpc-web+proto" - - header: - key: "grpc-status" - value: "12" - - header: - key: "grpc-message" - value: "getProofs endpoint is only for internal use" - direct_response: - status: 204 # Drive gRPC endpoints - match: prefix: "/org.dash.platform.dapi.v0.Platform" diff --git a/packages/rs-dpp/src/state_transition/state_transitions/identity/masternode_vote_transition/accessors/mod.rs b/packages/rs-dpp/src/state_transition/state_transitions/identity/masternode_vote_transition/accessors/mod.rs index 078e18f4376..47ee9dc57af 100644 --- a/packages/rs-dpp/src/state_transition/state_transitions/identity/masternode_vote_transition/accessors/mod.rs +++ b/packages/rs-dpp/src/state_transition/state_transitions/identity/masternode_vote_transition/accessors/mod.rs @@ -41,6 +41,12 @@ impl MasternodeVoteTransitionAccessorsV0 for MasternodeVoteTransition { } } + fn vote_owned(self) -> Vote { + match self { + MasternodeVoteTransition::V0(transition) => transition.vote, + } + } + fn set_vote(&mut self, vote: Vote) { match self { MasternodeVoteTransition::V0(transition) => { diff --git a/packages/rs-dpp/src/state_transition/state_transitions/identity/masternode_vote_transition/accessors/v0/mod.rs b/packages/rs-dpp/src/state_transition/state_transitions/identity/masternode_vote_transition/accessors/v0/mod.rs index dd62754e0e0..2872500a9ed 100644 --- a/packages/rs-dpp/src/state_transition/state_transitions/identity/masternode_vote_transition/accessors/v0/mod.rs +++ b/packages/rs-dpp/src/state_transition/state_transitions/identity/masternode_vote_transition/accessors/v0/mod.rs @@ -8,6 +8,7 @@ pub trait MasternodeVoteTransitionAccessorsV0 { fn set_pro_tx_hash(&mut self, pro_tx_hash: Identifier); fn set_voter_identity_id(&mut self, voter_id: Identifier); fn vote(&self) -> &Vote; + fn vote_owned(self) -> Vote; fn set_vote(&mut self, vote: Vote); fn nonce(&self) -> IdentityNonce; } diff --git a/packages/rs-drive-abci/src/query/proofs/mod.rs b/packages/rs-drive-abci/src/query/proofs/mod.rs index 9574e2c1de1..f432e63eeab 100644 --- a/packages/rs-drive-abci/src/query/proofs/mod.rs +++ b/packages/rs-drive-abci/src/query/proofs/mod.rs @@ -1,11 +1,9 @@ -use crate::abci::AbciError; use crate::error::execution::ExecutionError; -use crate::error::query::QueryError; use crate::error::Error; use crate::platform_types::platform::Platform; use crate::platform_types::platform_state::PlatformState; use crate::query::QueryValidationResult; -use dapi_grpc::platform::v0::{GetProofsRequest, GetProofsResponse}; +use dapi_grpc::drive::v0::{GetProofsRequest, GetProofsResponse}; use dpp::version::PlatformVersion; mod v0; diff --git a/packages/rs-drive-abci/src/query/proofs/v0/mod.rs b/packages/rs-drive-abci/src/query/proofs/v0/mod.rs index 437f1a5d1fc..7017ffe9355 100644 --- a/packages/rs-drive-abci/src/query/proofs/v0/mod.rs +++ b/packages/rs-drive-abci/src/query/proofs/v0/mod.rs @@ -3,20 +3,13 @@ use crate::error::Error; use crate::platform_types::platform::Platform; use crate::platform_types::platform_state::PlatformState; use crate::query::QueryValidationResult; -use dapi_grpc::platform::v0::{GetProofsRequest, GetProofsResponse}; -use dpp::balances::credits::TokenAmount; -use dpp::block::block_info::BlockInfo; +use dapi_grpc::drive::v0::{GetProofsRequest, GetProofsResponse}; use dpp::data_contract::accessors::v0::DataContractV0Getters; use dpp::data_contract::accessors::v1::DataContractV1Getters; use dpp::data_contract::associated_token::token_configuration::accessors::v0::TokenConfigurationV0Getters; use dpp::data_contract::associated_token::token_keeps_history_rules::accessors::v0::TokenKeepsHistoryRulesV0Getters; use dpp::data_contract::document_type::accessors::DocumentTypeV0Getters; -use dpp::data_contract::TokenConfiguration; use dpp::data_contracts::SystemDataContract; -use dpp::document::property_names::PRICE; -use dpp::document::Document; -use dpp::fee::Credits; -use dpp::identity::PartialIdentity; use dpp::prelude::Identifier; use dpp::serialization::PlatformDeserializable; use dpp::state_transition::batch_transition::accessors::DocumentsBatchTransitionAccessorsV0; @@ -37,28 +30,23 @@ use dpp::state_transition::identity_credit_transfer_transition::accessors::Ident use dpp::state_transition::identity_credit_withdrawal_transition::accessors::IdentityCreditWithdrawalTransitionAccessorsV0; use dpp::state_transition::identity_topup_transition::accessors::IdentityTopUpTransitionAccessorsV0; use dpp::state_transition::identity_update_transition::accessors::IdentityUpdateTransitionAccessorsV0; -use dpp::state_transition::proof_result::StateTransitionProofResult::{ - VerifiedDocuments, VerifiedPartialIdentity, VerifiedTokenActionWithDocument, - VerifiedTokenBalance, VerifiedTokenIdentitiesBalances, VerifiedTokenIdentityInfo, -}; +use dpp::state_transition::masternode_vote_transition::accessors::MasternodeVoteTransitionAccessorsV0; use dpp::state_transition::{StateTransition, StateTransitionLike}; use dpp::system_data_contracts::load_system_data_contract; -use dpp::tokens::info::v0::IdentityTokenInfoV0Accessors; -use dpp::voting::vote_polls::VotePoll; +use dpp::version::PlatformVersion; +use dpp::voting::votes::resource_vote::accessors::v0::ResourceVoteGettersV0; use dpp::voting::votes::Vote; -use drive::drive::identity::key::fetch::IdentityKeysRequest; -use drive::drive::identity::{IdentityDriveQuery, IdentityProveRequestType}; use drive::drive::Drive; use drive::error::proof::ProofError; -use drive::query::{PathQuery, SingleDocumentDriveQuery, SingleDocumentDriveQueryContestedStatus}; -use drive::verify::RootHash; -use platform_version::version::PlatformVersion; -use std::collections::BTreeMap; +use drive::query::{ + IdentityBasedVoteDriveQuery, PathQuery, SingleDocumentDriveQuery, + SingleDocumentDriveQueryContestedStatus, +}; fn contract_ids_to_non_historical_path_query(contract_ids: &[Identifier]) -> PathQuery { - let contract_ids = contract_ids.iter().map(|id| id.0).collect(); + let contract_ids: Vec<_> = contract_ids.iter().map(|id| id.to_buffer()).collect(); - let mut path_query = Drive::fetch_non_historical_contracts_query(contract_ids); + let mut path_query = Drive::fetch_non_historical_contracts_query(&contract_ids); path_query.query.limit = None; path_query } @@ -84,16 +72,19 @@ impl Platform { } StateTransition::Batch(st) => { if st.transitions_len() > 1 { - return Err(QueryError::Proof(ProofError::InvalidTransition( - "batch state transition must have only one batched transition".to_string(), - )) - .into()); + return Ok(QueryValidationResult::new_with_error(QueryError::Proof( + ProofError::InvalidTransition( + "batch state transition must have only one batched transition" + .to_string(), + ), + ))); } let Some(transition) = st.first_transition() else { - return Err(QueryError::Proof(ProofError::InvalidTransition( - "batch state transition must have one batched transition".to_string(), - )) - .into()); + return Ok(QueryValidationResult::new_with_error(QueryError::Proof( + ProofError::InvalidTransition( + "batch state transition must have one batched transition".to_string(), + ), + ))); }; let owner_id = st.owner_id(); @@ -150,7 +141,7 @@ impl Platform { contested_status, }; - let mut path_query = query.construct_path_query(platform_version).ok()?; + let mut path_query = query.construct_path_query(platform_version)?; path_query.query.limit = None; path_query } @@ -166,26 +157,16 @@ impl Platform { platform_version, )? else { - return Err(drive::error::Error::Proof(ProofError::UnknownContract( - format!("unknown contract with id {}", data_contract_id), - )) - .into()); + return Ok(QueryValidationResult::new_with_error(QueryError::Proof( + ProofError::UnknownContract(format!( + "unknown contract with id {}", + data_contract_id + )), + ))); }; let contract = &contract_fetch_info.contract; - let identity_contract_nonce = - token_transition.base().identity_contract_nonce(); - - let token_history_document_type_name = - token_transition.historical_document_type_name().to_string(); - - let token_history_contract = - self.drive.cache.system_data_contracts.load_token_history(); - - let token_history_document_type = - token_transition.historical_document_type(&token_history_contract)?; - let token_config = contract.expected_token_configuration( token_transition.base().token_contract_position(), )?; @@ -197,7 +178,6 @@ impl Platform { if keeps_historical_document.keeps_burning_history() { create_token_historical_document_query( token_transition, - token_config, owner_id, platform_version, )? @@ -212,7 +192,6 @@ impl Platform { if keeps_historical_document.keeps_minting_history() { create_token_historical_document_query( token_transition, - token_config, owner_id, platform_version, )? @@ -230,7 +209,6 @@ impl Platform { if keeps_historical_document.keeps_transfer_history() { create_token_historical_document_query( token_transition, - token_config, owner_id, platform_version, )? @@ -245,11 +223,10 @@ impl Platform { ) } } - TokenTransition::Freeze(token_freeze_transition) => { + TokenTransition::Freeze(_) => { if keeps_historical_document.keeps_freezing_history() { create_token_historical_document_query( token_transition, - token_config, owner_id, platform_version, )? @@ -260,11 +237,10 @@ impl Platform { ) } } - TokenTransition::Unfreeze(token_unfreeze_transition) => { + TokenTransition::Unfreeze(_) => { if keeps_historical_document.keeps_freezing_history() { create_token_historical_document_query( token_transition, - token_config, owner_id, platform_version, )? @@ -280,7 +256,6 @@ impl Platform { | TokenTransition::ConfigUpdate(_) | TokenTransition::Claim(_) => create_token_historical_document_query( token_transition, - token_config, owner_id, platform_version, )?, @@ -317,186 +292,34 @@ impl Platform { )? } StateTransition::MasternodeVote(st) => { - let pro_tx_hash = masternode_vote.pro_tx_hash(); - let vote = masternode_vote.vote(); - let contract = match vote { - Vote::ResourceVote(resource_vote) => match resource_vote.vote_poll() { - VotePoll::ContestedDocumentResourceVotePoll( - contested_document_resource_vote_poll, - ) => known_contracts_provider_fn( - &contested_document_resource_vote_poll.contract_id, - )? - .ok_or(drive::error::Error::Proof( - ProofError::UnknownContract(format!( - "unknown contract with id {}", - contested_document_resource_vote_poll.contract_id - )), - ))?, - }, - }; + let pro_tx_hash = st.pro_tx_hash(); - Drive:: - - // we expect to get a vote that matches the state transition - πlet(root_hash, vote) = Drive::verify_masternode_vote( - proof, - pro_tx_hash.to_buffer(), - vote, - &contract, - false, - platform_version, - )?; - } - }; + match st.vote_owned() { + Vote::ResourceVote(resource_vote) => { + let query = IdentityBasedVoteDriveQuery { + identity_id: pro_tx_hash, + vote_poll: resource_vote.vote_poll_owned(), + }; - let identity_requests = check_validation_result_with_data!(identities - .into_iter() - .map(|identity_request| { - Ok(IdentityDriveQuery { - identity_id: Bytes32::from_vec(identity_request.identity_id) - .map(|bytes| bytes.0) - .map_err(|_| { - QueryError::InvalidArgument( - "id must be a valid identifier (32 bytes long)".to_string(), - ) - })?, - prove_request_type: IdentityProveRequestType::try_from( - identity_request.request_type as u8, - ) - .map_err(|_| { - QueryError::InvalidArgument( - format!( - "invalid prove request type '{}'", - identity_request.request_type - ) - .to_string(), - ) - })?, - }) - }) - .collect::, QueryError>>()); - - let vote_queries = check_validation_result_with_data!(votes - .into_iter() - .filter_map(|vote_proof_request| { - if let Some(request_type) = vote_proof_request.request_type { - match request_type { - RequestType::ContestedResourceVoteStatusRequest(contested_resource_vote_status_request) => { - let identity_id = match contested_resource_vote_status_request.voter_identifier.try_into() { - Ok(identity_id) => identity_id, - Err(_) => return Some(Err(QueryError::InvalidArgument( - "voter_identifier must be a valid identifier (32 bytes long)".to_string(), - ))), - }; - let contract_id = match contested_resource_vote_status_request.contract_id.try_into() { - Ok(contract_id) => contract_id, - Err(_) => return Some(Err(QueryError::InvalidArgument( - "contract_id must be a valid identifier (32 bytes long)".to_string(), - ))), - }; - let document_type_name = contested_resource_vote_status_request.document_type_name; - let index_name = contested_resource_vote_status_request.index_name; - let index_values = match contested_resource_vote_status_request.index_values.into_iter().enumerate().map(|(pos, serialized_value)| - Ok(bincode::decode_from_slice(serialized_value.as_slice(), bincode::config::standard().with_big_endian() - .with_no_limit()).map_err(|_| QueryError::InvalidArgument( - format!("could not convert {:?} to a value in the index values at position {}", serialized_value, pos), - ))?.0) - ).collect::, QueryError>>() { - Ok(index_values) => index_values, - Err(e) => return Some(Err(e)), - }; - let vote_poll = ContestedDocumentResourceVotePoll { - contract_id, - document_type_name, - index_name, - index_values, - }.into(); - Some(Ok(IdentityBasedVoteDriveQuery { - identity_id, - vote_poll, - })) - } + // The path query construction can only fail if the serialization fails. + // Because the serialization will pretty much never fail, we can do this. + let mut path_query = query.construct_path_query()?; + path_query.query.limit = None; + path_query } - } else { - None } - }) - .collect::, QueryError>>()); - - let token_balance_queries = check_validation_result_with_data!(identity_token_balances - .into_iter() - .map(|identity_token_balance_request| { - let IdentityTokenBalanceRequest { - token_id, - identity_id, - } = identity_token_balance_request; - Ok(IdentityTokenBalanceDriveQuery { - identity_id: Identifier::try_from(identity_id).map_err(|_| { - QueryError::InvalidArgument( - "identity_id must be a valid identifier (32 bytes long)".to_string(), - ) - })?, - token_id: Identifier::try_from(token_id).map_err(|_| { - QueryError::InvalidArgument( - "token_id must be a valid identifier (32 bytes long)".to_string(), - ) - })?, - }) - }) - .collect::, QueryError>>()); - - let token_info_queries = check_validation_result_with_data!(identity_token_infos - .into_iter() - .map(|identity_token_info_request| { - let IdentityTokenInfoRequest { - token_id, - identity_id, - } = identity_token_info_request; - Ok(IdentityTokenInfoDriveQuery { - identity_id: Identifier::try_from(identity_id).map_err(|_| { - QueryError::InvalidArgument( - "identity_id must be a valid identifier (32 bytes long)".to_string(), - ) - })?, - token_id: Identifier::try_from(token_id).map_err(|_| { - QueryError::InvalidArgument( - "token_id must be a valid identifier (32 bytes long)".to_string(), - ) - })?, - }) - }) - .collect::, QueryError>>()); - - let token_status_queries = check_validation_result_with_data!(token_statuses - .into_iter() - .map(|token_status_request| { - let TokenStatusRequest { token_id } = token_status_request; - Ok(TokenStatusDriveQuery { - token_id: Identifier::try_from(token_id).map_err(|_| { - QueryError::InvalidArgument( - "token_id must be a valid identifier (32 bytes long)".to_string(), - ) - })?, - }) - }) - .collect::, QueryError>>()); - - let proof = self.drive.prove_multiple_state_transition_results( - &identity_requests, - &contract_ids, - &document_queries, - &vote_queries, - &token_balance_queries, - &token_info_queries, - &token_status_queries, + } + }; + + let proof = self.drive.grove_get_proved_path_query( + &path_query, None, - platform_version, + &mut vec![], + &platform_version.drive, )?; - let response = GetProofsResponseV0 { - result: Some(get_proofs_response_v0::Result::Proof( - self.response_proof_v0(platform_state, proof), - )), + let response = GetProofsResponse { + proof: Some(self.response_proof_v0(platform_state, proof)), metadata: Some(self.response_metadata_v0(platform_state)), }; @@ -506,33 +329,26 @@ impl Platform { fn create_token_historical_document_query( token_transition: &TokenTransition, - token_config: &TokenConfiguration, owner_id: Identifier, platform_version: &PlatformVersion, ) -> Result { let token_history_contract = load_system_data_contract(SystemDataContract::TokenHistory, platform_version)?; - let Some(token_event) = token_transition.associated_token_event(token_config, owner_id)? else { - unreachable!("verify_token_historical_event must be called only for token transitions that have an associated token event"); - }; - - let token_id = token_transition.token_id(); - let owner_nonce = token_transition.base().identity_contract_nonce(); - let query = SingleDocumentDriveQuery { contract_id: token_history_contract.id().into_buffer(), - document_type_name: token_event.associated_document_type_name().to_string(), + document_type_name: token_transition.historical_document_type_name().to_string(), document_type_keeps_history: false, - document_id: token_event - .associated_document_id(token_id, owner_id, owner_nonce) + document_id: token_transition + .historical_document_id(owner_id) .to_buffer(), block_time_ms: None, //None because we want latest contested_status: SingleDocumentDriveQueryContestedStatus::NotContested, }; - let token_history_document_type = token_history_contract - .document_type_for_name(token_event.associated_document_type_name())?; + query + .construct_path_query(platform_version) + .map_err(Error::Drive) } #[cfg(test)] diff --git a/packages/rs-drive-abci/src/query/service.rs b/packages/rs-drive-abci/src/query/service.rs index 0ae0c535475..b72b8086e8b 100644 --- a/packages/rs-drive-abci/src/query/service.rs +++ b/packages/rs-drive-abci/src/query/service.rs @@ -8,6 +8,8 @@ use crate::query::QueryValidationResult; use crate::rpc::core::DefaultCoreRPC; use crate::utils::spawn_blocking_task_with_name_if_supported; use async_trait::async_trait; +use dapi_grpc::drive::v0::drive_internal_server::DriveInternal; +use dapi_grpc::drive::v0::{GetProofsRequest, GetProofsResponse}; use dapi_grpc::platform::v0::platform_server::Platform as PlatformService; use dapi_grpc::platform::v0::{ BroadcastStateTransitionRequest, BroadcastStateTransitionResponse, GetConsensusParamsRequest, @@ -34,12 +36,12 @@ use dapi_grpc::platform::v0::{ GetIdentityResponse, GetIdentityTokenBalancesRequest, GetIdentityTokenBalancesResponse, GetIdentityTokenInfosRequest, GetIdentityTokenInfosResponse, GetPathElementsRequest, GetPathElementsResponse, GetPrefundedSpecializedBalanceRequest, - GetPrefundedSpecializedBalanceResponse, GetProofsRequest, GetProofsResponse, - GetProtocolVersionUpgradeStateRequest, GetProtocolVersionUpgradeStateResponse, - GetProtocolVersionUpgradeVoteStatusRequest, GetProtocolVersionUpgradeVoteStatusResponse, - GetStatusRequest, GetStatusResponse, GetTokenPreProgrammedDistributionsRequest, - GetTokenPreProgrammedDistributionsResponse, GetTokenStatusesRequest, GetTokenStatusesResponse, - GetTokenTotalSupplyRequest, GetTokenTotalSupplyResponse, GetTotalCreditsInPlatformRequest, + GetPrefundedSpecializedBalanceResponse, GetProtocolVersionUpgradeStateRequest, + GetProtocolVersionUpgradeStateResponse, GetProtocolVersionUpgradeVoteStatusRequest, + GetProtocolVersionUpgradeVoteStatusResponse, GetStatusRequest, GetStatusResponse, + GetTokenPreProgrammedDistributionsRequest, GetTokenPreProgrammedDistributionsResponse, + GetTokenStatusesRequest, GetTokenStatusesResponse, GetTokenTotalSupplyRequest, + GetTokenTotalSupplyResponse, GetTotalCreditsInPlatformRequest, GetTotalCreditsInPlatformResponse, GetVotePollsByEndDateRequest, GetVotePollsByEndDateResponse, WaitForStateTransitionResultRequest, WaitForStateTransitionResultResponse, }; @@ -339,18 +341,6 @@ impl PlatformService for QueryService { .await } - async fn get_proofs( - &self, - request: Request, - ) -> Result, Status> { - self.handle_blocking_query( - request, - Platform::::query_proofs, - "get_proofs", - ) - .await - } - async fn get_data_contract( &self, request: Request, @@ -750,6 +740,21 @@ impl PlatformService for QueryService { } } +#[async_trait] +impl DriveInternal for QueryService { + async fn get_proofs( + &self, + request: Request, + ) -> Result, Status> { + self.handle_blocking_query( + request, + Platform::::query_proofs, + "get_proofs", + ) + .await + } +} + fn query_error_into_status(error: QueryError) -> Status { match error { QueryError::NotFound(message) => Status::not_found(message), diff --git a/packages/rs-drive-abci/src/server.rs b/packages/rs-drive-abci/src/server.rs index a24fc7495d8..3baf33f5c2a 100644 --- a/packages/rs-drive-abci/src/server.rs +++ b/packages/rs-drive-abci/src/server.rs @@ -20,7 +20,9 @@ pub fn start( config: PlatformConfig, cancel: CancellationToken, ) { - let query_service = QueryService::new(Arc::clone(&platform)); + let query_service = Arc::new(QueryService::new(Arc::clone(&platform))); + + let drive_internal = Arc::clone(&query_service); let check_tx_core_rpc = DefaultCoreRPC::open( &config.core.check_tx_rpc.url(), @@ -33,7 +35,14 @@ pub fn start( CheckTxAbciApplication::new(Arc::clone(&platform), Arc::new(check_tx_core_rpc)); let grpc_server = dapi_grpc::tonic::transport::Server::builder() - .add_service(dapi_grpc::platform::v0::platform_server::PlatformServer::new(query_service)) + .add_service( + dapi_grpc::drive::v0::drive_internal_server::DriveInternalServer::from_arc( + drive_internal, + ), + ) + .add_service( + dapi_grpc::platform::v0::platform_server::PlatformServer::from_arc(query_service), + ) .add_service( tenderdash_abci::proto::abci::abci_application_server::AbciApplicationServer::new( check_tx_service, diff --git a/yarn.lock b/yarn.lock index 9c01abcf7d1..6fce5d7901a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1530,7 +1530,6 @@ __metadata: "@dashevo/dashd-rpc": "npm:^19.0.0" "@dashevo/dp-services-ctl": "github:dashevo/js-dp-services-ctl#v0.19-dev" "@dashevo/grpc-common": "workspace:*" - "@dashevo/token-history-contract": "workspace:*" "@dashevo/wasm-dpp": "workspace:*" "@grpc/grpc-js": "npm:1.4.4" "@pshenmic/zeromq": "npm:6.0.0-beta.22" @@ -1854,7 +1853,7 @@ __metadata: languageName: node linkType: hard -"@dashevo/token-history-contract@workspace:*, @dashevo/token-history-contract@workspace:packages/token-history-contract": +"@dashevo/token-history-contract@workspace:packages/token-history-contract": version: 0.0.0-use.local resolution: "@dashevo/token-history-contract@workspace:packages/token-history-contract" dependencies: From 234172fc609930844fbc54e365d196f0ff3cac38 Mon Sep 17 00:00:00 2001 From: Ivan Shumkov Date: Thu, 10 Apr 2025 10:55:52 +0700 Subject: [PATCH 03/15] fix: dapi is failing with proto errors --- .../clients/drive/v0/nodejs/DrivePromiseClient.js | 10 +++++----- packages/dapi-grpc/lib/getDriveDefinition.js | 9 ++++++++- .../waitForStateTransitionResultHandlerFactory.js | 4 ++-- packages/js-grpc-common/lib/loadPackageDefinition.js | 5 +++-- 4 files changed, 18 insertions(+), 10 deletions(-) diff --git a/packages/dapi-grpc/clients/drive/v0/nodejs/DrivePromiseClient.js b/packages/dapi-grpc/clients/drive/v0/nodejs/DrivePromiseClient.js index eb6932d5a75..49861fd11b5 100644 --- a/packages/dapi-grpc/clients/drive/v0/nodejs/DrivePromiseClient.js +++ b/packages/dapi-grpc/clients/drive/v0/nodejs/DrivePromiseClient.js @@ -37,11 +37,11 @@ const { GetProofsResponse: ProtocGetProofsResponse, } = require('./drive_protoc'); -const getPlatformDefinition = require('../../../../lib/getPlatformDefinition'); +const getDriveDefinition = require('../../../../lib/getDriveDefinition'); -const PlatformNodeJSClient = getPlatformDefinition(0); +const DriveNodeJSClient = getDriveDefinition(0); -class PlatformPromiseClient { +class DrivePromiseClient { /** * @param {string} hostname * @param {?Object} credentials @@ -59,7 +59,7 @@ class PlatformPromiseClient { // eslint-disable-next-line no-param-reassign credentials = protocol.replace(':', '') === 'https' ? grpc.credentials.createSsl() : grpc.credentials.createInsecure(); - this.client = new PlatformNodeJSClient(strippedHostname, credentials, options); + this.client = new DriveNodeJSClient(strippedHostname, credentials, options); this.client.getProofs = promisify( this.client.getProofs.bind(this.client), @@ -108,4 +108,4 @@ class PlatformPromiseClient { } } -module.exports = PlatformPromiseClient; +module.exports = DrivePromiseClient; diff --git a/packages/dapi-grpc/lib/getDriveDefinition.js b/packages/dapi-grpc/lib/getDriveDefinition.js index 30328fbd4c5..596fd21d9c4 100644 --- a/packages/dapi-grpc/lib/getDriveDefinition.js +++ b/packages/dapi-grpc/lib/getDriveDefinition.js @@ -4,8 +4,15 @@ const { loadPackageDefinition } = require('@dashevo/grpc-common'); function getDriveDefinition(version) { const protoPath = path.join(__dirname, `../protos/drive/v${version}/drive.proto`); + const includeDirs = [ + path.join(__dirname, '../protos/'), + ]; - return loadPackageDefinition(protoPath, `org.dash.platform.drive.v${version}.DriveInternal`); + return loadPackageDefinition( + protoPath, + `org.dash.platform.drive.v${version}.DriveInternal`, + includeDirs, + ); } module.exports = getDriveDefinition; diff --git a/packages/dapi/lib/grpcServer/handlers/platform/waitForStateTransitionResultHandlerFactory.js b/packages/dapi/lib/grpcServer/handlers/platform/waitForStateTransitionResultHandlerFactory.js index 2de5487f93e..6693fdcbb64 100644 --- a/packages/dapi/lib/grpcServer/handlers/platform/waitForStateTransitionResultHandlerFactory.js +++ b/packages/dapi/lib/grpcServer/handlers/platform/waitForStateTransitionResultHandlerFactory.js @@ -117,8 +117,8 @@ function waitForStateTransitionResultHandlerFactory( if (prove) { const stateTransitionProof = await fetchProofForStateTransition(result.getTransaction()); - v0.setMetadata(stateTransitionProof.getV0().getMetadata()); - v0.setProof(stateTransitionProof.getV0().getProof()); + v0.setMetadata(stateTransitionProof.getMetadata()); + v0.setProof(stateTransitionProof.getProof()); } response.setV0(v0); diff --git a/packages/js-grpc-common/lib/loadPackageDefinition.js b/packages/js-grpc-common/lib/loadPackageDefinition.js index 310e3e608d9..20e4aff8d65 100644 --- a/packages/js-grpc-common/lib/loadPackageDefinition.js +++ b/packages/js-grpc-common/lib/loadPackageDefinition.js @@ -8,16 +8,17 @@ const lodashGet = require('lodash/get'); * * @param {string} protoPath * @param {string} [namespace] - * + * @param {string[]} [includeDirs=[]] * @return {*} */ -function loadPackageDefinition(protoPath, namespace = undefined) { +function loadPackageDefinition(protoPath, namespace = undefined, includeDirs = []) { const definition = protoLoader.loadSync(protoPath, { keepCase: false, longs: String, enums: String, bytes: Uint8Array, defaults: true, + includeDirs, }); const packageDefinition = grpc.loadPackageDefinition(definition); From 83e505287e5a4f34153c0efb332b8e197a7e9bb2 Mon Sep 17 00:00:00 2001 From: Ivan Shumkov Date: Thu, 10 Apr 2025 12:35:24 +0700 Subject: [PATCH 04/15] fix: sdk tests data fails --- .../initialization/create_genesis_state/test/tokens.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/rs-drive-abci/src/execution/platform_events/initialization/create_genesis_state/test/tokens.rs b/packages/rs-drive-abci/src/execution/platform_events/initialization/create_genesis_state/test/tokens.rs index 28147c64bea..6343414cf41 100644 --- a/packages/rs-drive-abci/src/execution/platform_events/initialization/create_genesis_state/test/tokens.rs +++ b/packages/rs-drive-abci/src/execution/platform_events/initialization/create_genesis_state/test/tokens.rs @@ -1,8 +1,6 @@ -use crate::error::execution::ExecutionError; use crate::error::Error; use crate::platform_types::platform::Platform; use dpp::block::block_info::BlockInfo; -use dpp::dashcore::Network; use dpp::data_contract::associated_token::token_configuration::v0::TokenConfigurationV0; use dpp::data_contract::associated_token::token_configuration_convention::v0::TokenConfigurationConventionV0; use dpp::data_contract::associated_token::token_distribution_rules::v0::TokenDistributionRulesV0; @@ -275,6 +273,7 @@ impl Platform { IDENTITY_ID_1.to_buffer(), mint_amount, false, + false, block_info, true, transaction, @@ -288,6 +287,7 @@ impl Platform { IDENTITY_ID_2.to_buffer(), mint_amount, false, + false, block_info, true, transaction, @@ -302,6 +302,7 @@ impl Platform { IDENTITY_ID_3.to_buffer(), mint_amount, false, + false, block_info, true, transaction, From 511d736b3d8667fd4f87f933696e17e659cf6d78 Mon Sep 17 00:00:00 2001 From: Ivan Shumkov Date: Thu, 10 Apr 2025 14:48:03 +0700 Subject: [PATCH 05/15] test: remove outdated tests --- .../rs-drive-abci/src/query/proofs/v0/mod.rs | 267 ------------------ 1 file changed, 267 deletions(-) diff --git a/packages/rs-drive-abci/src/query/proofs/v0/mod.rs b/packages/rs-drive-abci/src/query/proofs/v0/mod.rs index 7017ffe9355..53d9709ccf5 100644 --- a/packages/rs-drive-abci/src/query/proofs/v0/mod.rs +++ b/packages/rs-drive-abci/src/query/proofs/v0/mod.rs @@ -350,270 +350,3 @@ fn create_token_historical_document_query( .construct_path_query(platform_version) .map_err(Error::Drive) } - -#[cfg(test)] -mod tests { - use super::*; - use crate::query::tests::{assert_invalid_identifier, setup_platform}; - use dapi_grpc::platform::v0::get_proofs_request::get_proofs_request_v0::vote_status_request::ContestedResourceVoteStatusRequest; - use dapi_grpc::platform::v0::get_proofs_request::get_proofs_request_v0::{ - ContractRequest, DocumentRequest, IdentityRequest, VoteStatusRequest, - }; - use dpp::dashcore::Network; - use dpp::data_contract::accessors::v0::DataContractV0Getters; - use dpp::platform_value::Value; - use dpp::util::strings::convert_to_homograph_safe_chars; - - #[test] - fn test_invalid_identity_ids() { - let (platform, state, version) = setup_platform(None, Network::Testnet, None); - - let request = GetProofsRequestV0 { - identities: vec![IdentityRequest { - identity_id: vec![0; 8], - request_type: 0, - }], - contracts: vec![], - documents: vec![], - votes: vec![], - identity_token_balances: vec![], - identity_token_infos: vec![], - token_statuses: vec![], - }; - - let result = platform - .query_proofs_v0(request, &state, version) - .expect("expected query to succeed"); - - assert_invalid_identifier(result); - } - - #[test] - fn test_invalid_identity_prove_request_type() { - let (platform, state, version) = setup_platform(None, Network::Testnet, None); - - let request_type = 10; - - let request = GetProofsRequestV0 { - identities: vec![IdentityRequest { - identity_id: vec![0; 32], - request_type, - }], - contracts: vec![], - documents: vec![], - votes: vec![], - identity_token_balances: vec![], - identity_token_infos: vec![], - token_statuses: vec![], - }; - - let result = platform - .query_proofs_v0(request, &state, version) - .expect("expected query to succeed"); - - assert!(matches!( - result.errors.as_slice(), - [QueryError::InvalidArgument(msg)] if msg == &format!( - "invalid prove request type '{}'", - request_type - ) - )) - } - - #[test] - fn test_invalid_contract_ids() { - let (platform, state, version) = setup_platform(None, Network::Testnet, None); - - let request = GetProofsRequestV0 { - identities: vec![], - contracts: vec![ContractRequest { - contract_id: vec![0; 8], - }], - documents: vec![], - votes: vec![], - identity_token_balances: vec![], - identity_token_infos: vec![], - token_statuses: vec![], - }; - - let result = platform - .query_proofs_v0(request, &state, version) - .expect("expected query to succeed"); - - assert_invalid_identifier(result); - } - - #[test] - fn test_invalid_contract_id_for_documents_proof() { - let (platform, state, version) = setup_platform(None, Network::Testnet, None); - - let request = GetProofsRequestV0 { - identities: vec![], - contracts: vec![], - documents: vec![DocumentRequest { - contract_id: vec![0; 8], - document_type: "niceDocument".to_string(), - document_type_keeps_history: false, - document_id: vec![0; 32], - document_contested_status: 0, - }], - votes: vec![], - identity_token_balances: vec![], - identity_token_infos: vec![], - token_statuses: vec![], - }; - - let result = platform - .query_proofs_v0(request, &state, version) - .expect("expected query to succeed"); - - assert_invalid_identifier(result); - } - - #[test] - fn test_invalid_document_id() { - let (platform, state, version) = setup_platform(None, Network::Testnet, None); - - let request = GetProofsRequestV0 { - identities: vec![], - contracts: vec![], - documents: vec![DocumentRequest { - contract_id: vec![0; 32], - document_type: "niceDocument".to_string(), - document_type_keeps_history: false, - document_id: vec![0; 8], - document_contested_status: 0, - }], - votes: vec![], - identity_token_balances: vec![], - identity_token_infos: vec![], - token_statuses: vec![], - }; - - let result = platform - .query_proofs_v0(request, &state, version) - .expect("expected query to succeed"); - - assert_invalid_identifier(result); - } - - #[test] - fn test_proof_of_absence() { - let (platform, state, version) = setup_platform(None, Network::Testnet, None); - - let request = GetProofsRequestV0 { - identities: vec![], - contracts: vec![], - documents: vec![DocumentRequest { - contract_id: vec![0; 32], - document_type: "niceDocument".to_string(), - document_type_keeps_history: false, - document_id: vec![0; 32], - document_contested_status: 0, - }], - votes: vec![], - identity_token_balances: vec![], - identity_token_infos: vec![], - token_statuses: vec![], - }; - - let validation_result = platform - .query_proofs_v0(request, &state, version) - .expect("expected query to succeed"); - - assert!(matches!(validation_result.data, Some(GetProofsResponseV0 { - result: Some(get_proofs_response_v0::Result::Proof(proof)), - metadata: Some(_), - }) if !proof.grovedb_proof.is_empty())); - } - - #[test] - fn test_proof_of_absence_of_vote() { - let (platform, state, version) = setup_platform(None, Network::Testnet, None); - - let dpns_contract = platform - .drive - .cache - .system_data_contracts - .load_dpns() - .as_ref() - .clone(); - - let config = bincode::config::standard() - .with_big_endian() - .with_no_limit(); - let serialized_index_values = [ - Value::Text("dash".to_string()), - Value::Text(convert_to_homograph_safe_chars("quantum")), - ] - .iter() - .map(|value| { - bincode::encode_to_vec(value, config).expect("expected to encode value in path") - }) - .collect(); - - let request = GetProofsRequestV0 { - identities: vec![], - contracts: vec![], - documents: vec![], - votes: vec![VoteStatusRequest { - request_type: Some(RequestType::ContestedResourceVoteStatusRequest( - ContestedResourceVoteStatusRequest { - contract_id: dpns_contract.id().to_vec(), - document_type_name: "domain".to_string(), - index_name: "parentNameAndLabel".to_string(), - index_values: serialized_index_values, - voter_identifier: [0u8; 32].to_vec(), - }, - )), - }], - identity_token_balances: vec![], - identity_token_infos: vec![], - token_statuses: vec![], - }; - - let validation_result = platform - .query_proofs_v0(request, &state, version) - .expect("expected query to succeed"); - - assert!(matches!(validation_result.data, Some(GetProofsResponseV0 { - result: Some(get_proofs_response_v0::Result::Proof(proof)), - metadata: Some(_), - }) if !proof.grovedb_proof.is_empty())); - } - - #[test] - fn test_prove_all() { - let (platform, state, version) = setup_platform(None, Network::Testnet, None); - - let request = GetProofsRequestV0 { - identities: vec![IdentityRequest { - identity_id: vec![0; 32], - request_type: 0, - }], - contracts: vec![ContractRequest { - contract_id: vec![0; 32], - }], - documents: vec![DocumentRequest { - contract_id: vec![0; 32], - document_type: "niceDocument".to_string(), - document_type_keeps_history: false, - document_id: vec![1; 32], - document_contested_status: 0, - }], - votes: vec![], - identity_token_balances: vec![], - identity_token_infos: vec![], - token_statuses: vec![], - }; - - let validation_result = platform - .query_proofs_v0(request, &state, version) - .expect("expected query to succeed"); - - assert!(matches!(validation_result.data, Some(GetProofsResponseV0 { - result: Some(get_proofs_response_v0::Result::Proof(proof)), - metadata: Some(_), - }) if !proof.grovedb_proof.is_empty())); - } -} From f141ca4dcf372ffb6283a2502ed4dd48e444e8b3 Mon Sep 17 00:00:00 2001 From: Ivan Shumkov Date: Thu, 10 Apr 2025 14:48:25 +0700 Subject: [PATCH 06/15] fix: invalid path --- .../dapi-grpc/clients/drive/v0/nodejs/DrivePromiseClient.js | 2 +- packages/dapi-grpc/src/lib.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/dapi-grpc/clients/drive/v0/nodejs/DrivePromiseClient.js b/packages/dapi-grpc/clients/drive/v0/nodejs/DrivePromiseClient.js index 49861fd11b5..7cedae1214d 100644 --- a/packages/dapi-grpc/clients/drive/v0/nodejs/DrivePromiseClient.js +++ b/packages/dapi-grpc/clients/drive/v0/nodejs/DrivePromiseClient.js @@ -104,7 +104,7 @@ class DrivePromiseClient { * @param {string} protocolVersion */ setProtocolVersion(protocolVersion) { - this.setProtocolVersion = protocolVersion; + this.protocolVersion = protocolVersion; } } diff --git a/packages/dapi-grpc/src/lib.rs b/packages/dapi-grpc/src/lib.rs index f1a8d876f5a..2c13863b4da 100644 --- a/packages/dapi-grpc/src/lib.rs +++ b/packages/dapi-grpc/src/lib.rs @@ -62,7 +62,7 @@ pub mod drive { not(feature = "server"), not(target_arch = "wasm32") ))] - include!("platform/client/org.dash.platform.drive.v0.rs"); + include!("drive/client/org.dash.platform.drive.v0.rs"); } #[cfg(feature = "tenderdash-proto")] From 752569b676cbf262dfdb0f2cce18ade06eea46d5 Mon Sep 17 00:00:00 2001 From: Ivan Shumkov Date: Thu, 10 Apr 2025 14:48:44 +0700 Subject: [PATCH 07/15] test: remove dangling test --- .../dpp/DriveStateRepository.spec.js | 66 ------------------- 1 file changed, 66 deletions(-) delete mode 100644 packages/dapi/test/integration/dpp/DriveStateRepository.spec.js diff --git a/packages/dapi/test/integration/dpp/DriveStateRepository.spec.js b/packages/dapi/test/integration/dpp/DriveStateRepository.spec.js deleted file mode 100644 index 27cfd77cbc3..00000000000 --- a/packages/dapi/test/integration/dpp/DriveStateRepository.spec.js +++ /dev/null @@ -1,66 +0,0 @@ -const chai = require('chai'); -const sinon = require('sinon'); - -const chaiAsPromised = require('chai-as-promised'); -const dirtyChai = require('dirty-chai'); - -const { default: loadWasmDpp, DashPlatformProtocol } = require('@dashevo/wasm-dpp'); - -const generateRandomIdentifierAsync = require('@dashevo/wasm-dpp/lib/test/utils/generateRandomIdentifierAsync'); -const getDataContractFixture = require('@dashevo/wasm-dpp/lib/test/fixtures/getDataContractFixture'); - -const { - v0: { - GetDataContractResponse, - }, -} = require('@dashevo/dapi-grpc'); - -const DriveStateRepository = require('../../../lib/dpp/DriveStateRepository'); - -chai.use(chaiAsPromised); -chai.use(dirtyChai); - -const { expect } = chai; - -describe('DriveStateRepository', () => { - let dpp; - let driveClientMock; - let stateRepository; - let dataContractFixture; - let proto; - - before(async () => { - await loadWasmDpp(); - }); - - beforeEach(async function before() { - dataContractFixture = await getDataContractFixture(); - - dpp = new DashPlatformProtocol(null, 1); - - proto = new GetDataContractResponse(); - proto.setV0( - new GetDataContractResponse.GetDataContractResponseV0() - .setDataContract(dataContractFixture.toBuffer()), - ); - - driveClientMock = sinon.stub(); - driveClientMock.fetchDataContract = this.sinon.stub().resolves( - proto.serializeBinary(), - ); - - stateRepository = new DriveStateRepository(driveClientMock, dpp); - }); - - describe('#fetchDataContract', () => { - it('should fetch and parse data contract', async () => { - const contractId = await generateRandomIdentifierAsync(); - const result = await stateRepository.fetchDataContract(contractId); - - expect(result.toObject()).to.be.deep.equal(dataContractFixture.toObject()); - - expect(driveClientMock.fetchDataContract).to.be.calledOnce(); - expect(driveClientMock.fetchDataContract).to.be.calledWithExactly(contractId, false); - }); - }); -}); From 590b10648fffb0e44e6fb4a9cb48ad9655ca2589 Mon Sep 17 00:00:00 2001 From: Ivan Shumkov Date: Thu, 10 Apr 2025 22:07:52 +0700 Subject: [PATCH 08/15] test: update tests in dapi and drive abci --- ...tateTransitionResultHandlerFactory.spec.js | 34 +- ...etchProofForStateTransitionFactory.spec.js | 144 --- .../verify_state_transitions.rs | 829 ++++++------------ 3 files changed, 290 insertions(+), 717 deletions(-) delete mode 100644 packages/dapi/test/unit/externalApis/drive/fetchProofForStateTransitionFactory.spec.js diff --git a/packages/dapi/test/integration/grpcServer/handlers/platform/waitForStateTransitionResultHandlerFactory.spec.js b/packages/dapi/test/integration/grpcServer/handlers/platform/waitForStateTransitionResultHandlerFactory.spec.js index 21559b20848..9635149e6b2 100644 --- a/packages/dapi/test/integration/grpcServer/handlers/platform/waitForStateTransitionResultHandlerFactory.spec.js +++ b/packages/dapi/test/integration/grpcServer/handlers/platform/waitForStateTransitionResultHandlerFactory.spec.js @@ -19,7 +19,6 @@ const { }, } = require('@dashevo/dapi-grpc'); const getIdentityCreateTransitionFixture = require('@dashevo/wasm-dpp/lib/test/fixtures/getIdentityCreateTransitionFixture'); -const { default: loadWasmDpp, DashPlatformProtocol } = require('@dashevo/wasm-dpp'); const { EventEmitter } = require('events'); @@ -42,6 +41,7 @@ describe('waitForStateTransitionResultHandlerFactory', () => { let tenderDashWsClientMock; let blockchainListener; let hash; + let stateTransitionBytes; let proofFixture; let wsMessagesFixture; let stateTransitionFixture; @@ -53,10 +53,6 @@ describe('waitForStateTransitionResultHandlerFactory', () => { let createGrpcErrorFromDriveResponseMock; let errorInfo; - before(async () => { - await loadWasmDpp(); - }); - beforeEach(async function beforeEach() { const hashString = '56458F2D8A8617EA322931B72C103CDD93820004E534295183A6EF215B93C76E'; hash = Buffer.from(hashString, 'hex'); @@ -69,7 +65,8 @@ describe('waitForStateTransitionResultHandlerFactory', () => { }; stateTransitionFixture = await getIdentityCreateTransitionFixture(); - const stateTransitionBase64 = stateTransitionFixture.toBuffer().toString('base64'); + stateTransitionBytes = stateTransitionFixture.toBuffer(); + const stateTransitionBase64 = stateTransitionBytes.toString('base64'); wsMessagesFixture = { success: { @@ -176,8 +173,6 @@ describe('waitForStateTransitionResultHandlerFactory', () => { tenderDashWsClientMock.subscribe = this.sinon.stub(); tenderDashWsClientMock.isConnected = true; - const dpp = new DashPlatformProtocol(null, 1); - proofFixture = new Proof(); proofFixture.setGrovedbProof(Buffer.alloc(1, 1)); proofFixture.setRound(42); @@ -189,11 +184,8 @@ describe('waitForStateTransitionResultHandlerFactory', () => { metadataFixture.setProtocolVersion(1); const response = new GetProofsResponse(); - response.setV0( - new GetProofsResponse.GetProofsResponseV0() - .setProof(proofFixture) - .setMetadata(metadataFixture), - ); + response.setProof(proofFixture) + .setMetadata(metadataFixture); driveClientMock = { getProofs: this.sinon.stub().resolves(response), @@ -224,7 +216,6 @@ describe('waitForStateTransitionResultHandlerFactory', () => { fetchProofForStateTransition, waitForTransactionToBeProvable, blockchainListener, - dpp, createGrpcErrorFromDriveResponseMock, 1000, ); @@ -284,21 +275,8 @@ describe('waitForStateTransitionResultHandlerFactory', () => { expect(merkleProof).to.deep.equal(proofFixture.getGrovedbProof()); - const { GetProofsRequestV0 } = GetProofsRequest; const getProofsRequest = new GetProofsRequest(); - const { IdentityRequest } = GetProofsRequestV0; - - const identitiesList = stateTransitionFixture.getModifiedDataIds().map((id) => { - const identityRequest = new IdentityRequest(); - identityRequest.setIdentityId(id.toBuffer()); - identityRequest.setRequestType(IdentityRequest.Type.FULL_IDENTITY); - return identityRequest; - }); - - getProofsRequest.setV0( - new GetProofsRequestV0() - .setIdentitiesList(identitiesList), - ); + getProofsRequest.setStateTransition(stateTransitionBytes); expect(driveClientMock.getProofs).to.be.calledOnceWithExactly(getProofsRequest); }); diff --git a/packages/dapi/test/unit/externalApis/drive/fetchProofForStateTransitionFactory.spec.js b/packages/dapi/test/unit/externalApis/drive/fetchProofForStateTransitionFactory.spec.js deleted file mode 100644 index eae636a6bc3..00000000000 --- a/packages/dapi/test/unit/externalApis/drive/fetchProofForStateTransitionFactory.spec.js +++ /dev/null @@ -1,144 +0,0 @@ -const { expect } = require('chai'); -const crypto = require('crypto'); - -const { - v0: { - GetProofsResponse, - Proof, - }, -} = require('@dashevo/dapi-grpc'); - -const { default: loadWasmDpp, DashPlatformProtocol, StateTransitionTypes } = require('@dashevo/wasm-dpp'); - -const generateRandomIdentifierAsync = require('@dashevo/wasm-dpp/lib/test/utils/generateRandomIdentifierAsync'); -const getDocumentsFixture = require('@dashevo/wasm-dpp/lib/test/fixtures/getDocumentsFixture'); - -const getBlsAdapterMock = require('@dashevo/wasm-dpp/lib/test/mocks/getBlsAdapterMock'); -const createStateRepositoryMock = require('@dashevo/wasm-dpp/lib/test/mocks/createStateRepositoryMock'); -const fetchProofForStateTransitionFactory = require('../../../../lib/externalApis/drive/fetchProofForStateTransitionFactory'); - -describe('fetchProofForStateTransition', () => { - let driveClientMock; - let fetchProofForStateTransition; - let identitiesProofResponse; - let dataContractsProofResponse; - let documentsProofResponse; - let masternodeVoteResponse; - let stateTransitionFixture; - - let dpp; - - before(async () => { - await loadWasmDpp(); - }); - - beforeEach(async function beforeEachHandler() { - const blsAdapter = await getBlsAdapterMock(); - const stateRepositoryMock = createStateRepositoryMock(this.sinon); - - dpp = new DashPlatformProtocol( - blsAdapter, - 1, - stateRepositoryMock, - { generate: () => crypto.randomBytes(32) }, - 1, - ); - }); - - beforeEach(async function beforeEach() { - const { GetProofsResponseV0 } = GetProofsResponse; - dataContractsProofResponse = new GetProofsResponse(); - dataContractsProofResponse.setV0(new GetProofsResponseV0().setProof(new Proof([Buffer.from('data contracts proof')]))); - documentsProofResponse = new GetProofsResponse(); - documentsProofResponse.setV0(new GetProofsResponseV0().setProof(new Proof([Buffer.from('documents contracts proof')]))); - identitiesProofResponse = new GetProofsResponse(); - identitiesProofResponse.setV0(new GetProofsResponseV0().setProof(new Proof([Buffer.from('identities contracts proof')]))); - masternodeVoteResponse = new GetProofsResponse(); - masternodeVoteResponse.setV0(new GetProofsResponseV0().setProof(new Proof([Buffer.from('masternode vote proof')]))); - - driveClientMock = { - getProofs: this.sinon.stub().callsFake(async (requestProto) => { - if (requestProto.getV0().getIdentitiesList().length > 0) { - return identitiesProofResponse; - } if (requestProto.getV0().getDocumentsList().length > 0) { - return documentsProofResponse; - } if (requestProto.getV0().getContractsList().length > 0) { - return dataContractsProofResponse; - } if (requestProto.getV0().getVotesList().length > 0) { - return masternodeVoteResponse; - } - - return null; - }), - }; - - stateTransitionFixture = { - isVotingStateTransition: this.sinon.stub(), - isIdentityStateTransition: this.sinon.stub(), - isDocumentStateTransition: this.sinon.stub(), - isDataContractStateTransition: this.sinon.stub(), - getModifiedDataIds: this.sinon.stub().returns([ - await generateRandomIdentifierAsync(), - await generateRandomIdentifierAsync(), - ]), - getType: this.sinon.stub(), - }; - - fetchProofForStateTransition = fetchProofForStateTransitionFactory(driveClientMock); - }); - - it('should fetch identities proofs', async () => { - stateTransitionFixture.isIdentityStateTransition.returns(true); - stateTransitionFixture.getType.returns(StateTransitionTypes.IdentityCreditTransfer); - const result = await fetchProofForStateTransition(stateTransitionFixture); - expect(result.serializeBinary()).to.deep - .equal(identitiesProofResponse.serializeBinary()); - }); - - it('should fetch data contract proofs', async () => { - stateTransitionFixture.isDataContractStateTransition.returns(true); - const result = await fetchProofForStateTransition(stateTransitionFixture); - expect(result.serializeBinary()).to.deep - .equal(dataContractsProofResponse.serializeBinary()); - }); - - it('should fetch documents proofs', async () => { - const documents = await getDocumentsFixture(); - - const identityId = documents[0].getOwnerId(); - const contractId = documents[0].getDataContractId(); - - const transition = dpp.document.createStateTransition({ - create: documents, - }, { - [identityId.toString()]: { - [contractId.toString()]: '1', - }, - }); - - const result = await fetchProofForStateTransition(transition); - expect(result.serializeBinary()).to.deep - .equal(documentsProofResponse.serializeBinary()); - }); - - it('should fetch masternode vote proofs', async function it() { - const proTxHash = await generateRandomIdentifierAsync(); - const contractId = await generateRandomIdentifierAsync(); - const documentTypeName = 'documentType'; - const indexName = 'indexName'; - const indexValues = [crypto.randomBytes(32), crypto.randomBytes(32)]; - - stateTransitionFixture.getProTxHash = this.sinon.stub().returns(proTxHash); - stateTransitionFixture.isVotingStateTransition.returns(true); - stateTransitionFixture.getContestedDocumentResourceVotePoll = this.sinon.stub().returns({ - contractId, - documentTypeName, - indexName, - indexValues, - }); - - const result = await fetchProofForStateTransition(stateTransitionFixture); - expect(result.serializeBinary()).to.deep - .equal(masternodeVoteResponse.serializeBinary()); - }); -}); diff --git a/packages/rs-drive-abci/tests/strategy_tests/verify_state_transitions.rs b/packages/rs-drive-abci/tests/strategy_tests/verify_state_transitions.rs index 5b9114e9ee1..34009e502a4 100644 --- a/packages/rs-drive-abci/tests/strategy_tests/verify_state_transitions.rs +++ b/packages/rs-drive-abci/tests/strategy_tests/verify_state_transitions.rs @@ -1,13 +1,7 @@ -use dapi_grpc::platform::v0::get_proofs_request::{get_proofs_request_v0, GetProofsRequestV0}; -use dapi_grpc::platform::v0::{get_proofs_request, GetProofsRequest}; -use dapi_grpc::platform::VersionedGrpcResponse; use dpp::data_contract::accessors::v0::DataContractV0Getters; use dpp::data_contract::document_type::accessors::DocumentTypeV0Getters; use dpp::document::{Document, DocumentV0Getters}; use dpp::identity::identity_public_key::accessors::v0::IdentityPublicKeyGettersV0; - -use dapi_grpc::platform::v0::get_proofs_request::get_proofs_request_v0::vote_status_request; -use dapi_grpc::platform::v0::get_proofs_request::get_proofs_request_v0::vote_status_request::RequestType; use dpp::asset_lock::reduced_asset_lock_value::AssetLockValueGettersV0; use dpp::document::property_names::PRICE; use dpp::state_transition::StateTransition; @@ -21,9 +15,11 @@ use drive_abci::execution::validation::state_transition::transformer::StateTrans use drive_abci::platform_types::platform::PlatformRef; use drive_abci::rpc::core::MockCoreRPCLike; use tenderdash_abci::proto::abci::ExecTxResult; +use dapi_grpc::drive::v0::GetProofsRequest; use dpp::block::extended_block_info::v0::ExtendedBlockInfoV0Getters; use dpp::data_contracts::SystemDataContract; use dpp::document::serialization_traits::DocumentPlatformConversionMethodsV0; +use dpp::serialization::PlatformSerializable; use dpp::voting::votes::Vote; use drive::drive::votes::resolved::vote_polls::ResolvedVotePoll; use drive::drive::votes::resolved::votes::resolved_resource_vote::accessors::v0::ResolvedResourceVoteGettersV0; @@ -105,39 +101,34 @@ pub(crate) fn verify_state_transitions_were_or_were_not_executed( }) .collect::>(); - for (_state_transition, action, was_executed) in &actions { - let mut proofs_request = GetProofsRequestV0 { - identities: vec![], - contracts: vec![], - documents: vec![], - votes: vec![], - identity_token_balances: vec![], - identity_token_infos: vec![], - token_statuses: vec![], + for (state_transition, action, was_executed) in &actions { + let state_transition_bytes = state_transition + .serialize_to_bytes() + .expect("serialize state transition"); + + let request = GetProofsRequest { + state_transition: state_transition_bytes, }; - if let Some(action) = action { - match action { - StateTransitionAction::DataContractCreateAction(data_contract_create) => { - proofs_request - .contracts - .push(get_proofs_request_v0::ContractRequest { - contract_id: data_contract_create.data_contract_ref().id().to_vec(), - }); - - let versioned_request = GetProofsRequest { - version: Some(get_proofs_request::Version::V0(proofs_request)), - }; + let result = abci_app + .platform + .query_proofs(request, &state, platform_version) + .expect("query proofs"); - let result = abci_app - .platform - .query_proofs(versioned_request, &state, platform_version) - .expect("expected to query proofs"); + if !result.is_valid() { + panic!( + "expected to get a valid proof response, got errors {:?}", + result.errors + ) + } - let response = result.into_data().expect("expected queries to be valid"); + let response = result.into_data().expect("get proof response"); - let response_proof = response.proof_owned().expect("expected to get proof"); + let response_proof = response.proof.expect("existing proof"); + if let Some(action) = action { + match action { + StateTransitionAction::DataContractCreateAction(data_contract_create) => { // let fetched_contract = abci_app // .platform.drive.fetch_contract(data_contract_create.data_contract_ref().id().into_buffer(), None, None, None, platform_version).unwrap().unwrap(); // we expect to get an identity that matches the state transition @@ -169,22 +160,6 @@ pub(crate) fn verify_state_transitions_were_or_were_not_executed( } } StateTransitionAction::DataContractUpdateAction(data_contract_update) => { - proofs_request - .contracts - .push(get_proofs_request_v0::ContractRequest { - contract_id: data_contract_update.data_contract_ref().id().to_vec(), - }); - let versioned_request = GetProofsRequest { - version: Some(get_proofs_request::Version::V0(proofs_request)), - }; - let result = abci_app - .platform - .query_proofs(versioned_request, &state, platform_version) - .expect("expected to query proofs"); - let response = result.into_data().expect("expected queries to be valid"); - - let response_proof = response.proof_owned().expect("expected to get proof"); - // we expect to get an identity that matches the state transition let (root_hash, contract) = Drive::verify_contract( &response_proof.grovedb_proof, @@ -219,398 +194,292 @@ pub(crate) fn verify_state_transitions_were_or_were_not_executed( } } StateTransitionAction::BatchAction(batch_transition) => { - batch_transition - .transitions() - .iter() - .for_each(|transition| match transition { - BatchedTransitionAction::DocumentAction(document_transition_action) => { - let document_contested_status = - if let DocumentTransitionAction::CreateAction(create_action) = - document_transition_action - { - if create_action.prefunded_voting_balance().is_some() { - SingleDocumentDriveQueryContestedStatus::Contested as u8 - } else { - SingleDocumentDriveQueryContestedStatus::NotContested - as u8 - } - } else { - SingleDocumentDriveQueryContestedStatus::NotContested as u8 - }; - proofs_request.documents.push( - get_proofs_request_v0::DocumentRequest { - contract_id: document_transition_action - .base() - .data_contract_id() - .to_vec(), - document_type: document_transition_action - .base() - .document_type_name() - .clone(), - document_type_keeps_history: document_transition_action - .base() - .data_contract_fetch_info() - .contract - .document_type_for_name( - document_transition_action - .base() - .document_type_name() - .as_str(), - ) - .expect("get document type") - .documents_keep_history(), - document_id: document_transition_action - .base() - .id() - .to_vec(), - document_contested_status: document_contested_status as i32, - }, - ); - } - BatchedTransitionAction::TokenAction(token_transition_action) => { - if token_transition_action - .keeps_history() - .expect("expected no error in token action keeps history") - { - // if we keep history we just need to check the historical document - proofs_request.documents.push( - get_proofs_request_v0::DocumentRequest { - contract_id: SystemDataContract::TokenHistory - .id() - .to_vec(), - document_type: token_transition_action - .historical_document_type_name() - .to_string(), - document_type_keeps_history: false, - document_id: token_transition_action - .historical_document_id(batch_transition.owner_id()) - .to_vec(), - document_contested_status: 0, - }, - ); - } else { - unimplemented!( - "proofs for non historical tokens aren't implemented yet" - ); - } - } - BatchedTransitionAction::BumpIdentityDataContractNonce(_) => {} - }); - let versioned_request = GetProofsRequest { - version: Some(get_proofs_request::Version::V0(proofs_request)), + if batch_transition.transitions().is_empty() { + panic!("we should have at least one transition"); + } + + let Some(transition_action) = batch_transition.transitions().first() else { + panic!("we should have at least one transition"); }; - let result = abci_app - .platform - .query_proofs(versioned_request, &state, platform_version) - .expect("expected to query proofs"); - let response = result.into_data().expect("expected queries to be valid"); - - let response_proof = response.proof_owned().expect("proof should be present"); - - for transition_action in batch_transition.transitions().iter() { - match transition_action { - BatchedTransitionAction::DocumentAction(document_action) => { - let contract_fetch_info = - document_action.base().data_contract_fetch_info(); - - let document_type = contract_fetch_info - .contract - .document_type_for_name( - document_action.base().document_type_name().as_str(), - ) - .expect("get document type"); - let contested_status = - if let DocumentTransitionAction::CreateAction(create_action) = - document_action - { - if create_action.prefunded_voting_balance().is_some() { - SingleDocumentDriveQueryContestedStatus::Contested - } else { - SingleDocumentDriveQueryContestedStatus::NotContested - } + match transition_action { + BatchedTransitionAction::DocumentAction(document_action) => { + let contract_fetch_info = + document_action.base().data_contract_fetch_info(); + + let document_type = contract_fetch_info + .contract + .document_type_for_name( + document_action.base().document_type_name().as_str(), + ) + .expect("get document type"); + let contested_status = + if let DocumentTransitionAction::CreateAction(create_action) = + document_action + { + if create_action.prefunded_voting_balance().is_some() { + SingleDocumentDriveQueryContestedStatus::Contested } else { SingleDocumentDriveQueryContestedStatus::NotContested - }; - - let query = SingleDocumentDriveQuery { - contract_id: document_action - .base() - .data_contract_id() - .into_buffer(), - document_type_name: document_action - .base() - .document_type_name() - .clone(), - document_type_keeps_history: document_type - .documents_keep_history(), - document_id: document_action.base().id().into_buffer(), - block_time_ms: None, //None because we want latest - contested_status, + } + } else { + SingleDocumentDriveQueryContestedStatus::NotContested }; - // dbg!( - // platform.state.height(), - // document_transition_action.action_type(), - // document_transition_action - // .base() - // .id() - // .to_string(Encoding::Base58) - // ); - - let (root_hash, document) = query - .verify_proof( - false, - &response_proof.grovedb_proof, - document_type, - platform_version, - ) - .expect("expected to verify a document"); - - assert_eq!( - &root_hash, - expected_root_hash, - "state last block info {:?}", - platform.state.last_committed_block_info() - ); - - match document_action { - DocumentTransitionAction::CreateAction(creation_action) => { - if *was_executed { - let document = document.unwrap_or_else(|| { - panic!( - "expected a document on block {}", - platform.state.last_committed_block_height() - ) - }); - // dbg!( - // &document, - // Document::try_from_create_transition( - // creation_action, - // documents_batch_transition.owner_id(), - // platform_version, - // ) - // .expect("expected to get document") - // ); + let query = SingleDocumentDriveQuery { + contract_id: document_action + .base() + .data_contract_id() + .into_buffer(), + document_type_name: document_action + .base() + .document_type_name() + .clone(), + document_type_keeps_history: document_type.documents_keep_history(), + document_id: document_action.base().id().into_buffer(), + block_time_ms: None, //None because we want latest + contested_status, + }; + + // dbg!( + // platform.state.height(), + // document_transition_action.action_type(), + // document_transition_action + // .base() + // .id() + // .to_string(Encoding::Base58) + // ); + + let (root_hash, document) = query + .verify_proof( + false, + &response_proof.grovedb_proof, + document_type, + platform_version, + ) + .expect("expected to verify a document"); + + assert_eq!( + &root_hash, + expected_root_hash, + "state last block info {:?}", + platform.state.last_committed_block_info() + ); + + match document_action { + DocumentTransitionAction::CreateAction(creation_action) => { + if *was_executed { + let document = document.unwrap_or_else(|| { + panic!( + "expected a document on block {}", + platform.state.last_committed_block_height() + ) + }); + // dbg!( + // &document, + // Document::try_from_create_transition( + // creation_action, + // documents_batch_transition.owner_id(), + // platform_version, + // ) + // .expect("expected to get document") + // ); + assert_eq!( + document, + Document::try_from_create_transition_action( + creation_action, + batch_transition.owner_id(), + platform_version, + ) + .expect("expected to get document") + ); + } else { + //there is the possibility that the state transition was not executed because it already existed, + // we can discount that for now in tests + assert!(document.is_none()); + } + } + DocumentTransitionAction::ReplaceAction(replace_action) => { + if *was_executed { + // it's also possible we deleted something we replaced + if let Some(document) = document { assert_eq!( document, - Document::try_from_create_transition_action( - creation_action, + Document::try_from_replace_transition_action( + replace_action, batch_transition.owner_id(), platform_version, ) .expect("expected to get document") ); - } else { - //there is the possibility that the state transition was not executed because it already existed, - // we can discount that for now in tests - assert!(document.is_none()); } - } - DocumentTransitionAction::ReplaceAction(replace_action) => { - if *was_executed { - // it's also possible we deleted something we replaced - if let Some(document) = document { - assert_eq!( - document, - Document::try_from_replace_transition_action( - replace_action, - batch_transition.owner_id(), - platform_version, - ) - .expect("expected to get document") - ); - } - } else { - //there is the possibility that the state transition was not executed and the state is equal to the previous - // state, aka there would have been no change anyways, we can discount that for now - if let Some(document) = document { - assert_ne!( - document, - Document::try_from_replace_transition_action( - replace_action, - batch_transition.owner_id(), - platform_version, - ) - .expect("expected to get document") - ); - } + } else { + //there is the possibility that the state transition was not executed and the state is equal to the previous + // state, aka there would have been no change anyways, we can discount that for now + if let Some(document) = document { + assert_ne!( + document, + Document::try_from_replace_transition_action( + replace_action, + batch_transition.owner_id(), + platform_version, + ) + .expect("expected to get document") + ); } } - DocumentTransitionAction::DeleteAction(_) => { - // we expect no document - assert!(document.is_none()); - } - DocumentTransitionAction::TransferAction(transfer_action) => { - if *was_executed { - // it's also possible we deleted something we replaced - if let Some(document) = document { - assert_eq!( - document.owner_id(), - transfer_action.document().owner_id() - ); - } - } else { - //there is the possibility that the state transition was not executed and the state is equal to the previous - // state, aka there would have been no change anyways, we can discount that for now - if let Some(document) = document { - assert_ne!( - document.owner_id(), - transfer_action.document().owner_id() - ); - } + } + DocumentTransitionAction::DeleteAction(_) => { + // we expect no document + assert!(document.is_none()); + } + DocumentTransitionAction::TransferAction(transfer_action) => { + if *was_executed { + // it's also possible we deleted something we replaced + if let Some(document) = document { + assert_eq!( + document.owner_id(), + transfer_action.document().owner_id() + ); } - } - DocumentTransitionAction::PurchaseAction(purchase_action) => { - if *was_executed { - if let Some(document) = document { - assert_eq!( - document.owner_id(), - purchase_action.document().owner_id() - ); - } - } else { - //there is the possibility that the state transition was not executed and the state is equal to the previous - // state, aka there would have been no change anyways, we can discount that for now - if let Some(document) = document { - assert_ne!( - document.owner_id(), - purchase_action.document().owner_id() - ); - } + } else { + //there is the possibility that the state transition was not executed and the state is equal to the previous + // state, aka there would have been no change anyways, we can discount that for now + if let Some(document) = document { + assert_ne!( + document.owner_id(), + transfer_action.document().owner_id() + ); } } - DocumentTransitionAction::UpdatePriceAction( - update_price_action, - ) => { - if *was_executed { - if let Some(document) = document { - assert_eq!( - document.get(PRICE), - update_price_action.document().get(PRICE) - ); - } - } else { - //there is the possibility that the state transition was not executed and the state is equal to the previous - // state, aka there would have been no change anyways, we can discount that for now - if let Some(document) = document { - assert_ne!( - document.get(PRICE), - update_price_action.document().get(PRICE) - ); - } + } + DocumentTransitionAction::PurchaseAction(purchase_action) => { + if *was_executed { + if let Some(document) = document { + assert_eq!( + document.owner_id(), + purchase_action.document().owner_id() + ); + } + } else { + //there is the possibility that the state transition was not executed and the state is equal to the previous + // state, aka there would have been no change anyways, we can discount that for now + if let Some(document) = document { + assert_ne!( + document.owner_id(), + purchase_action.document().owner_id() + ); } } } - } - BatchedTransitionAction::TokenAction(token_transition_action) => { - if token_transition_action - .keeps_history() - .expect("expected no error in token action keeps history") - { - let token_id = token_transition_action.base().token_id(); - let document_type_name = token_transition_action - .historical_document_type_name() - .to_string(); - - let token_history = platform - .drive - .cache - .system_data_contracts - .load_token_history(); - - let query = SingleDocumentDriveQuery { - contract_id: SystemDataContract::TokenHistory - .id() - .to_buffer(), - document_type_name, - document_type_keeps_history: false, - document_id: token_transition_action - .historical_document_id(batch_transition.owner_id()) - .to_buffer(), - block_time_ms: None, //None because we want latest - contested_status: - SingleDocumentDriveQueryContestedStatus::NotContested, - }; - - let (root_hash, serialized_document) = query - .verify_proof_keep_serialized( - false, - &response_proof.grovedb_proof, - platform_version, - ) - .expect("expected to verify a document"); - - assert_eq!( - &root_hash, - expected_root_hash, - "state last block info {:?}", - platform.state.last_committed_block_info() - ); - - assert!( - serialized_document.is_some(), - "we expect a token history document" - ); - - let expected_document = token_transition_action - .build_historical_document( - token_id, - batch_transition.owner_id(), - token_transition_action - .base() - .identity_contract_nonce(), - platform - .state - .last_committed_block_info() - .as_ref() - .expect("expected last commited block info") - .basic_info(), - platform_version, - ) - .expect("expected to build historical document"); - - let serialized_expected_document = expected_document - .serialize( - token_transition_action - .historical_document_type(&token_history) - .expect("expected document type"), - platform_version, - ) - .expect("expected to serialize"); - - assert_eq!( - serialized_document.unwrap(), - serialized_expected_document - ); - } else { - todo!(); + DocumentTransitionAction::UpdatePriceAction( + update_price_action, + ) => { + if *was_executed { + if let Some(document) = document { + assert_eq!( + document.get(PRICE), + update_price_action.document().get(PRICE) + ); + } + } else { + //there is the possibility that the state transition was not executed and the state is equal to the previous + // state, aka there would have been no change anyways, we can discount that for now + if let Some(document) = document { + assert_ne!( + document.get(PRICE), + update_price_action.document().get(PRICE) + ); + } + } } } - BatchedTransitionAction::BumpIdentityDataContractNonce(_) => { - panic!("we should not have a bump identity data contract nonce"); + } + BatchedTransitionAction::TokenAction(token_transition_action) => { + if token_transition_action + .keeps_history() + .expect("expected no error in token action keeps history") + { + let token_id = token_transition_action.base().token_id(); + let document_type_name = token_transition_action + .historical_document_type_name() + .to_string(); + + let token_history = platform + .drive + .cache + .system_data_contracts + .load_token_history(); + + let query = SingleDocumentDriveQuery { + contract_id: SystemDataContract::TokenHistory.id().to_buffer(), + document_type_name, + document_type_keeps_history: false, + document_id: token_transition_action + .historical_document_id(batch_transition.owner_id()) + .to_buffer(), + block_time_ms: None, //None because we want latest + contested_status: + SingleDocumentDriveQueryContestedStatus::NotContested, + }; + + let (root_hash, serialized_document) = query + .verify_proof_keep_serialized( + false, + &response_proof.grovedb_proof, + platform_version, + ) + .expect("expected to verify a document"); + + assert_eq!( + &root_hash, + expected_root_hash, + "state last block info {:?}", + platform.state.last_committed_block_info() + ); + + assert!( + serialized_document.is_some(), + "we expect a token history document" + ); + + let expected_document = token_transition_action + .build_historical_document( + token_id, + batch_transition.owner_id(), + token_transition_action.base().identity_contract_nonce(), + platform + .state + .last_committed_block_info() + .as_ref() + .expect("expected last commited block info") + .basic_info(), + platform_version, + ) + .expect("expected to build historical document"); + + let serialized_expected_document = expected_document + .serialize( + token_transition_action + .historical_document_type(&token_history) + .expect("expected document type"), + platform_version, + ) + .expect("expected to serialize"); + + assert_eq!( + serialized_document.unwrap(), + serialized_expected_document + ); + } else { + todo!(); } } + BatchedTransitionAction::BumpIdentityDataContractNonce(_) => { + panic!("we should not have a bump identity data contract nonce"); + } } } StateTransitionAction::IdentityCreateAction(identity_create_transition) => { - proofs_request - .identities - .push(get_proofs_request_v0::IdentityRequest { - identity_id: identity_create_transition.identity_id().to_vec(), - request_type: - get_proofs_request_v0::identity_request::Type::FullIdentity.into(), - }); - let versioned_request = GetProofsRequest { - version: Some(get_proofs_request::Version::V0(proofs_request)), - }; - let result = abci_app - .platform - .query_proofs(versioned_request, &state, platform_version) - .expect("expected to query proofs"); - let response = result.into_data().expect("expected queries to be valid"); - - let response_proof = response.proof_owned().expect("proof should be present"); - // we expect to get an identity that matches the state transition let (root_hash, identity) = Drive::verify_full_identity_by_identity_id( &response_proof.grovedb_proof, @@ -639,24 +508,6 @@ pub(crate) fn verify_state_transitions_were_or_were_not_executed( } } StateTransitionAction::IdentityTopUpAction(identity_top_up_transition) => { - proofs_request - .identities - .push(get_proofs_request_v0::IdentityRequest { - identity_id: identity_top_up_transition.identity_id().to_vec(), - request_type: get_proofs_request_v0::identity_request::Type::Balance - .into(), - }); - let versioned_request = GetProofsRequest { - version: Some(get_proofs_request::Version::V0(proofs_request)), - }; - let result = abci_app - .platform - .query_proofs(versioned_request, &state, platform_version) - .expect("expected to query proofs"); - let response = result.into_data().expect("expected queries to be valid"); - - let response_proof = response.proof_owned().expect("proof should be present"); - // we expect to get an identity that matches the state transition let (root_hash, balance) = Drive::verify_identity_balance_for_identity_id( &response_proof.grovedb_proof, @@ -687,36 +538,7 @@ pub(crate) fn verify_state_transitions_were_or_were_not_executed( StateTransitionAction::IdentityCreditWithdrawalAction( identity_credit_withdrawal_transition, ) => { - proofs_request - .identities - .push(get_proofs_request_v0::IdentityRequest { - identity_id: identity_credit_withdrawal_transition - .identity_id() - .to_vec(), - request_type: get_proofs_request_v0::identity_request::Type::Balance - .into(), - }); - //todo: we should also verify the document - // proofs_request.documents.push(get_proofs_request::DocumentProofRequest { - // contract_id: vec![], - // document_type: "".to_string(), - // document_type_keeps_history: false, - // document_id: vec![], - // } ); - // we expect to get an identity that matches the state transition - - let versioned_request = GetProofsRequest { - version: Some(get_proofs_request::Version::V0(proofs_request)), - }; - let result = abci_app - .platform - .query_proofs(versioned_request, &state, platform_version) - .expect("expected to query proofs"); - - let response = result.into_data().expect("expected queries to be valid"); - - let response_proof = response.proof_owned().expect("proof should be present"); - + // todo: we should also verify the document // we expect to get an identity that matches the state transition let (root_hash, balance) = Drive::verify_identity_balance_for_identity_id( &response_proof.grovedb_proof, @@ -738,24 +560,6 @@ pub(crate) fn verify_state_transitions_were_or_were_not_executed( //todo: we need to do more here } StateTransitionAction::IdentityUpdateAction(identity_update_transition) => { - proofs_request - .identities - .push(get_proofs_request_v0::IdentityRequest { - identity_id: identity_update_transition.identity_id().to_vec(), - request_type: get_proofs_request_v0::identity_request::Type::Keys - .into(), - }); - let versioned_request = GetProofsRequest { - version: Some(get_proofs_request::Version::V0(proofs_request)), - }; - let result = abci_app - .platform - .query_proofs(versioned_request, &state, platform_version) - .expect("expected to query proofs"); - let response = result.into_data().expect("expected queries to be valid"); - - let response_proof = response.proof_owned().expect("proof should be present"); - // we expect to get an identity that matches the state transition let (root_hash, identity) = Drive::verify_identity_keys_by_identity_id( &response_proof.grovedb_proof, @@ -791,34 +595,6 @@ pub(crate) fn verify_state_transitions_were_or_were_not_executed( StateTransitionAction::IdentityCreditTransferAction( identity_credit_transfer_action, ) => { - proofs_request - .identities - .push(get_proofs_request_v0::IdentityRequest { - identity_id: identity_credit_transfer_action.identity_id().to_vec(), - request_type: get_proofs_request_v0::identity_request::Type::Balance - .into(), - }); - - proofs_request - .identities - .push(get_proofs_request_v0::IdentityRequest { - identity_id: identity_credit_transfer_action.recipient_id().to_vec(), - request_type: get_proofs_request_v0::identity_request::Type::Balance - .into(), - }); - - let versioned_request = GetProofsRequest { - version: Some(get_proofs_request::Version::V0(proofs_request)), - }; - - let result = abci_app - .platform - .query_proofs(versioned_request, &state, platform_version) - .expect("expected to query proofs"); - let response = result.into_data().expect("expected queries to be valid"); - - let response_proof = response.proof_owned().expect("proof should be present"); - // we expect to get an identity that matches the state transition let (root_hash_identity, _balance_identity) = Drive::verify_identity_balance_for_identity_id( @@ -867,47 +643,10 @@ pub(crate) fn verify_state_transitions_were_or_were_not_executed( { ResolvedVotePoll::ContestedDocumentResourceVotePollWithContractInfo( contested_document_resource_vote_poll, - ) => { - let config = bincode::config::standard() - .with_big_endian() - .with_no_limit(); - let serialized_index_values = contested_document_resource_vote_poll - .index_values - .iter() - .map(|value| { - bincode::encode_to_vec(value, config) - .expect("expected to encode value in path") - }) - .collect(); - - proofs_request - .votes - .push(get_proofs_request_v0::VoteStatusRequest{ - request_type: Some(RequestType::ContestedResourceVoteStatusRequest(vote_status_request::ContestedResourceVoteStatusRequest { - contract_id: contested_document_resource_vote_poll.contract.id().to_vec(), - document_type_name: contested_document_resource_vote_poll.document_type_name.clone(), - index_name: contested_document_resource_vote_poll.index_name.clone(), - voter_identifier: masternode_vote_action.pro_tx_hash().to_vec(), - index_values: serialized_index_values, - })) - }); - contested_document_resource_vote_poll.contract.as_ref() - } + ) => contested_document_resource_vote_poll.contract.as_ref(), }, }; - let versioned_request = GetProofsRequest { - version: Some(get_proofs_request::Version::V0(proofs_request)), - }; - - let result = abci_app - .platform - .query_proofs(versioned_request, &state, platform_version) - .expect("expected to query proofs"); - let response = result.into_data().expect("expected queries to be valid"); - - let response_proof = response.proof_owned().expect("proof should be present"); - let vote: Vote = masternode_vote_action.vote_ref().clone().into(); // we expect to get a vote that matches the state transition From 7e542cb47496e7c084823c04c3d7e2cfec0086c0 Mon Sep 17 00:00:00 2001 From: Ivan Shumkov Date: Sat, 12 Apr 2025 19:29:50 +0700 Subject: [PATCH 09/15] fix: internal error if deserialization failed --- packages/rs-drive-abci/src/query/proofs/v0/mod.rs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/packages/rs-drive-abci/src/query/proofs/v0/mod.rs b/packages/rs-drive-abci/src/query/proofs/v0/mod.rs index 53d9709ccf5..2f914226464 100644 --- a/packages/rs-drive-abci/src/query/proofs/v0/mod.rs +++ b/packages/rs-drive-abci/src/query/proofs/v0/mod.rs @@ -36,6 +36,7 @@ use dpp::system_data_contracts::load_system_data_contract; use dpp::version::PlatformVersion; use dpp::voting::votes::resource_vote::accessors::v0::ResourceVoteGettersV0; use dpp::voting::votes::Vote; +use dpp::ProtocolError; use drive::drive::Drive; use drive::error::proof::ProofError; use drive::query::{ @@ -60,8 +61,15 @@ impl Platform { platform_state: &PlatformState, platform_version: &PlatformVersion, ) -> Result, Error> { - let state_transition: StateTransition = - StateTransition::deserialize_from_bytes(&state_transition_bytes)?; + let state_transition = + match StateTransition::deserialize_from_bytes(&state_transition_bytes) { + Ok(state_transition) => state_transition, + Err(e) => { + return Ok(QueryValidationResult::new_with_error(QueryError::Protocol( + e, + ))) + } + }; let path_query = match state_transition { StateTransition::DataContractCreate(st) => { From 926b0c95e70deb003b3cb8f860802b17d347c316 Mon Sep 17 00:00:00 2001 From: Ivan Shumkov Date: Sat, 12 Apr 2025 21:24:57 +0700 Subject: [PATCH 10/15] docs: document DAPI --- packages/dapi/README.md | 65 ++----- packages/dapi/doc/CONFIGURATION.md | 26 --- packages/dapi/doc/REFERENCE.md | 57 ------ packages/dapi/doc/architecture.md | 145 +++++++++++++++ packages/dapi/doc/configuration.md | 132 +++++++++++++ .../dapi/doc/dependencies_configs/dash.conf | 33 ---- packages/dapi/doc/endpoints/core-endpoints.md | 176 ++++++++++++++++++ packages/dapi/doc/endpoints/index.md | 94 ++++++++++ .../dapi/doc/endpoints/json-rpc-endpoints.md | 120 ++++++++++++ .../dapi/doc/endpoints/platform-endpoints.md | 126 +++++++++++++ packages/dapi/doc/getting-started.md | 156 ++++++++++++++++ packages/dapi/doc/index.md | 58 ++++++ packages/dapi/doc/overview.md | 70 +++++++ packages/dapi/doc/processes.md | 111 +++++++++++ packages/dapi/doc/swaggerDef.js | 75 -------- 15 files changed, 1203 insertions(+), 241 deletions(-) delete mode 100644 packages/dapi/doc/CONFIGURATION.md delete mode 100644 packages/dapi/doc/REFERENCE.md create mode 100644 packages/dapi/doc/architecture.md create mode 100644 packages/dapi/doc/configuration.md delete mode 100755 packages/dapi/doc/dependencies_configs/dash.conf create mode 100644 packages/dapi/doc/endpoints/core-endpoints.md create mode 100644 packages/dapi/doc/endpoints/index.md create mode 100644 packages/dapi/doc/endpoints/json-rpc-endpoints.md create mode 100644 packages/dapi/doc/endpoints/platform-endpoints.md create mode 100644 packages/dapi/doc/getting-started.md create mode 100644 packages/dapi/doc/index.md create mode 100644 packages/dapi/doc/overview.md create mode 100644 packages/dapi/doc/processes.md delete mode 100644 packages/dapi/doc/swaggerDef.js diff --git a/packages/dapi/README.md b/packages/dapi/README.md index bc6afbaa742..1e2204c3493 100644 --- a/packages/dapi/README.md +++ b/packages/dapi/README.md @@ -5,64 +5,29 @@ A decentralized API for the Dash network -## Table of Contents -- [Install](#install) - - [Dependencies](#dependencies) -- [Usage](#usage) -- [Configuration](#configuration) -- [Making requests](#making-basic-requests) -- [API Reference](#api-reference) -- [Contributing](#contributing) -- [License](#license) +## Overview -## Install +DAPI (Decentralized API) is the decentralized HTTP API layer for the Dash Evolution platform. It provides a simple interface for accessing the Dash network, both for traditional Dash functionality and for the Dash Platform features. -```sh -npm install -``` +DAPI is designed to be run on the Dash masternode network, providing a decentralized, high-availability API service with no single point of failure. -### Dependencies +## Documentation -DAPI targets the latest v20 release of Node.js. +Comprehensive documentation for DAPI is available in the [doc](./doc) directory: -DAPI requires the latest version of [dashcore](https://github.com/dashevo/dash-evo-branches/tree/evo) with Evolution features (special branch repo). +- [Getting Started](./doc/getting-started.md) - Quick start guide for developers +- [Architecture](./doc/architecture.md) - Overview of DAPI's design +- [Configuration](./doc/configuration.md) - Configure DAPI for your needs +- [Endpoints](./doc/endpoints/index.md) - Available API endpoints -1. **Install core.** You can use the docker image (`dashcore:evo`) or clone code from [the repository](https://github.com/dashevo/dash-evo-branches/tree/evo), switch to the `evo` branch, and build it by yourself. Note: you need to build image with ZMQ and wallet support. You can follow the build instructions located [here](https://github.com/dashevo/dash-evo-branches/tree/evo/doc) -2. **Configure core.** DAPI needs dashcore's ZMQ interface to be exposed and all indexes enabled. You can find the example config for dashcore [here](doc/dependencies_configs/dash.conf). To start dashcore process with this config, copy it somewhere to your system, and then run `./src/dashd -conf=/path/to/your/config`. +## Getting Started -## Usage +To get started with DAPI, see the [Getting Started](./doc/getting-started.md) guide which covers: -After you've installed all the dependencies, you can start DAPI by running the `npm start` command inside the DAPI repo directory. - -```sh -npm start -``` - -## Configuration - -DAPI is configured via environment variables either explicitly passed or present in the `.env` dotfile. For example, to change the DAPI port, execute DAPI with the following arguments: `RPC_SERVER_PORT=3010 npm start`. Consult the sample environment [file](.env.example). You can see the full list of available options [here](doc/CONFIGURATION.md). - -## Making basic requests - -DAPI uses [JSON-RPC 2.0](https://www.jsonrpc.org/specification) as the main interface. If you want to confirm that DAPI is functioning and synced, you can request the best block height. - -Send the following json to your DAPI instance: - -```json -{"jsonrpc": "2.0","method": "getBestBlockHeight", "id": 1} -``` - -Note that you always need to specify an id, otherwise the server will respond with an empty body, as mentioned in the [spec](https://www.jsonrpc.org/specification#notification). - -## API Reference - -A list of all available RPC commands, along with their various arguments and expected responses can be found [here](doc/REFERENCE.md) - -Implementation of these commands can be viewed [here](lib/rpcServer/commands). - -## Contributing - -Feel free to dive in! [Open an issue](https://github.com/dashpay/platform/issues/new/choose) or submit PRs. +- Installation and configuration +- Setting up dependencies +- Running DAPI processes +- Making API requests ## License diff --git a/packages/dapi/doc/CONFIGURATION.md b/packages/dapi/doc/CONFIGURATION.md deleted file mode 100644 index 068e72f519b..00000000000 --- a/packages/dapi/doc/CONFIGURATION.md +++ /dev/null @@ -1,26 +0,0 @@ -[Back to the main page](/README.md) - -# DAPI configuration - -DAPI is configured via environment variables. So, for example, in order to change rpc server port, you need to run `RPC_SERVER_PORT=3010 npm start`. - -## Full list of available options - -* `LIVENET` - boolean. Set to true if you are going to run DAPI on the livenet. Defaults to `false`. -* `RPC_SERVER_PORT` - integer. Port on which DAPI server will listen. Defaults to `3000` -* `DASHCORE_RPC_PROTOCOL` string. Protocol for connecting to dashcore RPC. Defaults to `http` -* `DASHCORE_RPC_USER`. Defaults to `dashrpc` -* `DASHCORE_RPC_PASS`. Defaults to `password` -* `DASHCORE_RPC_HOST`. Defaults to `127.0.0.1` -* `DASHCORE_RPC_PORT`. Defaults to `30002` -* `DASHCORE_ZMQ_HOST`. Defaults to `127.0.0.1` -* `DASHCORE_ZMQ_PORT`. Defaults to `30003` -* `DASHCORE_P2P_HOST`. Defaults to `127.0.0.1` -* `DASHCORE_P2P_PORT`. Defaults to `30001` -* `DRIVE_RPC_HOST`. Defaults to `127.0.0.1` -* `DRIVE_RPC_PORT`. Defaults to `6000` -* `DASHCORE_P2P_NETWORK`. Can be `testnet`, `regtest` and `livenet`. Defaults to `testnet` -* `NETWORK` Can be `testnet`, `regtest` and `livenet` Defaults to `testnet` -* `BLOOM_FILTER_PERSISTENCE_TIMEOUT` - integer. Bloom filter persistence timeout in milliseconds. Defaults to 1 minute. - -[Back to the main page](/README.md) diff --git a/packages/dapi/doc/REFERENCE.md b/packages/dapi/doc/REFERENCE.md deleted file mode 100644 index fb814322ffa..00000000000 --- a/packages/dapi/doc/REFERENCE.md +++ /dev/null @@ -1,57 +0,0 @@ -[Back to the main page](/README.md) - -## API Reference - -### Table of Contents - -- [Layer 1 endpoints](#layer-1-endpoints) - - - [generate](#generate) - - [getBestBlockHash](#getbestblockhash) - - [getBlockHash](#getblockhash) - -## Layer 1 endpoints - -### getBestBlockHash - -Returns best block hash (hash of the chaintip) - -*takes no arguments* - -##### Response - -| name | type | description | -|--------------|------------------|----------------------------------------| -| blockHash | promise (string) | hash of chaintip | - ---- - -### getBestBlockHeight - -Returns best block height (height of the chaintip) - -*takes no arguments* - -##### Response - -| name | type | description | -|--------|------------------|--------------------| -| height | promise (string) | height of chaintip | - ---- - -### getBlockHash - -Returns block hash for a given height. - -##### Params - -| name | type | description | -|--------------|--------|----------------------------------------| -| args.height | number | block height | - -##### Response - -| name | type | description | -|------------|------------------|---------------------------------------------| -| blockHash | promise (string) | promise containing a string of a block hash | diff --git a/packages/dapi/doc/architecture.md b/packages/dapi/doc/architecture.md new file mode 100644 index 00000000000..629885ef735 --- /dev/null +++ b/packages/dapi/doc/architecture.md @@ -0,0 +1,145 @@ +# DAPI Architecture + +This document explains the high-level architecture of DAPI, its components, and how they interact with the Dash ecosystem. + +## Overview + +DAPI (Decentralized API) serves as the gateway to the Dash network, providing access to both Dash Core blockchain functionality and Dash Platform (Evolution) features. Unlike traditional centralized APIs, DAPI is designed to run on the Dash masternode network, ensuring high availability and censorship resistance. + +## Architecture Diagram + +``` +┌─────────────────────────────────────────────────────┐ +│ DAPI │ +│ │ +│ ┌───────────────────┐ ┌─────────────────────┐ │ +│ │ │ │ │ │ +│ │ API Process │ │ Core Streams │ │ +│ │ (api.js) │ │ Process │ │ +│ │ │ │ (core-streams.js) │ │ +│ │ - Core endpoints │ │ │ │ +│ │ - Platform │ │ - Block streaming │ │ +│ │ endpoints │ │ - TX streaming │ │ +│ │ - JSON-RPC │ │ - Masternode list │ │ +│ │ │ │ streaming │ │ +│ └───────┬───────────┘ └─────────┬───────────┘ │ +│ │ │ │ +└──────────┼──────────────────────────┼───────────────┘ + │ │ + ▼ ▼ +┌──────────────────────┐ ┌─────────────────────────┐ +│ │ │ │ +│ Dash Core │ │ Drive & Tenderdash │ +│ │ │ │ +│ - Blockchain │ │ - Platform State │ +│ - Mempool │ │ - Data Contracts │ +│ - Wallet │ │ - Identities │ +│ - P2P Network │ │ - Documents │ +│ │ │ │ +└──────────────────────┘ └─────────────────────────┘ +``` + +## Key Components + +### 1. API Process (`api.js`) + +The API process is the main entry point for DAPI. It handles non-streaming API requests through both gRPC and JSON-RPC interfaces. + +**Responsibilities:** +- Serve Core blockchain endpoints via gRPC +- Serve Platform (Evolution) endpoints via gRPC +- Provide legacy JSON-RPC endpoints + +**Dependencies:** +- Dash Core (via RPC and ZMQ) +- Drive (via gRPC) +- Tenderdash (via RPC and WebSocket) + +### 2. Core Streams Process (`core-streams.js`) + +The Core Streams process handles long-running streaming connections that provide real-time updates about the Dash network. + +**Responsibilities:** +- Stream block headers and chain locks +- Stream transactions matching bloom filters +- Stream masternode list updates + +**Dependencies:** +- Dash Core (via RPC and ZMQ) +- Chain Data Provider (internal) +- Bloom Filter Emitter (internal) + +## Interfaces + +DAPI provides two main interfaces for client interaction: + +### gRPC Interface + +The primary and recommended interface, using Protocol Buffers for efficient, typed communication. Supports: +- Request/response endpoints +- Server-side streaming endpoints +- Strong typing and versioning + +### JSON-RPC Interface + +A legacy interface provided for compatibility with existing tools. Features: +- Compatible with the JSON-RPC 2.0 specification +- Limited subset of Dash Core's JSON-RPC functionality +- No streaming capabilities + +## Connection to the Dash Ecosystem + +DAPI connects to several underlying services: + +### Dash Core + +DAPI communicates with Dash Core in two ways: +- **RPC Interface**: For direct blockchain queries and commands +- **ZMQ Interface**: For real-time notifications of new blocks, transactions, and chainlocks + +### Drive + +For Platform functionality, DAPI connects to Drive via gRPC. Drive is responsible for: +- Processing and validating state transitions +- Maintaining Platform state (data contracts, documents, identities) +- Providing proofs for Platform operations + +### Tenderdash + +DAPI connects to Tenderdash (a modified version of Tendermint) which serves as the consensus engine for Dash Platform. Connections include: +- **RPC Interface**: For querying Platform chain state +- **WebSocket Interface**: For subscribing to real-time Platform events + +## Process Flow Examples + +### Example 1: Querying a transaction + +1. Client sends gRPC request to `getTransaction` endpoint +2. API process receives request +3. API process queries Dash Core via RPC +4. Dash Core returns transaction data +5. API process formats the response and returns it to the client + +### Example 2: Subscribing to transactions with a bloom filter + +1. Client creates a bloom filter and connects to `subscribeToTransactionsWithProofs` stream +2. Core Streams process receives the request and registers the bloom filter +3. When Dash Core emits a ZMQ notification for a new transaction: + - Core Streams process tests the transaction against the bloom filter + - If it matches, the transaction is sent to the client with merkle proofs +4. The stream continues until the client disconnects + +## Deployment Considerations + +DAPI is designed to be deployed: + +1. **On Masternodes**: As part of the standard masternode software stack +2. **Standalone**: For development or private deployment + +For production deployments, both the API and Core Streams processes should be running with proper process management (e.g., PM2) to ensure continued operation. + +## Further Information + +- For more details about the processes, see [Processes](./processes.md) +- For configuration options, see [Configuration](./configuration.md) +- For available endpoints, see [Endpoints](./endpoints/index.md) \ No newline at end of file diff --git a/packages/dapi/doc/configuration.md b/packages/dapi/doc/configuration.md new file mode 100644 index 00000000000..fa2d22b9149 --- /dev/null +++ b/packages/dapi/doc/configuration.md @@ -0,0 +1,132 @@ +# DAPI Configuration + +This document describes how to configure DAPI for different environments and use cases. + +## Configuration Options + +DAPI can be configured through environment variables. Here are the available configuration options: + +| Environment Variable | Description | Default Value | +|----------------------|-------------|---------------| +| LIVENET | Set to 'true' for live network operation | false | +| API_JSON_RPC_PORT | Port for JSON-RPC server | 2501 | +| API_GRPC_PORT | Port for gRPC server | 2500 | +| TX_FILTER_STREAM_GRPC_PORT | Port for transaction filter stream gRPC server | 2510 | +| DASHCORE_RPC_PROTOCOL | Protocol for Dash Core RPC | http | +| DASHCORE_RPC_USER | Username for Dash Core RPC | dashrpc | +| DASHCORE_RPC_PASS | Password for Dash Core RPC | password | +| DASHCORE_RPC_HOST | Host for Dash Core RPC | 127.0.0.1 | +| DASHCORE_RPC_PORT | Port for Dash Core RPC | 30002 | +| DASHCORE_ZMQ_HOST | Host for Dash Core ZMQ | 127.0.0.1 | +| DASHCORE_ZMQ_PORT | Port for Dash Core ZMQ | 30003 | +| DASHCORE_P2P_HOST | Host for Dash Core P2P | 127.0.0.1 | +| DASHCORE_P2P_PORT | Port for Dash Core P2P | 30001 | +| DASHCORE_P2P_NETWORK | Network for Dash Core P2P | testnet | +| DRIVE_RPC_HOST | Host for Drive RPC | 127.0.0.1 | +| DRIVE_RPC_PORT | Port for Drive RPC | 6000 | +| BLOCK_HEADERS_CACHE_SIZE | Size of block headers cache | 500 | +| NETWORK | Network to connect to | testnet | +| BLOOM_FILTER_PERSISTENCE_TIMEOUT | Timeout for bloom filter persistence (ms) | 60000 | +| TENDERMINT_RPC_HOST | Host for Tendermint RPC | undefined | +| TENDERMINT_RPC_PORT | Port for Tendermint RPC | undefined | + +## Setting Up Dependencies + +DAPI requires the following dependencies to operate correctly: + +### Dash Core + +Dash Core is required for DAPI to access the Dash blockchain. You need to configure ZMQ for the following topics: + +``` +zmqpubhashblock=tcp://0.0.0.0:30003 +zmqpubhashtx=tcp://0.0.0.0:30003 +zmqpubrawblock=tcp://0.0.0.0:30003 +zmqpubrawtx=tcp://0.0.0.0:30003 +zmqpubhashchainlock=tcp://0.0.0.0:30003 +zmqpubrawchainlock=tcp://0.0.0.0:30003 +zmqpubhashgovernancevote=tcp://0.0.0.0:30003 +zmqpubhashgovernanceobject=tcp://0.0.0.0:30003 +zmqpubrawgovernancevote=tcp://0.0.0.0:30003 +zmqpubhashinstantsenddoublesend=tcp://0.0.0.0:30003 +zmqpubrawinstantsenddoublesend=tcp://0.0.0.0:30003 +zmqpubhashinstantsendsuccess=tcp://0.0.0.0:30003 +zmqpubrawinstantsendsuccess=tcp://0.0.0.0:30003 +zmqpubrawtxlocksig=tcp://0.0.0.0:30003 +``` + +You can find a sample configuration for Dash Core in [doc/dependencies_configs/dash.conf](./dependencies_configs/dash.conf). + +### Drive + +Drive is required for DAPI to interact with Dash Platform's state. Configure the Drive RPC connection using the following environment variables: + +``` +DRIVE_RPC_HOST=127.0.0.1 +DRIVE_RPC_PORT=6000 +``` + +### Tenderdash + +Tenderdash is the consensus engine for Dash Platform. Configure the Tenderdash connection using: + +``` +TENDERMINT_RPC_HOST=127.0.0.1 +TENDERMINT_RPC_PORT=26657 +``` + +## Running DAPI + +DAPI runs two separate processes: + +1. **API Process**: Handles gRPC and JSON-RPC requests + ``` + node scripts/api.js + ``` + +2. **Core Streams Process**: Handles streaming data + ``` + node scripts/core-streams.js + ``` + +Both processes should be running for DAPI to function correctly. For more details about these processes, see the [Architecture](./architecture.md) document. + +## Production Configuration + +For production environments, it's recommended to: + +1. Use a process manager like PM2 to ensure processes stay running +2. Set `NODE_ENV=production` to optimize error handling +3. Use HTTPS for production deployments +4. Configure proper security measures (firewalls, authentication) + +Example PM2 configuration: + +```json +{ + "apps": [ + { + "name": "dapi-api", + "script": "scripts/api.js", + "env": { + "NODE_ENV": "production", + "LIVENET": "true" + } + }, + { + "name": "dapi-core-streams", + "script": "scripts/core-streams.js", + "env": { + "NODE_ENV": "production", + "LIVENET": "true" + } + } + ] +} +``` + +## Next Steps + +- Learn more about DAPI's architecture in the [Architecture](./architecture.md) document +- Explore available endpoints in the [Endpoints](./endpoints/index.md) section +- Get started with DAPI using the [Getting Started](./getting-started.md) guide \ No newline at end of file diff --git a/packages/dapi/doc/dependencies_configs/dash.conf b/packages/dapi/doc/dependencies_configs/dash.conf deleted file mode 100755 index f81fa8ae390..00000000000 --- a/packages/dapi/doc/dependencies_configs/dash.conf +++ /dev/null @@ -1,33 +0,0 @@ -# general -daemon=0 # set it to 1 if you want to run dash as a daemon process -logtimestamps=1 -maxconnections=256 -debug=0 -printtoconsole=1 - -# Enabling indices -txindex=1 -addressindex=1 -timestampindex=1 -spentindex=1 - -# Enabling ZeroMQ notifications -zmqpubrawtx=tcp://0.0.0.0:30003 -zmqpubrawtxlock=tcp://0.0.0.0:30003 -zmqpubhashblock=tcp://0.0.0.0:30003 -#zmqpubhashtx=tcp://0.0.0.0:30003 -#zmqpubhashtxlock=tcp://0.0.0.0:30003 -#zmqpubrawblock=tcp://0.0.0.0:30003 - -# JSONRPC -server=1 -rpcuser=dashrpc -rpcpassword=password -rpcport=30002 -rpcbind=0.0.0.0 -rpcallowip=0.0.0.0/0 -rpcworkqueue=64 - -# external network -listen=1 -bind=0.0.0.0 diff --git a/packages/dapi/doc/endpoints/core-endpoints.md b/packages/dapi/doc/endpoints/core-endpoints.md new file mode 100644 index 00000000000..6126fcb635c --- /dev/null +++ b/packages/dapi/doc/endpoints/core-endpoints.md @@ -0,0 +1,176 @@ +# DAPI Core Endpoints + +These endpoints provide access to the Dash Core blockchain functionality through the gRPC interface. + +## Available Endpoints + +### `getBestBlockHeight` + +Returns the height of the latest block in the chain. + +**Request Parameters**: None + +**Response Parameters**: +- `height`: Height of the best block (number) + +**Example Usage**: +```javascript +const { getBestBlockHeight } = dapiClient.core; +const height = await getBestBlockHeight(); +console.log(`Current block height: ${height}`); +``` + +### `getBlockchainStatus` + +Returns status information about the Dash blockchain. + +**Request Parameters**: None + +**Response Parameters**: +- `chain`: Chain name (e.g., "main", "test", "regtest") +- `blocks`: Current block count +- `headers`: Current header count +- `bestBlockHash`: Hash of the best block +- `difficulty`: Current network difficulty +- `verificationProgress`: Sync progress (0-1) +- `chainWork`: Total chain work in hex +- `softForks`: Information about active and pending soft forks +- `protocolVersion`: P2P protocol version +- `version`: Core software version + +**Example Usage**: +```javascript +const { getBlockchainStatus } = dapiClient.core; +const status = await getBlockchainStatus(); +console.log(`Network: ${status.chain}, Blocks: ${status.blocks}`); +``` + +### `getTransaction` + +Retrieves a transaction by ID. + +**Request Parameters**: +- `id`: Transaction ID (string, required) + +**Response Parameters**: +- `transaction`: Binary buffer containing serialized transaction +- `blockHash`: Hash of the block containing the transaction +- `height`: Height of the block containing the transaction +- `confirmations`: Number of confirmations +- `isInstantLocked`: Whether transaction is instant locked +- `isChainLocked`: Whether transaction is chain locked + +**Example Usage**: +```javascript +const { getTransaction } = dapiClient.core; +const txId = '0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef'; +const tx = await getTransaction(txId); +console.log(`Transaction is in block: ${tx.height}`); +``` + +### `broadcastTransaction` + +Broadcasts a transaction to the Dash network. + +**Request Parameters**: +- `transaction`: Binary buffer containing serialized transaction (required) + +**Response Parameters**: +- `transactionId`: ID of the broadcast transaction (string) + +**Example Usage**: +```javascript +const { broadcastTransaction } = dapiClient.core; +const txHex = '0200000001...'; // Raw transaction hex +const result = await broadcastTransaction(txHex); +console.log(`Transaction broadcast with ID: ${result.transactionId}`); +``` + +## Stream Endpoints + +These endpoints are provided by the Core Streams Process. + +### `subscribeToMasternodeList` + +Subscribes to masternode list updates. + +**Request Parameters**: None + +**Response Parameters**: +- Stream of `masternodeListDiff` messages with masternode list differences + +**Example Usage**: +```javascript +const { subscribeToMasternodeList } = dapiClient.core; +const stream = subscribeToMasternodeList(); + +stream.on('data', (masternodeListDiff) => { + console.log('Masternode list updated:', masternodeListDiff); +}); +``` + +### `subscribeToTransactionsWithProofs` + +Streams transactions matching a bloom filter with merkle proofs. + +**Request Parameters**: +- `bloomFilter`: Parameters for bloom filter (object, required) + - `vData`: Filter data + - `nHashFuncs`: Number of hash functions + - `nTweak`: Random value + - `nFlags`: Bloom filter update flags +- `fromBlockHash` or `fromBlockHeight`: Starting point (optional) +- `count`: Number of blocks to fetch (0 means subscribe to new transactions) + +**Response Parameters**: +- Stream of transactions, merkle blocks, and instant lock messages + +**Example Usage**: +```javascript +const { subscribeToTransactionsWithProofs } = dapiClient.core; + +const bloomFilter = { + vData: '...', + nHashFuncs: 11, + nTweak: 0, + nFlags: 0 +}; + +const stream = subscribeToTransactionsWithProofs(bloomFilter); + +stream.on('data', (response) => { + if (response.rawMerkleBlock) { + console.log('Received merkle block'); + } else if (response.rawTransaction) { + console.log('Received transaction'); + } else if (response.instantSendLockMessages) { + console.log('Received instant send lock'); + } +}); +``` + +### `subscribeToBlockHeadersWithChainLocks` + +Streams block headers and chain locks. + +**Request Parameters**: +- `fromBlockHash` or `fromBlockHeight`: Starting point (optional) +- `count`: Number of blocks to fetch (0 means subscribe to new blocks) + +**Response Parameters**: +- Stream of block headers and chain locks + +**Example Usage**: +```javascript +const { subscribeToBlockHeadersWithChainLocks } = dapiClient.core; + +const stream = subscribeToBlockHeadersWithChainLocks({ fromBlockHeight: 1000, count: 10 }); + +stream.on('data', (response) => { + if (response.rawBlockHeader) { + console.log('Received block header'); + } else if (response.rawChainLock) { + console.log('Received chain lock'); + } +}); +``` \ No newline at end of file diff --git a/packages/dapi/doc/endpoints/index.md b/packages/dapi/doc/endpoints/index.md new file mode 100644 index 00000000000..313eb519e09 --- /dev/null +++ b/packages/dapi/doc/endpoints/index.md @@ -0,0 +1,94 @@ +# DAPI Endpoints Overview + +DAPI offers a variety of endpoints through two main interfaces: gRPC and JSON-RPC. This document provides an overview of all available endpoints and links to detailed documentation. + +## Interface Types + +### gRPC (Recommended) + +The gRPC interface is the recommended way to interact with DAPI. It offers: +- Better performance +- Strong typing +- Streaming capabilities +- Native support in many languages + +### JSON-RPC (Legacy) + +The JSON-RPC interface is provided for backward compatibility and will eventually be deprecated. It offers: +- HTTP-based requests +- Compatibility with existing tools +- Simpler integration for basic use cases + +## Endpoint Categories + +DAPI endpoints are organized into three main categories: + +### 1. Core Endpoints + +These endpoints provide access to the underlying Dash blockchain (Core) functionality, such as blocks, transactions, and network status. + +**Main gRPC endpoints:** +- [`getBestBlockHeight`](./core-endpoints.md#getbestblockheight) - Returns the current blockchain height +- [`getBlockchainStatus`](./core-endpoints.md#getblockchainstatus) - Returns blockchain status information +- [`getTransaction`](./core-endpoints.md#gettransaction) - Retrieves transaction data by ID +- [`broadcastTransaction`](./core-endpoints.md#broadcasttransaction) - Broadcasts a raw transaction to the network + +**Learn more:** [Core Endpoints Documentation](./core-endpoints.md) + +### 2. Platform Endpoints + +These endpoints provide access to Dash Platform (Evolution) features, enabling interaction with decentralized applications, identities, and data contracts. + +**Main gRPC endpoints:** +- [`broadcastStateTransition`](./platform-endpoints.md#broadcaststatetransition) - Broadcasts a state transition to the platform +- [`waitForStateTransitionResult`](./platform-endpoints.md#waitforstatetransitionresult) - Waits for a state transition to be processed +- [`getConsensusParams`](./platform-endpoints.md#getconsensusparams) - Retrieves platform consensus parameters +- [`getStatus`](./platform-endpoints.md#getstatus) - Gets platform status information + +**Learn more:** [Platform Endpoints Documentation](./platform-endpoints.md) + +### 3. Stream Endpoints + +These endpoints provide real-time streaming data from the Dash network, including blocks, transactions, and masternode list updates. + +**Main streaming endpoints:** +- [`subscribeToBlockHeadersWithChainLocks`](./core-endpoints.md#subscribetoBlockHeadersWithChainLocks) - Stream block headers and chain locks +- [`subscribeToTransactionsWithProofs`](./core-endpoints.md#subscribetoTransactionsWithProofs) - Stream transactions matching a bloom filter +- [`subscribeToMasternodeList`](./core-endpoints.md#subscribetomasterNodeList) - Stream masternode list updates + +### 4. JSON-RPC Endpoints + +These endpoints provide a subset of Dash Core functionality through the JSON-RPC interface for backward compatibility. + +**Available endpoints:** +- [`getBestBlockHash`](./json-rpc-endpoints.md#getbestblockhash) - Returns the hash of the best block +- [`getBlockHash`](./json-rpc-endpoints.md#getblockhash) - Returns the hash of a block at a specific height + +**Learn more:** [JSON-RPC Endpoints Documentation](./json-rpc-endpoints.md) + +## Using the Endpoints + +### Direct Access + +You can access these endpoints directly using gRPC or JSON-RPC clients: + +**gRPC Example (using grpcurl):** +```bash +grpcurl -plaintext localhost:2500 org.dash.platform.dapi.v0.Core/getBestBlockHeight +``` + +**JSON-RPC Example (using curl):** +```bash +curl -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"getBestBlockHash","params":[],"id":1}' http://localhost:2501 +``` + +### Client Libraries + +For most applications, it's recommended to use one of the DAPI client libraries: + +- [Dash SDK (JavaScript)](https://docs.dash.org/projects/platform/en/stable/docs/sdk-js/overview.html) +- [Dash SDK (Rust)](https://docs.dash.org/projects/platform/en/stable/docs/sdk-rs/overview.html) +- [DAPI Client (JavaScript)](https://docs.dash.org/projects/platform/en/stable/docs/dapi-client-js/overview.html) +- [gRPC Clients](https://github.com/dashpay/platform/tree/master/packages/dapi-grpc) (for other languages) + +These client libraries handle the complexity of interacting with DAPI and provide a more convenient interface for developers. \ No newline at end of file diff --git a/packages/dapi/doc/endpoints/json-rpc-endpoints.md b/packages/dapi/doc/endpoints/json-rpc-endpoints.md new file mode 100644 index 00000000000..c0fa3eae836 --- /dev/null +++ b/packages/dapi/doc/endpoints/json-rpc-endpoints.md @@ -0,0 +1,120 @@ +# DAPI JSON-RPC Endpoints + +DAPI provides a set of JSON-RPC endpoints for backward compatibility with traditional blockchain APIs. These endpoints follow the JSON-RPC 2.0 specification. + +## JSON-RPC Specification + +All requests must follow the JSON-RPC 2.0 format: + +```json +{ + "jsonrpc": "2.0", + "method": "methodName", + "params": [], + "id": 1 +} +``` + +Responses will be in the following format: + +```json +{ + "jsonrpc": "2.0", + "result": {}, + "error": null, + "id": 1 +} +``` + +## Available Endpoints + +### `getBestBlockHash` + +Returns the hash of the best (tip) block in the longest blockchain. + +**Parameters**: None + +**Result**: +- String - the block hash, hex encoded + +**Example Request**: +```json +{ + "jsonrpc": "2.0", + "method": "getBestBlockHash", + "params": [], + "id": 1 +} +``` + +**Example Response**: +```json +{ + "jsonrpc": "2.0", + "result": "0000000000000000000f2adce67e48b6c9ae0f0507c739db9a55f56d85662bc8", + "error": null, + "id": 1 +} +``` + +### `getBlockHash` + +Returns hash of block in best-block-chain at height provided. + +**Parameters**: +1. `height` (number, required) - The height index + +**Result**: +- String - The block hash, hex encoded + +**Example Request**: +```json +{ + "jsonrpc": "2.0", + "method": "getBlockHash", + "params": [1000], + "id": 1 +} +``` + +**Example Response**: +```json +{ + "jsonrpc": "2.0", + "result": "00000000000345089c8a91d47b62ca6a1e4d0e8df7f86df9e2e50e62bcdf2887", + "error": null, + "id": 1 +} +``` + +## Error Handling + +JSON-RPC endpoints return standard error codes as defined in the JSON-RPC 2.0 specification. In addition, DAPI may return additional error details in the error object: + +```json +{ + "jsonrpc": "2.0", + "result": null, + "error": { + "code": -32602, + "message": "Invalid params", + "data": "Height parameter out of range" + }, + "id": 1 +} +``` + +Common error codes: +- `-32600`: Invalid Request - The JSON sent is not a valid Request object +- `-32601`: Method not found - The method does not exist / is not available +- `-32602`: Invalid params - Invalid method parameter(s) +- `-32603`: Internal error - Internal JSON-RPC error +- `-32700`: Parse error - Invalid JSON was received by the server + +## Connection Details + +The JSON-RPC server listens on port 2501 by default (configurable via `API_JSON_RPC_PORT` environment variable). + +## Compatibility Notes + +These endpoints are designed to provide a subset of the functionality available in Dash Core's JSON-RPC interface. For comprehensive access to all Dash Core functionality, you should connect directly to a Dash Core node's JSON-RPC interface. \ No newline at end of file diff --git a/packages/dapi/doc/endpoints/platform-endpoints.md b/packages/dapi/doc/endpoints/platform-endpoints.md new file mode 100644 index 00000000000..4b7b7b8f06a --- /dev/null +++ b/packages/dapi/doc/endpoints/platform-endpoints.md @@ -0,0 +1,126 @@ +# DAPI Platform Endpoints + +These endpoints provide access to Dash Platform (Evolution) functionality through the gRPC interface. + +## Available Endpoints + +### `broadcastStateTransition` + +Broadcasts a state transition to the Dash Platform. + +**Request Parameters**: +- `stateTransition`: Binary buffer containing serialized state transition (required) + +**Response Parameters**: +- Empty response on success + +**Example Usage**: +```javascript +const { broadcastStateTransition } = dapiClient.platform; +const stateTransitionHex = '0200000001...'; // State transition hex +const result = await broadcastStateTransition(stateTransitionHex); +``` + +### `getConsensusParams` + +Retrieves consensus parameters from the Dash Platform. + +**Request Parameters**: +- `height`: Height at which to fetch parameters (optional) +- `prove`: Whether to include proofs (not implemented) + +**Response Parameters**: +- `blockMaxBytes`: Maximum block size in bytes +- `blockMaxGas`: Maximum gas allowed per block +- `blockTime`: Target block time in milliseconds +- `evidenceMaxAgeNumBlocks`: Maximum age of evidence in blocks +- `evidenceMaxAgeDuration`: Maximum age of evidence in nanoseconds +- `evidenceMaxBytes`: Maximum evidence size in bytes + +**Example Usage**: +```javascript +const { getConsensusParams } = dapiClient.platform; +const params = await getConsensusParams(); +console.log(`Block time: ${params.blockTime}ms`); +``` + +### `getStatus` + +Gets the status of the Dash Platform. + +**Request Parameters**: None + +**Response Parameters**: +- `version`: Version information + - `protocol`: Protocol version + - `software`: Software version + - `agent`: User agent string +- `time`: Various time data + - `now`: Current server time + - `block`: Latest block time + - `sync`: Sync status time information +- `status`: General status information + - `sync`: Sync status + - `chain`: Chain information + - `network`: Network information + +**Example Usage**: +```javascript +const { getStatus } = dapiClient.platform; +const status = await getStatus(); +console.log(`Platform version: ${status.version.software}`); +``` + +### `waitForStateTransitionResult` + +Waits for a state transition to be processed and returns the result. + +**Request Parameters**: +- `stateTransitionHash`: Hash of the state transition to wait for (string, required) +- `prove`: Whether to include proof in response (boolean, optional) + +**Response Parameters**: +If successful: +- `status`: Status of the state transition (number) +- `proof`: Proof data if requested + +If failure: +- `status`: Status of the state transition (number) +- `errorCode`: Error code number +- `errorMessage`: Detailed error message + +**Example Usage**: +```javascript +const { waitForStateTransitionResult } = dapiClient.platform; +const hash = '0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef'; +try { + const result = await waitForStateTransitionResult(hash); + console.log(`State transition processed with status: ${result.status}`); +} catch (error) { + console.error(`State transition failed: ${error.message}`); +} +``` + +## Unimplemented Endpoints + +The following endpoints are defined in the API but are currently unimplemented: + +- `getIdentity` +- `getIdentitiesContractKeys` +- `getIdentityBalance` +- `getIdentityBalanceAndRevision` +- `getIdentityKeys` +- `getDocuments` +- `getDataContract` +- `getDataContracts` +- `getDataContractHistory` +- `getIdentityByPublicKeyHash` +- `getIdentitiesByPublicKeyHashes` +- `getProofs` +- `getEpochsInfo` +- `getProtocolVersionUpgradeVoteStatus` +- `getProtocolVersionUpgradeState` +- `getIdentityContractNonce` +- `getIdentityNonce` + +These endpoints may be implemented in future releases of DAPI as the Platform functionality expands. \ No newline at end of file diff --git a/packages/dapi/doc/getting-started.md b/packages/dapi/doc/getting-started.md new file mode 100644 index 00000000000..b8a02c1ffa7 --- /dev/null +++ b/packages/dapi/doc/getting-started.md @@ -0,0 +1,156 @@ +# Getting Started with DAPI + +This guide will help you set up DAPI, understand its dependencies, and make your first API requests. + +## Installation + +To install DAPI, follow these steps: + +```sh +# Clone the repository (if you haven't already) +git clone https://github.com/dashpay/platform.git +cd platform/packages/dapi + +# Install dependencies +npm install +``` + +## Dependencies + +DAPI requires several dependencies to function properly: + +### 1. Node.js + +DAPI targets the latest v20 release of Node.js. + +### 2. Dash Core + +DAPI requires the latest version of [Dash Core](https://github.com/dashevo/dash-evo-branches/tree/evo) with Evolution features. + +#### Installing Dash Core: + +You can either: +- Use the Docker image: `dashcore:evo` +- Clone and build from [the repository](https://github.com/dashevo/dash-evo-branches/tree/evo) + - Switch to the `evo` branch + - Follow the [build instructions](https://github.com/dashevo/dash-evo-branches/tree/evo/doc) + +#### Configuring Dash Core: + +DAPI needs Dash Core's ZMQ interface to be exposed and all indexes enabled. You can find an example config for Dash Core [here](./dependencies_configs/dash.conf). + +To start Dash Core with this config: +```sh +./src/dashd -conf=/path/to/your/dash.conf +``` + +### 3. Drive and Tenderdash + +For Platform functionality, DAPI requires Drive and Tenderdash. The easiest way to set up a local development environment with all components is to use [Dash Platform Test Suite](https://github.com/dashevo/platform-test-suite). + +## Configuration + +DAPI is configured through environment variables, which can be passed directly or via a `.env` file. The main configuration options include: + +- `API_JSON_RPC_PORT`: JSON-RPC server port (default: 2501) +- `API_GRPC_PORT`: gRPC server port (default: 2500) +- `TX_FILTER_STREAM_GRPC_PORT`: Transaction filter stream port (default: 2510) +- `DASHCORE_RPC_HOST`, `DASHCORE_RPC_PORT`, `DASHCORE_RPC_USER`, `DASHCORE_RPC_PASS`: Dash Core connection settings +- `DRIVE_RPC_HOST`, `DRIVE_RPC_PORT`: Drive connection settings +- `TENDERMINT_RPC_HOST`, `TENDERMINT_RPC_PORT`: Tenderdash connection settings + +For a complete list of configuration options, see the [Configuration](./configuration.md) document. + +## Running DAPI + +DAPI consists of two separate processes: + +```sh +# Start both processes using npm +npm start + +# Or start them individually +node scripts/api.js # API process +node scripts/core-streams.js # Core Streams process +``` + +Both processes should be running for DAPI to function correctly. + +## Making API Requests + +DAPI provides two interfaces: gRPC (recommended) and JSON-RPC (legacy). + +### gRPC Examples + +For gRPC, you can use client libraries in various languages or tools like [grpcurl](https://github.com/fullstorydev/grpcurl) for testing: + +```bash +# Get blockchain status +grpcurl -plaintext localhost:2500 org.dash.platform.dapi.v0.Core/getBlockchainStatus + +# Get best block height +grpcurl -plaintext localhost:2500 org.dash.platform.dapi.v0.Core/getBestBlockHeight + +# Get Platform status +grpcurl -plaintext localhost:2500 org.dash.platform.dapi.v0.Platform/getStatus +``` + +### JSON-RPC Examples + +For JSON-RPC, you can use any HTTP client, like `curl`: + +```bash +# Get best block hash +curl -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"getBestBlockHash","params":[],"id":1}' http://localhost:2501 + +# Get block hash at height 1000 +curl -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"getBlockHash","params":[1000],"id":1}' http://localhost:2501 +``` + +## Using Client Libraries + +For application development, we recommend using the DAPI client libraries rather than directly interfacing with DAPI: + +### JavaScript + +```js +const { DAPIClient } = require('@dashevo/dapi-client'); +const client = new DAPIClient(); + +// Core API example +async function getBlockchainInfo() { + const status = await client.core.getBlockchainStatus(); + console.log('Blockchain status:', status); +} + +// Platform API example +async function getPlatformStatus() { + const status = await client.platform.getStatus(); + console.log('Platform status:', status); +} +``` + +### Streaming Example + +```js +const { DAPIClient } = require('@dashevo/dapi-client'); +const client = new DAPIClient(); + +// Stream block headers +const stream = client.core.subscribeToBlockHeadersWithChainLocks(); + +stream.on('data', (response) => { + if (response.rawBlockHeader) { + console.log('Received block header'); + } else if (response.rawChainLock) { + console.log('Received chain lock'); + } +}); +``` + +## Next Steps + +- Learn about [DAPI's architecture](./architecture.md) +- Explore the [available endpoints](./endpoints/index.md) +- Understand how to [configure DAPI](./configuration.md) for your needs +- Consult the [Dash Platform Developer Documentation](https://docs.dash.org/projects/platform/en/stable/) for more information about the broader Dash Platform ecosystem \ No newline at end of file diff --git a/packages/dapi/doc/index.md b/packages/dapi/doc/index.md new file mode 100644 index 00000000000..89cb457cc38 --- /dev/null +++ b/packages/dapi/doc/index.md @@ -0,0 +1,58 @@ +# DAPI Documentation + +Welcome to the DAPI (Decentralized API) documentation. This guide provides comprehensive information about DAPI, its architecture, configuration, and available endpoints. + +## What is DAPI? + +DAPI (Decentralized API) is the decentralized HTTP API layer for the Dash Evolution platform. It provides a simple interface for accessing both the Dash blockchain (Core) and the Dash Platform (Evolution) features. + +DAPI offers several advantages over traditional centralized APIs: + +- **No single point of failure** - Running on the masternode network ensures high availability +- **Censorship resistance** - No central authority can block access +- **Built-in scalability** - As the masternode network grows, API capacity grows +- **Multiple interfaces** - Supports both modern gRPC and legacy JSON-RPC + +## DAPI Architecture + +DAPI consists of two main processes: + +1. **API Process** - Handles standard gRPC and JSON-RPC endpoints: + - Core blockchain endpoints + - Platform (Evolution) endpoints + - Legacy JSON-RPC endpoints + +2. **Core Streams Process** - Handles streaming data endpoints: + - Block headers streaming + - Transaction filtering and streaming + - Masternode list updates + +Each process connects independently to the underlying Dash infrastructure (Core, Drive, and Tenderdash) to provide its functionality. + +Learn more about DAPI's architecture in the [Architecture](./architecture.md) section. + +## Documentation Sections + +### Getting Started +- [Getting Started](./getting-started.md) - Quick start guide for developers + +### Core Documentation +- [Architecture](./architecture.md) - Detailed explanation of DAPI's design +- [Configuration](./configuration.md) - How to configure DAPI for different environments + +### Endpoints +- [Endpoints Overview](./endpoints/index.md) - Index of all available API endpoints +- [Core Endpoints](./endpoints/core-endpoints.md) - Interact with the Dash blockchain +- [Platform Endpoints](./endpoints/platform-endpoints.md) - Interact with Dash Platform +- [JSON-RPC Endpoints](./endpoints/json-rpc-endpoints.md) - Legacy endpoints + +## Client Libraries + +Rather than directly interacting with DAPI's gRPC or JSON-RPC interfaces, most developers should use one of the official client libraries: + +- [Dash SDK (JavaScript)](https://docs.dash.org/projects/platform/en/stable/docs/sdk-js/overview.html) +- [Dash SDK (Rust)](https://docs.dash.org/projects/platform/en/stable/docs/sdk-rs/overview.html) +- [DAPI Client (JavaScript)](https://docs.dash.org/projects/platform/en/stable/docs/dapi-client-js/overview.html) +- [gRPC Clients](https://github.com/dashpay/platform/tree/master/packages/dapi-grpc) (for other languages) + +These libraries handle the complexity of interacting with DAPI and provide idiomatic interfaces in their respective languages. \ No newline at end of file diff --git a/packages/dapi/doc/overview.md b/packages/dapi/doc/overview.md new file mode 100644 index 00000000000..150e4edf7ad --- /dev/null +++ b/packages/dapi/doc/overview.md @@ -0,0 +1,70 @@ +# DAPI Overview + +DAPI (Decentralized API) is the decentralized API for the Dash Evolution platform. It serves as a distributed and decentralized HTTP API that functions as the developers' access point to the Dash network. + +## What is DAPI? + +DAPI is an HTTP API that allows developers to interact with the Dash network in a simple and efficient way. By being a decentralized solution running on the masternode network, DAPI offers several advantages over traditional centralized APIs: + +- No single point of failure +- Censorship resistance +- High availability +- Built-in scalability + +DAPI supports both traditional Dash operations (sending transactions, querying blocks) and Dash Platform (Evolution) operations (state transitions, data contracts). + +Read more: https://docs.dash.org/projects/platform/en/stable/docs/explanations/dapi.html + +## Architecture + +DAPI consists of two main processes: + +1. **API Process** (`api.js`) - Handles the main gRPC and JSON-RPC endpoints +2. **Core Streams Process** (`core-streams.js`) - Handles streaming endpoints like block headers and transactions + +Each process serves different types of endpoints: + +### API Process Endpoints +- Core endpoints for interacting with Dash Core +- Platform endpoints for Dash Platform (Evolution) services +- Legacy JSON-RPC endpoints + +### Core Streams Process Endpoints +- Block headers streaming +- Transaction streaming with bloom filters +- Masternode list streaming + +For more details about the DAPI architecture, see the [Architecture](./architecture.md) document. + +## DAPI Interfaces + +DAPI offers two main interfaces: + +1. **gRPC** - Modern, high-performance interface using Protocol Buffers +2. **JSON-RPC** - Legacy interface that will be removed in the future. + +The gRPC interface is recommended for new applications due to its better performance, type safety, and streaming capabilities. + +## Getting Started + +To connect to DAPI, you can use either: + +- Dash SDK + - https://docs.dash.org/projects/platform/en/stable/docs/sdk-js/overview.html + - https://docs.dash.org/projects/platform/en/stable/docs/sdk-rs/overview.html +- Low-level DAPI Client + - https://docs.dash.org/projects/platform/en/stable/docs/dapi-client-js/overview.html +- Generated gRPC clients + - https://github.com/dashpay/platform/tree/master/packages/dapi-grpc + +For a step-by-step guide on setting up and using DAPI, see the [Getting Started](./getting-started.md) document. + +## Dependencies + +DAPI relies on several underlying services: + +- **Dash Core** - Provides access to the Dash blockchain +- **Drive ABCI** - Provides access to the Dash Platform state +- **Tenderdash** - Consensus engine for Dash Platform + +See the [Configuration](./configuration.md) document for details on how to set up these dependencies. diff --git a/packages/dapi/doc/processes.md b/packages/dapi/doc/processes.md new file mode 100644 index 00000000000..2e152ae2090 --- /dev/null +++ b/packages/dapi/doc/processes.md @@ -0,0 +1,111 @@ +# DAPI Processes + +DAPI operates using two separate Node.js processes, each handling different aspects of the API functionality. This document explains each process and its responsibilities. + +## 1. API Process (`api.js`) + +The API process is the main entry point for DAPI. It handles the basic gRPC and JSON-RPC endpoints, including both Core and Platform functionality. + +### Responsibilities: + +- **JSON-RPC Server**: Serves legacy JSON-RPC endpoints +- **Core gRPC Endpoints**: Serves Core blockchain endpoints +- **Platform gRPC Endpoints**: Serves Platform (Evolution) endpoints + +### Connections: + +- **Dash Core**: Connects to Core via RPC and ZMQ +- **Drive**: Connects to Drive via gRPC +- **Tenderdash**: Connects to Tenderdash via RPC and WebSocket + +### Startup Sequence: + +1. Load configuration +2. Connect to Dash Core's ZMQ interface +3. Initialize Platform and Drive clients +4. Connect to Tenderdash WebSocket +5. Start JSON-RPC server +6. Start gRPC server with Core and Platform handlers + +### Endpoints Served: + +- **Core gRPC Endpoints**: + - `getBestBlockHeight` + - `getBlockchainStatus` + - `getTransaction` + - `broadcastTransaction` + +- **Platform gRPC Endpoints**: + - `broadcastStateTransition` + - `waitForStateTransitionResult` + - `getConsensusParams` + - `getStatus` + - And various unimplemented endpoints + +- **JSON-RPC Endpoints**: + - `getBestBlockHash` + - `getBlockHash` + +## 2. Core Streams Process (`core-streams.js`) + +The Core Streams process handles streaming data from the Dash blockchain, including blocks, transactions, and masternode lists. + +### Responsibilities: + +- **Transaction Streaming**: Stream transactions matching bloom filters +- **Block Header Streaming**: Stream block headers and chain locks +- **Masternode List Streaming**: Stream masternode list updates + +### Connections: + +- **Dash Core**: Connects to Core via RPC and ZMQ +- **Chain Data Provider**: Maintains a cache of block headers + +### Startup Sequence: + +1. Load configuration +2. Connect to Dash Core's ZMQ interface +3. Initialize bloom filter emitter collection +4. Set up event listeners for ZMQ events +5. Initialize chain data provider and block headers cache +6. Initialize masternode list sync +7. Start gRPC server with streaming handlers + +### Endpoints Served: + +- **Stream gRPC Endpoints**: + - `subscribeToTransactionsWithProofs` + - `subscribeToBlockHeadersWithChainLocks` + - `subscribeToMasternodeList` + +## Process Communication + +The two processes operate independently and do not directly communicate with each other. Instead, they both connect to the same underlying services (Dash Core, Drive, Tenderdash) to provide their respective functionality. + +## Running the Processes + +To run DAPI, both processes need to be started: + +```bash +# Start the API process +node scripts/api.js + +# Start the Core Streams process +node scripts/core-streams.js +``` + +It's recommended to use a process manager like PM2 in production environments to ensure both processes stay running and restart automatically if they crash. + +## Monitoring + +Both processes use the same logging infrastructure, allowing for consistent monitoring of the entire DAPI service. Logs are output to the console by default and can be redirected to files or log management systems as needed. + +Key events that are logged include: +- Process startup and shutdown +- Connection to dependencies +- Server listening status +- Error conditions + +## Configuration + +Both processes share the same configuration infrastructure, reading environment variables or a `.env` file. See the [Configuration](./configuration.md) document for details on available options. \ No newline at end of file diff --git a/packages/dapi/doc/swaggerDef.js b/packages/dapi/doc/swaggerDef.js deleted file mode 100644 index 7f1bee9b3f1..00000000000 --- a/packages/dapi/doc/swaggerDef.js +++ /dev/null @@ -1,75 +0,0 @@ -/** -* This file is used by swagger-jsdoc as the root document object of the -* OpenAPI document (https://swagger.io/specification/#oasObject). -* -* The file is only used as input to the swagger-jsdoc CLI application when -* generating the OAS API documentation (`swagger-jdsoc -d ...`). -*/ - -module.exports = { - openapi: '3.0.0', - 'x-api-id': 'dapi', - info: { - title: 'DAPI', - version: '0.2.2', - description: 'Dash Decentralized API (DAPI)', - }, - servers: [ - { - url: '{url}:{port}', - description: 'User-defined network', - variables: { - url: { - default: 'http://dapi.dash.org', - }, - port: { - default: '3000', - }, - }, - }, - ], - paths: {}, - /** Readme.io swagger extensions - * ------------------------------ - * - * x-send-defaults (default: false) - * - Whether to send the defaults specified in your swagger file, or render - * them as placeholders - */ - 'x-send-defaults': true, - /** - * x-headers (default: undefined) - * - Array of static headers to add to each request. Must be provided as an - * array of JSON objects with `key` and `value` properties. - */ - 'x-headers': [], - /** - * x-explorer-enabled (default: true) - * - Enable the API explorer - */ - 'x-explorer-enabled': true, - /** - * x-proxy-enabled (default: true) - * - Whether the Readme CORs proxy is enabled or not. If your API correctly - * returns CORs headers, you can safely turn this off. - */ - 'x-proxy-enabled': true, - /** - * x-samples-enabled (default: true) - * - Enable code examples - */ - 'x-samples-enabled': true, - /** - * x-samples-language - * - Languages to generate code samples for - * Default: ['curl', 'node', 'ruby', 'javascript', 'python'] - * Supported: node, curl, ruby, javascript, objectivec, python, java, php, csharp, swift, go - */ - 'x-samples-languages': [ - 'curl', - 'node', - 'ruby', - 'javascript', - 'python', - ], -}; From 8fda52b22b27576b8fab1cb1db7904814f21b4ef Mon Sep 17 00:00:00 2001 From: Ivan Shumkov Date: Sat, 12 Apr 2025 21:26:00 +0700 Subject: [PATCH 11/15] docs: document DAPI --- packages/dapi/doc/README.md | 7 ------- 1 file changed, 7 deletions(-) delete mode 100644 packages/dapi/doc/README.md diff --git a/packages/dapi/doc/README.md b/packages/dapi/doc/README.md deleted file mode 100644 index ea87395ae1b..00000000000 --- a/packages/dapi/doc/README.md +++ /dev/null @@ -1,7 +0,0 @@ -# DAPI documentation. - -This is the home for the DAPI documentation. - -### Contents - -* [Configuration](./CONFIGURATION.md) \ No newline at end of file From abada772ca100cfc7cbf1af1255a1a8cdfb0c83f Mon Sep 17 00:00:00 2001 From: Ivan Shumkov Date: Fri, 18 Apr 2025 19:31:58 +0700 Subject: [PATCH 12/15] docs: update archtecture --- packages/dapi/doc/architecture.md | 121 ++++++++++++++++++++++++------ packages/dapi/doc/processes.md | 111 --------------------------- 2 files changed, 100 insertions(+), 132 deletions(-) delete mode 100644 packages/dapi/doc/processes.md diff --git a/packages/dapi/doc/architecture.md b/packages/dapi/doc/architecture.md index 629885ef735..9ff90e35997 100644 --- a/packages/dapi/doc/architecture.md +++ b/packages/dapi/doc/architecture.md @@ -41,33 +41,101 @@ DAPI (Decentralized API) serves as the gateway to the Dash network, providing ac ## Key Components -### 1. API Process (`api.js`) +### API Process (`api.js`) -The API process is the main entry point for DAPI. It handles non-streaming API requests through both gRPC and JSON-RPC interfaces. +The API process is the main entry point for DAPI. It handles the basic gRPC and JSON-RPC endpoints, including both Core and Platform functionality. -**Responsibilities:** -- Serve Core blockchain endpoints via gRPC -- Serve Platform (Evolution) endpoints via gRPC -- Provide legacy JSON-RPC endpoints +#### Responsibilities: + +- **JSON-RPC Server**: Serves legacy JSON-RPC endpoints +- **Core gRPC Endpoints**: Serves Core blockchain endpoints +- **Platform gRPC Endpoints**: Serves Platform (Evolution) endpoints + +#### Connections: + +- **Dash Core**: Connects to Core via RPC and ZMQ +- **Drive**: Connects to Drive via gRPC +- **Tenderdash**: Connects to Tenderdash via RPC and WebSocket + +#### Startup Sequence: + +1. Load configuration +2. Connect to Dash Core's ZMQ interface +3. Initialize Platform and Drive clients +4. Connect to Tenderdash WebSocket +5. Start JSON-RPC server +6. Start gRPC server with Core and Platform handlers + +#### Endpoints Served: + +- **Core gRPC Endpoints**: + - `getBestBlockHeight` + - `getBlockchainStatus` + - `getTransaction` + - `broadcastTransaction` + +- **Platform gRPC Endpoints**: + - `broadcastStateTransition` + - `waitForStateTransitionResult` + - `getConsensusParams` + - `getStatus` + - And various unimplemented endpoints + +- **JSON-RPC Endpoints**: + - `getBestBlockHash` + - `getBlockHash` + +#### Dependencies: -**Dependencies:** - Dash Core (via RPC and ZMQ) - Drive (via gRPC) - Tenderdash (via RPC and WebSocket) -### 2. Core Streams Process (`core-streams.js`) +#### How to run + +```bash +node scripts/api.js +``` + +### Core Streams Process -The Core Streams process handles long-running streaming connections that provide real-time updates about the Dash network. +The Core Streams process handles streaming data from the Dash blockchain, including blocks, transactions, and masternode lists. -**Responsibilities:** -- Stream block headers and chain locks -- Stream transactions matching bloom filters -- Stream masternode list updates +#### Responsibilities: -**Dependencies:** +- **Transaction Streaming**: Stream transactions matching bloom filters +- **Block Header Streaming**: Stream block headers and chain locks +- **Masternode List Streaming**: Stream masternode list updates + +#### Connections: + +- **Dash Core**: Connects to Core via RPC and ZMQ +- **Chain Data Provider**: Maintains a cache of block headers + +#### Startup Sequence: + +1. Load configuration +2. Connect to Dash Core's ZMQ interface +3. Initialize bloom filter emitter collection +4. Set up event listeners for ZMQ events +5. Initialize chain data provider and block headers cache +6. Initialize masternode list sync +7. Start gRPC server with streaming handlers + +#### Endpoints Served: + +- **Stream gRPC Endpoints**: + - `subscribeToTransactionsWithProofs` + - `subscribeToBlockHeadersWithChainLocks` + - `subscribeToMasternodeList` + +#### Dependencies: - Dash Core (via RPC and ZMQ) -- Chain Data Provider (internal) -- Bloom Filter Emitter (internal) + +### Communication + +Both API and Core Streams components operate independently and do not directly communicate with each other. +Instead, they both connect to the same underlying services (Dash Core, Drive, Tenderdash) to provide their respective functionality. ## Interfaces @@ -131,15 +199,26 @@ DAPI connects to Tenderdash (a modified version of Tendermint) which serves as t ## Deployment Considerations -DAPI is designed to be deployed: +DAPI is designed to be deployed on masternode. The prefered and officaially supported way is to use [dashmate](https://docs.dash.org/en/stable/docs/user/network/dashmate/index.html). + +## Monitoring + +Both components use the same logging infrastructure, allowing for consistent monitoring of the entire DAPI service. +Logs are output to the console by default and can be redirected to files or log management systems as needed. + +Key events that are logged include: +- Process startup and shutdown +- Connection to dependencies +- Server listening status +- Error conditions -1. **On Masternodes**: As part of the standard masternode software stack -2. **Standalone**: For development or private deployment +## Configuration -For production deployments, both the API and Core Streams processes should be running with proper process management (e.g., PM2) to ensure continued operation. +Both processes share the same configuration infrastructure, reading environment variables or a `.env` file. +See the [Configuration](./configuration.md) document for details on available options. ## Further Information - For more details about the processes, see [Processes](./processes.md) - For configuration options, see [Configuration](./configuration.md) -- For available endpoints, see [Endpoints](./endpoints/index.md) \ No newline at end of file +- For available endpoints, see [Endpoints](./endpoints/index.md) diff --git a/packages/dapi/doc/processes.md b/packages/dapi/doc/processes.md deleted file mode 100644 index 2e152ae2090..00000000000 --- a/packages/dapi/doc/processes.md +++ /dev/null @@ -1,111 +0,0 @@ -# DAPI Processes - -DAPI operates using two separate Node.js processes, each handling different aspects of the API functionality. This document explains each process and its responsibilities. - -## 1. API Process (`api.js`) - -The API process is the main entry point for DAPI. It handles the basic gRPC and JSON-RPC endpoints, including both Core and Platform functionality. - -### Responsibilities: - -- **JSON-RPC Server**: Serves legacy JSON-RPC endpoints -- **Core gRPC Endpoints**: Serves Core blockchain endpoints -- **Platform gRPC Endpoints**: Serves Platform (Evolution) endpoints - -### Connections: - -- **Dash Core**: Connects to Core via RPC and ZMQ -- **Drive**: Connects to Drive via gRPC -- **Tenderdash**: Connects to Tenderdash via RPC and WebSocket - -### Startup Sequence: - -1. Load configuration -2. Connect to Dash Core's ZMQ interface -3. Initialize Platform and Drive clients -4. Connect to Tenderdash WebSocket -5. Start JSON-RPC server -6. Start gRPC server with Core and Platform handlers - -### Endpoints Served: - -- **Core gRPC Endpoints**: - - `getBestBlockHeight` - - `getBlockchainStatus` - - `getTransaction` - - `broadcastTransaction` - -- **Platform gRPC Endpoints**: - - `broadcastStateTransition` - - `waitForStateTransitionResult` - - `getConsensusParams` - - `getStatus` - - And various unimplemented endpoints - -- **JSON-RPC Endpoints**: - - `getBestBlockHash` - - `getBlockHash` - -## 2. Core Streams Process (`core-streams.js`) - -The Core Streams process handles streaming data from the Dash blockchain, including blocks, transactions, and masternode lists. - -### Responsibilities: - -- **Transaction Streaming**: Stream transactions matching bloom filters -- **Block Header Streaming**: Stream block headers and chain locks -- **Masternode List Streaming**: Stream masternode list updates - -### Connections: - -- **Dash Core**: Connects to Core via RPC and ZMQ -- **Chain Data Provider**: Maintains a cache of block headers - -### Startup Sequence: - -1. Load configuration -2. Connect to Dash Core's ZMQ interface -3. Initialize bloom filter emitter collection -4. Set up event listeners for ZMQ events -5. Initialize chain data provider and block headers cache -6. Initialize masternode list sync -7. Start gRPC server with streaming handlers - -### Endpoints Served: - -- **Stream gRPC Endpoints**: - - `subscribeToTransactionsWithProofs` - - `subscribeToBlockHeadersWithChainLocks` - - `subscribeToMasternodeList` - -## Process Communication - -The two processes operate independently and do not directly communicate with each other. Instead, they both connect to the same underlying services (Dash Core, Drive, Tenderdash) to provide their respective functionality. - -## Running the Processes - -To run DAPI, both processes need to be started: - -```bash -# Start the API process -node scripts/api.js - -# Start the Core Streams process -node scripts/core-streams.js -``` - -It's recommended to use a process manager like PM2 in production environments to ensure both processes stay running and restart automatically if they crash. - -## Monitoring - -Both processes use the same logging infrastructure, allowing for consistent monitoring of the entire DAPI service. Logs are output to the console by default and can be redirected to files or log management systems as needed. - -Key events that are logged include: -- Process startup and shutdown -- Connection to dependencies -- Server listening status -- Error conditions - -## Configuration - -Both processes share the same configuration infrastructure, reading environment variables or a `.env` file. See the [Configuration](./configuration.md) document for details on available options. \ No newline at end of file From 4cb360e9dc4a98b9e0054de451f0ca86f250fd4e Mon Sep 17 00:00:00 2001 From: Ivan Shumkov Date: Fri, 18 Apr 2025 20:17:57 +0700 Subject: [PATCH 13/15] docs: update docs --- packages/dapi/README.md | 16 +- packages/dapi/doc/architecture.md | 21 ++- packages/dapi/doc/configuration.md | 132 ------------- packages/dapi/doc/endpoints/core-endpoints.md | 176 ------------------ .../endpoints/core/broadcastTransaction.md | 83 +++++++++ .../doc/endpoints/core/getBestBlockHeight.md | 54 ++++++ .../doc/endpoints/core/getBlockchainStatus.md | 82 ++++++++ .../dapi/doc/endpoints/core/getTransaction.md | 82 ++++++++ .../core/subscribeToMasternodeList.md | 87 +++++++++ packages/dapi/doc/endpoints/index.md | 55 ++++-- .../dapi/doc/endpoints/json-rpc-endpoints.md | 120 ------------ .../endpoints/json-rpc/getBestBlockHash.md | 87 +++++++++ .../doc/endpoints/json-rpc/getBlockHash.md | 108 +++++++++++ .../dapi/doc/endpoints/platform-endpoints.md | 126 ------------- .../platform/broadcastStateTransition.md | 90 +++++++++ .../endpoints/platform/getConsensusParams.md | 92 +++++++++ .../dapi/doc/endpoints/platform/getStatus.md | 118 ++++++++++++ .../platform/waitForStateTransitionResult.md | 104 +++++++++++ .../subscribeToBlockHeadersWithChainLocks.md | 104 +++++++++++ .../subscribeToTransactionsWithProofs.md | 127 +++++++++++++ packages/dapi/doc/getting-started.md | 156 ---------------- packages/dapi/doc/index.md | 43 +++-- packages/dapi/doc/overview.md | 70 ------- 23 files changed, 1296 insertions(+), 837 deletions(-) delete mode 100644 packages/dapi/doc/configuration.md delete mode 100644 packages/dapi/doc/endpoints/core-endpoints.md create mode 100644 packages/dapi/doc/endpoints/core/broadcastTransaction.md create mode 100644 packages/dapi/doc/endpoints/core/getBestBlockHeight.md create mode 100644 packages/dapi/doc/endpoints/core/getBlockchainStatus.md create mode 100644 packages/dapi/doc/endpoints/core/getTransaction.md create mode 100644 packages/dapi/doc/endpoints/core/subscribeToMasternodeList.md delete mode 100644 packages/dapi/doc/endpoints/json-rpc-endpoints.md create mode 100644 packages/dapi/doc/endpoints/json-rpc/getBestBlockHash.md create mode 100644 packages/dapi/doc/endpoints/json-rpc/getBlockHash.md delete mode 100644 packages/dapi/doc/endpoints/platform-endpoints.md create mode 100644 packages/dapi/doc/endpoints/platform/broadcastStateTransition.md create mode 100644 packages/dapi/doc/endpoints/platform/getConsensusParams.md create mode 100644 packages/dapi/doc/endpoints/platform/getStatus.md create mode 100644 packages/dapi/doc/endpoints/platform/waitForStateTransitionResult.md create mode 100644 packages/dapi/doc/endpoints/streams/subscribeToBlockHeadersWithChainLocks.md create mode 100644 packages/dapi/doc/endpoints/streams/subscribeToTransactionsWithProofs.md delete mode 100644 packages/dapi/doc/getting-started.md delete mode 100644 packages/dapi/doc/overview.md diff --git a/packages/dapi/README.md b/packages/dapi/README.md index 1e2204c3493..550529c24d9 100644 --- a/packages/dapi/README.md +++ b/packages/dapi/README.md @@ -13,21 +13,7 @@ DAPI is designed to be run on the Dash masternode network, providing a decentral ## Documentation -Comprehensive documentation for DAPI is available in the [doc](./doc) directory: - -- [Getting Started](./doc/getting-started.md) - Quick start guide for developers -- [Architecture](./doc/architecture.md) - Overview of DAPI's design -- [Configuration](./doc/configuration.md) - Configure DAPI for your needs -- [Endpoints](./doc/endpoints/index.md) - Available API endpoints - -## Getting Started - -To get started with DAPI, see the [Getting Started](./doc/getting-started.md) guide which covers: - -- Installation and configuration -- Setting up dependencies -- Running DAPI processes -- Making API requests +DAPI documentaion is available in the [doc](./doc/index.md) directory and [website](https://docs.dash.org/projects/platform/en/stable/docs/explanations/dapi.html). ## License diff --git a/packages/dapi/doc/architecture.md b/packages/dapi/doc/architecture.md index 9ff90e35997..904dc5b4511 100644 --- a/packages/dapi/doc/architecture.md +++ b/packages/dapi/doc/architecture.md @@ -4,7 +4,8 @@ This document explains the high-level architecture of DAPI, its components, and ## Overview -DAPI (Decentralized API) serves as the gateway to the Dash network, providing access to both Dash Core blockchain functionality and Dash Platform (Evolution) features. Unlike traditional centralized APIs, DAPI is designed to run on the Dash masternode network, ensuring high availability and censorship resistance. +DAPI (Decentralized API) serves as the gateway to the Dash network, providing access to both Dash Core blockchain functionality and Dash Platform (Evolution) features. +Unlike traditional centralized APIs, DAPI is designed to run on the Dash masternode network, ensuring high availability and censorship resistance. ## Architecture Diagram @@ -41,7 +42,7 @@ DAPI (Decentralized API) serves as the gateway to the Dash network, providing ac ## Key Components -### API Process (`api.js`) +### API Process The API process is the main entry point for DAPI. It handles the basic gRPC and JSON-RPC endpoints, including both Core and Platform functionality. @@ -197,6 +198,13 @@ DAPI connects to Tenderdash (a modified version of Tendermint) which serves as t - If it matches, the transaction is sent to the client with merkle proofs 4. The stream continues until the client disconnects +## Security + +DAPI protects connections by using TLS to encrypt communication between clients and the masternodes. +This encryption safeguards transmitted data from unauthorized access, interception, or tampering. +Platform gRPC endpoints provide an additional level of security by optionally returning cryptographic proofs. +Successful proof verification guarantees that the server responded without modifying the requested data. + ## Deployment Considerations DAPI is designed to be deployed on masternode. The prefered and officaially supported way is to use [dashmate](https://docs.dash.org/en/stable/docs/user/network/dashmate/index.html). @@ -212,13 +220,10 @@ Key events that are logged include: - Server listening status - Error conditions -## Configuration +## Endpoints -Both processes share the same configuration infrastructure, reading environment variables or a `.env` file. -See the [Configuration](./configuration.md) document for details on available options. +See the [endpoints](./endpoints/index.md) document for details on available endpoints. ## Further Information -- For more details about the processes, see [Processes](./processes.md) -- For configuration options, see [Configuration](./configuration.md) -- For available endpoints, see [Endpoints](./endpoints/index.md) +- Consult the [Dash Platform Developer Documentation](https://docs.dash.org/projects/platform/en/stable/) for more information about the broader Dash Platform ecosystem diff --git a/packages/dapi/doc/configuration.md b/packages/dapi/doc/configuration.md deleted file mode 100644 index fa2d22b9149..00000000000 --- a/packages/dapi/doc/configuration.md +++ /dev/null @@ -1,132 +0,0 @@ -# DAPI Configuration - -This document describes how to configure DAPI for different environments and use cases. - -## Configuration Options - -DAPI can be configured through environment variables. Here are the available configuration options: - -| Environment Variable | Description | Default Value | -|----------------------|-------------|---------------| -| LIVENET | Set to 'true' for live network operation | false | -| API_JSON_RPC_PORT | Port for JSON-RPC server | 2501 | -| API_GRPC_PORT | Port for gRPC server | 2500 | -| TX_FILTER_STREAM_GRPC_PORT | Port for transaction filter stream gRPC server | 2510 | -| DASHCORE_RPC_PROTOCOL | Protocol for Dash Core RPC | http | -| DASHCORE_RPC_USER | Username for Dash Core RPC | dashrpc | -| DASHCORE_RPC_PASS | Password for Dash Core RPC | password | -| DASHCORE_RPC_HOST | Host for Dash Core RPC | 127.0.0.1 | -| DASHCORE_RPC_PORT | Port for Dash Core RPC | 30002 | -| DASHCORE_ZMQ_HOST | Host for Dash Core ZMQ | 127.0.0.1 | -| DASHCORE_ZMQ_PORT | Port for Dash Core ZMQ | 30003 | -| DASHCORE_P2P_HOST | Host for Dash Core P2P | 127.0.0.1 | -| DASHCORE_P2P_PORT | Port for Dash Core P2P | 30001 | -| DASHCORE_P2P_NETWORK | Network for Dash Core P2P | testnet | -| DRIVE_RPC_HOST | Host for Drive RPC | 127.0.0.1 | -| DRIVE_RPC_PORT | Port for Drive RPC | 6000 | -| BLOCK_HEADERS_CACHE_SIZE | Size of block headers cache | 500 | -| NETWORK | Network to connect to | testnet | -| BLOOM_FILTER_PERSISTENCE_TIMEOUT | Timeout for bloom filter persistence (ms) | 60000 | -| TENDERMINT_RPC_HOST | Host for Tendermint RPC | undefined | -| TENDERMINT_RPC_PORT | Port for Tendermint RPC | undefined | - -## Setting Up Dependencies - -DAPI requires the following dependencies to operate correctly: - -### Dash Core - -Dash Core is required for DAPI to access the Dash blockchain. You need to configure ZMQ for the following topics: - -``` -zmqpubhashblock=tcp://0.0.0.0:30003 -zmqpubhashtx=tcp://0.0.0.0:30003 -zmqpubrawblock=tcp://0.0.0.0:30003 -zmqpubrawtx=tcp://0.0.0.0:30003 -zmqpubhashchainlock=tcp://0.0.0.0:30003 -zmqpubrawchainlock=tcp://0.0.0.0:30003 -zmqpubhashgovernancevote=tcp://0.0.0.0:30003 -zmqpubhashgovernanceobject=tcp://0.0.0.0:30003 -zmqpubrawgovernancevote=tcp://0.0.0.0:30003 -zmqpubhashinstantsenddoublesend=tcp://0.0.0.0:30003 -zmqpubrawinstantsenddoublesend=tcp://0.0.0.0:30003 -zmqpubhashinstantsendsuccess=tcp://0.0.0.0:30003 -zmqpubrawinstantsendsuccess=tcp://0.0.0.0:30003 -zmqpubrawtxlocksig=tcp://0.0.0.0:30003 -``` - -You can find a sample configuration for Dash Core in [doc/dependencies_configs/dash.conf](./dependencies_configs/dash.conf). - -### Drive - -Drive is required for DAPI to interact with Dash Platform's state. Configure the Drive RPC connection using the following environment variables: - -``` -DRIVE_RPC_HOST=127.0.0.1 -DRIVE_RPC_PORT=6000 -``` - -### Tenderdash - -Tenderdash is the consensus engine for Dash Platform. Configure the Tenderdash connection using: - -``` -TENDERMINT_RPC_HOST=127.0.0.1 -TENDERMINT_RPC_PORT=26657 -``` - -## Running DAPI - -DAPI runs two separate processes: - -1. **API Process**: Handles gRPC and JSON-RPC requests - ``` - node scripts/api.js - ``` - -2. **Core Streams Process**: Handles streaming data - ``` - node scripts/core-streams.js - ``` - -Both processes should be running for DAPI to function correctly. For more details about these processes, see the [Architecture](./architecture.md) document. - -## Production Configuration - -For production environments, it's recommended to: - -1. Use a process manager like PM2 to ensure processes stay running -2. Set `NODE_ENV=production` to optimize error handling -3. Use HTTPS for production deployments -4. Configure proper security measures (firewalls, authentication) - -Example PM2 configuration: - -```json -{ - "apps": [ - { - "name": "dapi-api", - "script": "scripts/api.js", - "env": { - "NODE_ENV": "production", - "LIVENET": "true" - } - }, - { - "name": "dapi-core-streams", - "script": "scripts/core-streams.js", - "env": { - "NODE_ENV": "production", - "LIVENET": "true" - } - } - ] -} -``` - -## Next Steps - -- Learn more about DAPI's architecture in the [Architecture](./architecture.md) document -- Explore available endpoints in the [Endpoints](./endpoints/index.md) section -- Get started with DAPI using the [Getting Started](./getting-started.md) guide \ No newline at end of file diff --git a/packages/dapi/doc/endpoints/core-endpoints.md b/packages/dapi/doc/endpoints/core-endpoints.md deleted file mode 100644 index 6126fcb635c..00000000000 --- a/packages/dapi/doc/endpoints/core-endpoints.md +++ /dev/null @@ -1,176 +0,0 @@ -# DAPI Core Endpoints - -These endpoints provide access to the Dash Core blockchain functionality through the gRPC interface. - -## Available Endpoints - -### `getBestBlockHeight` - -Returns the height of the latest block in the chain. - -**Request Parameters**: None - -**Response Parameters**: -- `height`: Height of the best block (number) - -**Example Usage**: -```javascript -const { getBestBlockHeight } = dapiClient.core; -const height = await getBestBlockHeight(); -console.log(`Current block height: ${height}`); -``` - -### `getBlockchainStatus` - -Returns status information about the Dash blockchain. - -**Request Parameters**: None - -**Response Parameters**: -- `chain`: Chain name (e.g., "main", "test", "regtest") -- `blocks`: Current block count -- `headers`: Current header count -- `bestBlockHash`: Hash of the best block -- `difficulty`: Current network difficulty -- `verificationProgress`: Sync progress (0-1) -- `chainWork`: Total chain work in hex -- `softForks`: Information about active and pending soft forks -- `protocolVersion`: P2P protocol version -- `version`: Core software version - -**Example Usage**: -```javascript -const { getBlockchainStatus } = dapiClient.core; -const status = await getBlockchainStatus(); -console.log(`Network: ${status.chain}, Blocks: ${status.blocks}`); -``` - -### `getTransaction` - -Retrieves a transaction by ID. - -**Request Parameters**: -- `id`: Transaction ID (string, required) - -**Response Parameters**: -- `transaction`: Binary buffer containing serialized transaction -- `blockHash`: Hash of the block containing the transaction -- `height`: Height of the block containing the transaction -- `confirmations`: Number of confirmations -- `isInstantLocked`: Whether transaction is instant locked -- `isChainLocked`: Whether transaction is chain locked - -**Example Usage**: -```javascript -const { getTransaction } = dapiClient.core; -const txId = '0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef'; -const tx = await getTransaction(txId); -console.log(`Transaction is in block: ${tx.height}`); -``` - -### `broadcastTransaction` - -Broadcasts a transaction to the Dash network. - -**Request Parameters**: -- `transaction`: Binary buffer containing serialized transaction (required) - -**Response Parameters**: -- `transactionId`: ID of the broadcast transaction (string) - -**Example Usage**: -```javascript -const { broadcastTransaction } = dapiClient.core; -const txHex = '0200000001...'; // Raw transaction hex -const result = await broadcastTransaction(txHex); -console.log(`Transaction broadcast with ID: ${result.transactionId}`); -``` - -## Stream Endpoints - -These endpoints are provided by the Core Streams Process. - -### `subscribeToMasternodeList` - -Subscribes to masternode list updates. - -**Request Parameters**: None - -**Response Parameters**: -- Stream of `masternodeListDiff` messages with masternode list differences - -**Example Usage**: -```javascript -const { subscribeToMasternodeList } = dapiClient.core; -const stream = subscribeToMasternodeList(); - -stream.on('data', (masternodeListDiff) => { - console.log('Masternode list updated:', masternodeListDiff); -}); -``` - -### `subscribeToTransactionsWithProofs` - -Streams transactions matching a bloom filter with merkle proofs. - -**Request Parameters**: -- `bloomFilter`: Parameters for bloom filter (object, required) - - `vData`: Filter data - - `nHashFuncs`: Number of hash functions - - `nTweak`: Random value - - `nFlags`: Bloom filter update flags -- `fromBlockHash` or `fromBlockHeight`: Starting point (optional) -- `count`: Number of blocks to fetch (0 means subscribe to new transactions) - -**Response Parameters**: -- Stream of transactions, merkle blocks, and instant lock messages - -**Example Usage**: -```javascript -const { subscribeToTransactionsWithProofs } = dapiClient.core; - -const bloomFilter = { - vData: '...', - nHashFuncs: 11, - nTweak: 0, - nFlags: 0 -}; - -const stream = subscribeToTransactionsWithProofs(bloomFilter); - -stream.on('data', (response) => { - if (response.rawMerkleBlock) { - console.log('Received merkle block'); - } else if (response.rawTransaction) { - console.log('Received transaction'); - } else if (response.instantSendLockMessages) { - console.log('Received instant send lock'); - } -}); -``` - -### `subscribeToBlockHeadersWithChainLocks` - -Streams block headers and chain locks. - -**Request Parameters**: -- `fromBlockHash` or `fromBlockHeight`: Starting point (optional) -- `count`: Number of blocks to fetch (0 means subscribe to new blocks) - -**Response Parameters**: -- Stream of block headers and chain locks - -**Example Usage**: -```javascript -const { subscribeToBlockHeadersWithChainLocks } = dapiClient.core; - -const stream = subscribeToBlockHeadersWithChainLocks({ fromBlockHeight: 1000, count: 10 }); - -stream.on('data', (response) => { - if (response.rawBlockHeader) { - console.log('Received block header'); - } else if (response.rawChainLock) { - console.log('Received chain lock'); - } -}); -``` \ No newline at end of file diff --git a/packages/dapi/doc/endpoints/core/broadcastTransaction.md b/packages/dapi/doc/endpoints/core/broadcastTransaction.md new file mode 100644 index 00000000000..e8e779bf424 --- /dev/null +++ b/packages/dapi/doc/endpoints/core/broadcastTransaction.md @@ -0,0 +1,83 @@ +# broadcastTransaction + +## Client API + +Broadcasts a transaction to the Dash network. + +**Request Parameters**: +- `transaction`: Binary buffer containing serialized transaction (required) + +**Response Parameters**: +- `transactionId`: ID of the broadcast transaction (string) + +**Example Usage**: +```javascript +const txHex = '0200000001...'; // Raw transaction hex +const result = await dapiClient.core.broadcastTransaction(txHex); +console.log(`Transaction broadcast with ID: ${result.transactionId}`); +``` + +## Internal Implementation + +The `broadcastTransaction` endpoint is implemented in the `broadcastTransactionHandlerFactory.js` file. + +### Implementation Details + +1. **Transaction Validation** + - Validates that the transaction is properly formatted and serialized + - Performs basic structure checks before attempting to broadcast + +2. **Core RPC Interaction** + - Calls Core's `sendrawtransaction` RPC method + - Passes the raw transaction data to the Core node for propagation to the network + +3. **Error Handling** + - Maps Core RPC error codes to appropriate gRPC error codes + - Handles common error scenarios: + - Invalid transaction format (RPC error code -22) + - Transaction rejected (RPC error code -26) + - Transaction already in blockchain (RPC error code -27) + - Transaction validation failures (RPC error code -25) + - Provides descriptive error messages to help diagnose transaction issues + +4. **Dependencies** + - Dash Core RPC interface for transaction broadcasting + +### Code Flow + +``` +Client Request + → gRPC Server + → broadcastTransactionHandler + → Validate Transaction Format + → Convert Binary to Hex (if needed) + → Call sendrawtransaction RPC + → If Successful: + → Return Transaction ID + → If Error: + → Map RPC Error to gRPC Error + → Return Error Response +``` + +### Common Error Scenarios + +The handler maps Core RPC errors to meaningful client responses: + +1. **Invalid Transaction Format (-22)** + - Occurs when the transaction data is malformed + - Returns INVALID_ARGUMENT error with details + +2. **Transaction Rejected (-26)** + - Occurs when the transaction is valid but rejected by the network + - Common causes include double spends, insufficient fees, or script verification failures + - Returns FAILED_PRECONDITION error with specific rejection reason + +3. **Already in Blockchain (-27)** + - Occurs when attempting to broadcast a transaction that's already confirmed + - Returns ALREADY_EXISTS error + +4. **Transaction Validation Error (-25)** + - Occurs when the transaction fails internal validation checks + - Returns INVALID_ARGUMENT error with validation details + +This error mapping helps clients understand exactly why a transaction broadcast failed. \ No newline at end of file diff --git a/packages/dapi/doc/endpoints/core/getBestBlockHeight.md b/packages/dapi/doc/endpoints/core/getBestBlockHeight.md new file mode 100644 index 00000000000..16c1fa0e822 --- /dev/null +++ b/packages/dapi/doc/endpoints/core/getBestBlockHeight.md @@ -0,0 +1,54 @@ +# getBestBlockHeight + +## Client API + +Returns the height of the latest block in the chain. + +**Request Parameters**: None + +**Response Parameters**: +- `height`: Height of the best block (number) + +**Example Usage**: +```javascript +const height = await dapiClient.core.getBestBlockHeight(); +console.log(`Current block height: ${height}`); +``` + +## Internal Implementation + +The `getBestBlockHeight` endpoint is implemented in the `getBestBlockHeightHandlerFactory.js` file. + +### Implementation Details + +1. **Caching Mechanism** + - The implementation uses a caching strategy to avoid making frequent RPC calls to the Core node + - The cache is invalidated when a new block is detected via ZMQ notifications + - RPC calls to Core are only made when the cache is empty or invalid + +2. **Handler Flow** + - When a request is received, the handler first checks if a valid cached value exists + - If cache is valid, returns the cached value immediately + - If cache is invalid or empty, makes an RPC call to Core's `getBlockCount` method + - The returned value is cached before being sent back to the client + +3. **Dependencies** + - Dash Core RPC interface + - ZMQ for new block notifications (for cache invalidation) + +4. **Error Handling** + - Forwards any errors from the Core RPC call with appropriate gRPC error codes + - Handles network connectivity issues with the Core node + +### Code Flow + +``` +Client Request + → gRPC Server + → getBestBlockHeightHandler + → Check Cache + → If Valid: Return Cached Height + → If Invalid: Call Core RPC getBlockCount + → Cache Result + → Return Height +``` \ No newline at end of file diff --git a/packages/dapi/doc/endpoints/core/getBlockchainStatus.md b/packages/dapi/doc/endpoints/core/getBlockchainStatus.md new file mode 100644 index 00000000000..5df6e869343 --- /dev/null +++ b/packages/dapi/doc/endpoints/core/getBlockchainStatus.md @@ -0,0 +1,82 @@ +# getBlockchainStatus + +## Client API + +Returns status information about the Dash blockchain. + +**Request Parameters**: None + +**Response Parameters**: +- `chain`: Chain name (e.g., "main", "test", "regtest") +- `blocks`: Current block count +- `headers`: Current header count +- `bestBlockHash`: Hash of the best block +- `difficulty`: Current network difficulty +- `verificationProgress`: Sync progress (0-1) +- `chainWork`: Total chain work in hex +- `softForks`: Information about active and pending soft forks +- `protocolVersion`: P2P protocol version +- `version`: Core software version + +**Example Usage**: +```javascript +const status = await dapiClient.core.getBlockchainStatus(); +console.log(`Network: ${status.chain}, Blocks: ${status.blocks}`); +``` + +## Internal Implementation + +The `getBlockchainStatus` endpoint is implemented in the `getBlockchainStatusHandlerFactory.js` file. + +### Implementation Details + +1. **Data Collection** + - The implementation fetches data from two Core RPC calls in parallel: + - `getBlockchainInfo`: For blockchain-specific information + - `getNetworkInfo`: For network-specific details + - Combines the results into a comprehensive response + +2. **Caching Strategy** + - Uses caching to reduce load on Core node + - Cache is invalidated when new blocks are detected via ZMQ notifications + +3. **Status Determination** + - Calculates sync status (SYNCING or READY) based on verification progress value + - Provides chain status details from Core's internal state + +4. **Dependencies** + - Dash Core RPC interface + - ZMQ for new block notifications (for cache invalidation) + +5. **Error Handling** + - Maps Core RPC errors to appropriate gRPC error codes + - Handles connection issues with informative error messages + +### Code Flow + +``` +Client Request + → gRPC Server + → getBlockchainStatusHandler + → Check Cache + → If Valid: Return Cached Status + → If Invalid: + → Parallel Requests: + → Call getBlockchainInfo RPC + → Call getNetworkInfo RPC + → Combine Results + → Determine Sync Status + → Cache Response + → Return Status +``` + +### Response Construction + +The handler combines information from multiple sources: +- Basic blockchain info: chain name, blocks, headers, best hash +- Network details: protocol version, services, connections +- Mining information: difficulty, chain work +- Software version information +- Soft fork activation statuses + +This provides clients with a complete overview of the current blockchain state in a single call. \ No newline at end of file diff --git a/packages/dapi/doc/endpoints/core/getTransaction.md b/packages/dapi/doc/endpoints/core/getTransaction.md new file mode 100644 index 00000000000..d29797dcffa --- /dev/null +++ b/packages/dapi/doc/endpoints/core/getTransaction.md @@ -0,0 +1,82 @@ +# getTransaction + +## Client API + +Retrieves a transaction by ID. + +**Request Parameters**: +- `id`: Transaction ID (string, required) + +**Response Parameters**: +- `transaction`: Binary buffer containing serialized transaction +- `blockHash`: Hash of the block containing the transaction +- `height`: Height of the block containing the transaction +- `confirmations`: Number of confirmations +- `isInstantLocked`: Whether transaction is instant locked +- `isChainLocked`: Whether transaction is chain locked + +**Example Usage**: +```javascript +const txId = '0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef'; +const tx = await dapiClient.core.getTransaction(txId); +console.log(`Transaction is in block: ${tx.height}`); +``` + +## Internal Implementation + +The `getTransaction` endpoint is implemented in the `getTransactionHandlerFactory.js` file. + +### Implementation Details + +1. **Input Validation** + - Validates that the transaction ID is a valid 64-character hex string + - Returns appropriate error responses for invalid inputs + +2. **Core RPC Interaction** + - Calls Core's `getrawtransaction` RPC method with `verbose=1` flag + - This returns both the raw transaction data and metadata about its inclusion in the blockchain + +3. **Response Transformation** + - Converts the Core RPC response to the DAPI gRPC format + - Maps fields from Core's response to DAPI's response structure + - Adds additional fields like InstantLock and ChainLock status + +4. **Error Handling** + - Maps Core RPC error codes to appropriate gRPC error codes + - Handles "transaction not found" (-5) errors specifically + - Provides descriptive error messages for debugging + +5. **Dependencies** + - Dash Core RPC interface for transaction data + - InsightAPI (optional fallback) if transaction is not found in Core + +### Code Flow + +``` +Client Request + → gRPC Server + → getTransactionHandler + → Validate Transaction ID Format + → Call getrawtransaction RPC with verbose=1 + → If Found: Process Response + → Extract Transaction Data + → Extract Block Information + → Check Lock Statuses + → Build Response + → If Not Found: Return Not Found Error + → Return Transaction Response +``` + +### Transaction Lock Status + +The handler checks two important security features of Dash transactions: + +1. **InstantLock Status** + - Indicates if the transaction has been locked by InstantSend + - Provides immediate transaction security without waiting for confirmations + +2. **ChainLock Status** + - Indicates if the block containing the transaction is protected by ChainLocks + - Provides protection against 51% attacks and chain reorganizations + +These statuses help clients determine the security level of a transaction. \ No newline at end of file diff --git a/packages/dapi/doc/endpoints/core/subscribeToMasternodeList.md b/packages/dapi/doc/endpoints/core/subscribeToMasternodeList.md new file mode 100644 index 00000000000..905f8c761ea --- /dev/null +++ b/packages/dapi/doc/endpoints/core/subscribeToMasternodeList.md @@ -0,0 +1,87 @@ +# subscribeToMasternodeList + +## Client API + +Subscribes to masternode list updates. + +**Request Parameters**: None + +**Response Parameters**: +- Stream of `masternodeListDiff` messages with masternode list differences + +**Example Usage**: +```javascript +const stream = dapiClient.core.subscribeToMasternodeList(); + +stream.on('data', (masternodeListDiff) => { + console.log('Masternode list updated:', masternodeListDiff); +}); +``` + +## Internal Implementation + +The `subscribeToMasternodeList` endpoint is implemented in the `subscribeToMasternodeListHandlerFactory.js` file. + +### Implementation Details + +1. **Masternode List Sync** + - Uses the `MasternodeListSync` class to maintain a synchronized view of the masternode list + - Listens for updates from Core node via RPC and ZMQ + +2. **Streaming Mechanism** + - Establishes a gRPC server-side streaming connection + - Emits masternode list differences when changes are detected + - Client receives a stream of diff updates rather than full list snapshots + +3. **Diff Calculation** + - Calculates only the changes between previous and current masternode lists + - Includes added, removed, and modified masternodes + - Optimizes bandwidth by sending only what has changed + +4. **Dependencies** + - Dash Core RPC interface for initial list retrieval + - ZMQ for change notifications + - MasternodeListSync for maintaining state + +5. **Error Handling** + - Handles disconnections from Core + - Provides reconnection logic + - Propagates errors to the client through the stream + +### Code Flow + +``` +Client Request + → gRPC Server + → subscribeToMasternodeListHandler + → Initialize Stream Response + → Get Initial Masternode List + → Send Initial List to Client + → Subscribe to Masternode List Updates + → On Update: + → Calculate Diff from Previous List + → Send Diff to Client + → On Client Disconnect: + → Clean up Subscriptions +``` + +### Masternode List Diffs Structure + +The diff updates contain several key components: + +1. **Base Block Hash** + - The block hash where this diff starts + +2. **Block Hash** + - The block hash where this diff ends + +3. **Added Masternodes** + - List of newly activated masternodes + +4. **Modified Masternodes** + - List of existing masternodes with changed properties + +5. **Removed Masternodes** + - List of masternodes that are no longer active + +This structure allows clients to efficiently maintain their own copy of the masternode list by applying these diffs to their local state. \ No newline at end of file diff --git a/packages/dapi/doc/endpoints/index.md b/packages/dapi/doc/endpoints/index.md index 313eb519e09..4210c8c29f0 100644 --- a/packages/dapi/doc/endpoints/index.md +++ b/packages/dapi/doc/endpoints/index.md @@ -14,7 +14,7 @@ The gRPC interface is the recommended way to interact with DAPI. It offers: ### JSON-RPC (Legacy) -The JSON-RPC interface is provided for backward compatibility and will eventually be deprecated. It offers: +The JSON-RPC interface will eventually be deprecated. It offers: - HTTP-based requests - Compatibility with existing tools - Simpler integration for basic use cases @@ -28,43 +28,58 @@ DAPI endpoints are organized into three main categories: These endpoints provide access to the underlying Dash blockchain (Core) functionality, such as blocks, transactions, and network status. **Main gRPC endpoints:** -- [`getBestBlockHeight`](./core-endpoints.md#getbestblockheight) - Returns the current blockchain height -- [`getBlockchainStatus`](./core-endpoints.md#getblockchainstatus) - Returns blockchain status information -- [`getTransaction`](./core-endpoints.md#gettransaction) - Retrieves transaction data by ID -- [`broadcastTransaction`](./core-endpoints.md#broadcasttransaction) - Broadcasts a raw transaction to the network - -**Learn more:** [Core Endpoints Documentation](./core-endpoints.md) +- [`getBestBlockHeight`](./core/getBestBlockHeight.md) - Returns the current blockchain height +- [`getBlockchainStatus`](./core/getBlockchainStatus.md) - Returns blockchain status information +- [`getTransaction`](./core/getTransaction.md) - Retrieves transaction data by ID +- [`broadcastTransaction`](./core/broadcastTransaction.md) - Broadcasts a raw transaction to the network +- [`subscribeToMasternodeList`](./core/subscribeToMasternodeList.md) - Stream masternode list updates ### 2. Platform Endpoints These endpoints provide access to Dash Platform (Evolution) features, enabling interaction with decentralized applications, identities, and data contracts. **Main gRPC endpoints:** -- [`broadcastStateTransition`](./platform-endpoints.md#broadcaststatetransition) - Broadcasts a state transition to the platform -- [`waitForStateTransitionResult`](./platform-endpoints.md#waitforstatetransitionresult) - Waits for a state transition to be processed -- [`getConsensusParams`](./platform-endpoints.md#getconsensusparams) - Retrieves platform consensus parameters -- [`getStatus`](./platform-endpoints.md#getstatus) - Gets platform status information +- [`broadcastStateTransition`](./platform/broadcastStateTransition.md) - Broadcasts a state transition to the platform +- [`waitForStateTransitionResult`](./platform/waitForStateTransitionResult.md) - Waits for a state transition to be processed +- [`getConsensusParams`](./platform/getConsensusParams.md) - Retrieves platform consensus parameters +- [`getStatus`](./platform/getStatus.md) - Gets platform status information + +The following endpoints are defined in the gRPC service but are served by Drive ABCI directly: + +- `getIdentity` +- `getIdentitiesContractKeys` +- `getIdentityBalance` +- `getIdentityBalanceAndRevision` +- `getIdentityKeys` +- `getDocuments` +- `getDataContract` +- `getDataContracts` +- `getDataContractHistory` +- `getIdentityByPublicKeyHash` +- `getIdentitiesByPublicKeyHashes` +- `getProofs` +- `getEpochsInfo` +- `getProtocolVersionUpgradeVoteStatus` +- `getProtocolVersionUpgradeState` +- `getIdentityContractNonce` +- `getIdentityNonce` -**Learn more:** [Platform Endpoints Documentation](./platform-endpoints.md) ### 3. Stream Endpoints These endpoints provide real-time streaming data from the Dash network, including blocks, transactions, and masternode list updates. **Main streaming endpoints:** -- [`subscribeToBlockHeadersWithChainLocks`](./core-endpoints.md#subscribetoBlockHeadersWithChainLocks) - Stream block headers and chain locks -- [`subscribeToTransactionsWithProofs`](./core-endpoints.md#subscribetoTransactionsWithProofs) - Stream transactions matching a bloom filter -- [`subscribeToMasternodeList`](./core-endpoints.md#subscribetomasterNodeList) - Stream masternode list updates +- [`subscribeToBlockHeadersWithChainLocks`](./streams/subscribeToBlockHeadersWithChainLocks.md) - Stream block headers and chain locks +- [`subscribeToTransactionsWithProofs`](./streams/subscribeToTransactionsWithProofs.md) - Stream transactions matching a bloom filter ### 4. JSON-RPC Endpoints These endpoints provide a subset of Dash Core functionality through the JSON-RPC interface for backward compatibility. **Available endpoints:** -- [`getBestBlockHash`](./json-rpc-endpoints.md#getbestblockhash) - Returns the hash of the best block -- [`getBlockHash`](./json-rpc-endpoints.md#getblockhash) - Returns the hash of a block at a specific height - -**Learn more:** [JSON-RPC Endpoints Documentation](./json-rpc-endpoints.md) +- [`getBestBlockHash`](./json-rpc/getBestBlockHash.md) - Returns the hash of the best block +- [`getBlockHash`](./json-rpc/getBlockHash.md) - Returns the hash of a block at a specific height ## Using the Endpoints @@ -91,4 +106,4 @@ For most applications, it's recommended to use one of the DAPI client libraries: - [DAPI Client (JavaScript)](https://docs.dash.org/projects/platform/en/stable/docs/dapi-client-js/overview.html) - [gRPC Clients](https://github.com/dashpay/platform/tree/master/packages/dapi-grpc) (for other languages) -These client libraries handle the complexity of interacting with DAPI and provide a more convenient interface for developers. \ No newline at end of file +These client libraries handle the complexity of interacting with DAPI and provide a more convenient interface for developers. diff --git a/packages/dapi/doc/endpoints/json-rpc-endpoints.md b/packages/dapi/doc/endpoints/json-rpc-endpoints.md deleted file mode 100644 index c0fa3eae836..00000000000 --- a/packages/dapi/doc/endpoints/json-rpc-endpoints.md +++ /dev/null @@ -1,120 +0,0 @@ -# DAPI JSON-RPC Endpoints - -DAPI provides a set of JSON-RPC endpoints for backward compatibility with traditional blockchain APIs. These endpoints follow the JSON-RPC 2.0 specification. - -## JSON-RPC Specification - -All requests must follow the JSON-RPC 2.0 format: - -```json -{ - "jsonrpc": "2.0", - "method": "methodName", - "params": [], - "id": 1 -} -``` - -Responses will be in the following format: - -```json -{ - "jsonrpc": "2.0", - "result": {}, - "error": null, - "id": 1 -} -``` - -## Available Endpoints - -### `getBestBlockHash` - -Returns the hash of the best (tip) block in the longest blockchain. - -**Parameters**: None - -**Result**: -- String - the block hash, hex encoded - -**Example Request**: -```json -{ - "jsonrpc": "2.0", - "method": "getBestBlockHash", - "params": [], - "id": 1 -} -``` - -**Example Response**: -```json -{ - "jsonrpc": "2.0", - "result": "0000000000000000000f2adce67e48b6c9ae0f0507c739db9a55f56d85662bc8", - "error": null, - "id": 1 -} -``` - -### `getBlockHash` - -Returns hash of block in best-block-chain at height provided. - -**Parameters**: -1. `height` (number, required) - The height index - -**Result**: -- String - The block hash, hex encoded - -**Example Request**: -```json -{ - "jsonrpc": "2.0", - "method": "getBlockHash", - "params": [1000], - "id": 1 -} -``` - -**Example Response**: -```json -{ - "jsonrpc": "2.0", - "result": "00000000000345089c8a91d47b62ca6a1e4d0e8df7f86df9e2e50e62bcdf2887", - "error": null, - "id": 1 -} -``` - -## Error Handling - -JSON-RPC endpoints return standard error codes as defined in the JSON-RPC 2.0 specification. In addition, DAPI may return additional error details in the error object: - -```json -{ - "jsonrpc": "2.0", - "result": null, - "error": { - "code": -32602, - "message": "Invalid params", - "data": "Height parameter out of range" - }, - "id": 1 -} -``` - -Common error codes: -- `-32600`: Invalid Request - The JSON sent is not a valid Request object -- `-32601`: Method not found - The method does not exist / is not available -- `-32602`: Invalid params - Invalid method parameter(s) -- `-32603`: Internal error - Internal JSON-RPC error -- `-32700`: Parse error - Invalid JSON was received by the server - -## Connection Details - -The JSON-RPC server listens on port 2501 by default (configurable via `API_JSON_RPC_PORT` environment variable). - -## Compatibility Notes - -These endpoints are designed to provide a subset of the functionality available in Dash Core's JSON-RPC interface. For comprehensive access to all Dash Core functionality, you should connect directly to a Dash Core node's JSON-RPC interface. \ No newline at end of file diff --git a/packages/dapi/doc/endpoints/json-rpc/getBestBlockHash.md b/packages/dapi/doc/endpoints/json-rpc/getBestBlockHash.md new file mode 100644 index 00000000000..3476a3c88e9 --- /dev/null +++ b/packages/dapi/doc/endpoints/json-rpc/getBestBlockHash.md @@ -0,0 +1,87 @@ +# getBestBlockHash + +## Client API + +Returns the hash of the best (tip) block in the longest blockchain. + +**Request Format**: +```json +{ + "jsonrpc": "2.0", + "method": "getBestBlockHash", + "params": [], + "id": 1 +} +``` + +**Response Format**: +```json +{ + "jsonrpc": "2.0", + "result": "000000000000001bb82a7f5973618cfd3588ba1df2ee3004d4add6321678564b", + "id": 1 +} +``` + +**Example Usage**: +```javascript +// Using fetch API +const response = await fetch('http://localhost:2501', { + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify({ + jsonrpc: '2.0', + method: 'getBestBlockHash', + params: [], + id: 1 + }) +}); +const data = await response.json(); +console.log(`Best block hash: ${data.result}`); +``` + +## Internal Implementation + +The `getBestBlockHash` endpoint is implemented in the `getBestBlockHash.js` file. + +### Implementation Details + +1. **Caching Mechanism** + - Implements a caching strategy to avoid repeated calls to Core + - Cache is invalidated when new blocks are detected via ZMQ + - Only makes a Core RPC call when the cache is empty or invalid + +2. **Core Integration** + - Interfaces with Dash Core via RPC to get the latest block hash + - Uses the Core's `getBestBlockHash` method directly + +3. **Event Handling** + - Subscribes to ZMQ `hashblock` events from Core + - Uses these events to detect when new blocks are added to the chain + - Invalidates the cache when a new block is detected + +4. **Error Handling** + - Wraps Core RPC errors in JSON-RPC compatible error responses + - Maintains consistency with JSON-RPC 2.0 specification + +5. **Dependencies** + - Dash Core RPC interface + - ZMQ client for new block notifications + +### Code Flow + +``` +Client Request + → JSON-RPC Server + → getBestBlockHash Handler + → Check Cache + → If Valid: Return Cached Hash + → If Invalid: + → Call Core RPC getBestBlockHash + → Cache Result + → Return Hash +``` + +### Endpoint Categorization + +This endpoint is categorized as a Layer 1 (L1) endpoint in the API documentation, indicating that it interacts directly with the Dash Core blockchain functionality. \ No newline at end of file diff --git a/packages/dapi/doc/endpoints/json-rpc/getBlockHash.md b/packages/dapi/doc/endpoints/json-rpc/getBlockHash.md new file mode 100644 index 00000000000..161b2cf1f95 --- /dev/null +++ b/packages/dapi/doc/endpoints/json-rpc/getBlockHash.md @@ -0,0 +1,108 @@ +# getBlockHash + +## Client API + +Returns the hash of the block at the specified height in the local best blockchain. + +**Request Format**: +```json +{ + "jsonrpc": "2.0", + "method": "getBlockHash", + "params": [1000], + "id": 1 +} +``` + +**Response Format**: +```json +{ + "jsonrpc": "2.0", + "result": "00000000000000437b4c6fa42c9e5095844c1ed847417cead17612d7b153643e", + "id": 1 +} +``` + +**Example Usage**: +```javascript +// Using fetch API +const response = await fetch('http://localhost:2501', { + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify({ + jsonrpc: '2.0', + method: 'getBlockHash', + params: [1000], + id: 1 + }) +}); +const data = await response.json(); +console.log(`Block hash at height 1000: ${data.result}`); +``` + +## Internal Implementation + +The `getBlockHash` endpoint is implemented in the `getBlockHash.js` file. + +### Implementation Details + +1. **Input Validation** + - Validates the input parameters against a schema + - Requires a single height parameter that must be a non-negative integer + - Returns appropriate error responses for invalid inputs + +2. **Core Integration** + - Interfaces with Dash Core via RPC to get the block hash + - Calls Core's `getBlockHash` method with the provided height + +3. **Direct Delegation** + - This endpoint is a simple pass-through to the Core RPC + - After validation, it directly calls the corresponding Core method with the same parameters + +4. **Error Handling** + - Maps Core RPC errors to JSON-RPC compatible error responses + - Handles "block height out of range" errors specifically + - Provides descriptive error messages to help diagnose issues + +5. **Dependencies** + - Dash Core RPC interface + - JSON schema validator for parameter validation + +### Code Flow + +``` +Client Request + → JSON-RPC Server + → getBlockHash Handler + → Validate Height Parameter + → If Invalid: Return Error Response + → Call Core RPC getBlockHash with height + → If Successful: Return Block Hash + → If Error: Map to JSON-RPC Error Response +``` + +### Schema Validation + +The endpoint uses a JSON schema to validate the input: + +```json +{ + "type": "array", + "items": { + "type": "number", + "minimum": 0 + }, + "minItems": 1, + "maxItems": 1 +} +``` + +This ensures that: +- The params field is an array +- It contains exactly one item +- The item is a number (block height) +- The height is non-negative + +### Endpoint Categorization + +This endpoint is categorized as a Layer 1 (L1) endpoint in the API documentation, indicating that it interacts directly with the Dash Core blockchain functionality. \ No newline at end of file diff --git a/packages/dapi/doc/endpoints/platform-endpoints.md b/packages/dapi/doc/endpoints/platform-endpoints.md deleted file mode 100644 index 4b7b7b8f06a..00000000000 --- a/packages/dapi/doc/endpoints/platform-endpoints.md +++ /dev/null @@ -1,126 +0,0 @@ -# DAPI Platform Endpoints - -These endpoints provide access to Dash Platform (Evolution) functionality through the gRPC interface. - -## Available Endpoints - -### `broadcastStateTransition` - -Broadcasts a state transition to the Dash Platform. - -**Request Parameters**: -- `stateTransition`: Binary buffer containing serialized state transition (required) - -**Response Parameters**: -- Empty response on success - -**Example Usage**: -```javascript -const { broadcastStateTransition } = dapiClient.platform; -const stateTransitionHex = '0200000001...'; // State transition hex -const result = await broadcastStateTransition(stateTransitionHex); -``` - -### `getConsensusParams` - -Retrieves consensus parameters from the Dash Platform. - -**Request Parameters**: -- `height`: Height at which to fetch parameters (optional) -- `prove`: Whether to include proofs (not implemented) - -**Response Parameters**: -- `blockMaxBytes`: Maximum block size in bytes -- `blockMaxGas`: Maximum gas allowed per block -- `blockTime`: Target block time in milliseconds -- `evidenceMaxAgeNumBlocks`: Maximum age of evidence in blocks -- `evidenceMaxAgeDuration`: Maximum age of evidence in nanoseconds -- `evidenceMaxBytes`: Maximum evidence size in bytes - -**Example Usage**: -```javascript -const { getConsensusParams } = dapiClient.platform; -const params = await getConsensusParams(); -console.log(`Block time: ${params.blockTime}ms`); -``` - -### `getStatus` - -Gets the status of the Dash Platform. - -**Request Parameters**: None - -**Response Parameters**: -- `version`: Version information - - `protocol`: Protocol version - - `software`: Software version - - `agent`: User agent string -- `time`: Various time data - - `now`: Current server time - - `block`: Latest block time - - `sync`: Sync status time information -- `status`: General status information - - `sync`: Sync status - - `chain`: Chain information - - `network`: Network information - -**Example Usage**: -```javascript -const { getStatus } = dapiClient.platform; -const status = await getStatus(); -console.log(`Platform version: ${status.version.software}`); -``` - -### `waitForStateTransitionResult` - -Waits for a state transition to be processed and returns the result. - -**Request Parameters**: -- `stateTransitionHash`: Hash of the state transition to wait for (string, required) -- `prove`: Whether to include proof in response (boolean, optional) - -**Response Parameters**: -If successful: -- `status`: Status of the state transition (number) -- `proof`: Proof data if requested - -If failure: -- `status`: Status of the state transition (number) -- `errorCode`: Error code number -- `errorMessage`: Detailed error message - -**Example Usage**: -```javascript -const { waitForStateTransitionResult } = dapiClient.platform; -const hash = '0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef'; -try { - const result = await waitForStateTransitionResult(hash); - console.log(`State transition processed with status: ${result.status}`); -} catch (error) { - console.error(`State transition failed: ${error.message}`); -} -``` - -## Unimplemented Endpoints - -The following endpoints are defined in the API but are currently unimplemented: - -- `getIdentity` -- `getIdentitiesContractKeys` -- `getIdentityBalance` -- `getIdentityBalanceAndRevision` -- `getIdentityKeys` -- `getDocuments` -- `getDataContract` -- `getDataContracts` -- `getDataContractHistory` -- `getIdentityByPublicKeyHash` -- `getIdentitiesByPublicKeyHashes` -- `getProofs` -- `getEpochsInfo` -- `getProtocolVersionUpgradeVoteStatus` -- `getProtocolVersionUpgradeState` -- `getIdentityContractNonce` -- `getIdentityNonce` - -These endpoints may be implemented in future releases of DAPI as the Platform functionality expands. \ No newline at end of file diff --git a/packages/dapi/doc/endpoints/platform/broadcastStateTransition.md b/packages/dapi/doc/endpoints/platform/broadcastStateTransition.md new file mode 100644 index 00000000000..b783d5e44bc --- /dev/null +++ b/packages/dapi/doc/endpoints/platform/broadcastStateTransition.md @@ -0,0 +1,90 @@ +# broadcastStateTransition + +## Client API + +Broadcasts a state transition to the Dash Platform. + +**Request Parameters**: +- `stateTransition`: Binary buffer containing serialized state transition (required) + +**Response Parameters**: +- Empty response on success + +**Example Usage**: +```javascript +const stateTransitionHex = '0300...'; // Raw state transition hex +const result = await dapiClient.platform.broadcastStateTransition(stateTransitionHex); +console.log('State transition broadcast successfully'); +``` + +## Internal Implementation + +The `broadcastStateTransition` endpoint is implemented in the `broadcastStateTransitionHandlerFactory.js` file. + +### Implementation Details + +1. **State Transition Processing** + - Takes a state transition (ST) byte array as input + - Converts the state transition to base64 format for Tenderdash compatibility + - Sends the encoded state transition to Tenderdash via the `broadcast_tx` RPC call + +2. **Validation Flow** + - Tenderdash performs initial validation during the `broadcast_tx` call + - If validation fails, DAPI may perform a `check_tx` call to get detailed error information + - This provides clients with specific validation error messages + +3. **Error Handling** + - Handles various error scenarios with specialized error responses: + - State transition already in mempool ("tx already exists in cache") + - State transition already in blockchain + - Transaction too large + - Mempool full + - Broadcast timeout + - Maps Tenderdash errors to appropriate gRPC error codes + - Returns detailed error information to help diagnose issues + +4. **Dependencies** + - Tenderdash RPC interface for transaction broadcasting + - Drive for state transition validation + +### Code Flow + +``` +Client Request + → gRPC Server + → broadcastStateTransitionHandler + → Validate State Transition Format + → Convert to Base64 Encoding + → Call Tenderdash broadcast_tx RPC + → If Successful: + → Return Empty Response + → If Error: + → Try check_tx for Detailed Error (optional) + → Map Tenderdash Error to gRPC Error + → Return Error Response +``` + +### Common Error Scenarios + +The handler processes several common error conditions: + +1. **Already in Mempool** + - Error message: "tx already exists in cache" + - Indicates the state transition is already being processed + - Returns ALREADY_EXISTS gRPC error + +2. **Validation Failures** + - Various error messages depending on the specific validation issue + - Usually relates to state transition structure or signature problems + - Returns INVALID_ARGUMENT or FAILED_PRECONDITION errors + +3. **System Capacity Issues** + - "mempool is full" or "tx too large" + - Indicates system resource constraints + - Returns RESOURCE_EXHAUSTED error + +4. **Timeout Errors** + - Occurs when the broadcast operation exceeds time limits + - Returns DEADLINE_EXCEEDED error + +These detailed error responses help clients understand exactly why a state transition broadcast failed and how to resolve the issue. \ No newline at end of file diff --git a/packages/dapi/doc/endpoints/platform/getConsensusParams.md b/packages/dapi/doc/endpoints/platform/getConsensusParams.md new file mode 100644 index 00000000000..f2c50d3117f --- /dev/null +++ b/packages/dapi/doc/endpoints/platform/getConsensusParams.md @@ -0,0 +1,92 @@ +# getConsensusParams + +## Client API + +Retrieves the platform consensus parameters. + +**Request Parameters**: +- `height`: Block height to retrieve parameters for (optional, defaults to latest) + +**Response Parameters**: +- `blockMaxBytes`: Maximum block size in bytes +- `blockMaxGas`: Maximum block gas limit +- `blockTimeIotaMs`: Block time parameter in milliseconds +- `evidenceMaxAgeDuration`: Maximum age of evidence in nanoseconds +- `evidenceMaxAgeNumBlocks`: Maximum age of evidence in blocks +- `evidenceMaxBytes`: Maximum evidence size in bytes +- `validatorSlashAmount`: Amount to slash validators by + +**Example Usage**: +```javascript +// Get latest consensus parameters +const latestParams = await dapiClient.platform.getConsensusParams(); +console.log(`Max block size: ${latestParams.blockMaxBytes} bytes`); + +// Get consensus parameters at a specific height +const heightParams = await dapiClient.platform.getConsensusParams(1000); +console.log(`Max block size at height 1000: ${heightParams.blockMaxBytes} bytes`); +``` + +## Internal Implementation + +The `getConsensusParams` endpoint is implemented in the `getConsensusParamsFactory.js` file. + +### Implementation Details + +1. **Parameter Retrieval** + - Calls the `getConsensusParams` function which interfaces with Tenderdash + - Can retrieve parameters at the latest height or at a specific historical height + - Makes a `consensus_params` RPC call to Tenderdash + +2. **Parameter Processing** + - Converts raw Tenderdash parameters to the DAPI gRPC format + - Handles duration formats and converts them to standard time units + - Organizes parameters into logical categories + +3. **Input Validation** + - Validates that the height parameter (if provided) is a positive integer + - Returns appropriate error responses for invalid inputs + +4. **Error Handling** + - Maps Tenderdash RPC errors to appropriate gRPC error codes + - Handles connection issues with detailed error messages + - Returns NOT_FOUND errors for requests for non-existent heights + +5. **Dependencies** + - Tenderdash RPC interface for consensus parameter data + +### Code Flow + +``` +Client Request + → gRPC Server + → getConsensusParamsHandler + → Validate Height Parameter (if provided) + → Call getConsensusParams Function + → Call Tenderdash consensus_params RPC + → With height if specified + → Without height for latest params + → Process Response + → Format Parameters + → Build Response Object + → Return Consensus Parameters +``` + +### Consensus Parameter Categories + +The parameters are organized into several categories: + +1. **Block Parameters** + - `blockMaxBytes`: Maximum allowed block size + - `blockMaxGas`: Maximum gas allowed per block + - `blockTimeIotaMs`: Minimum time increment between blocks + +2. **Evidence Parameters** + - `evidenceMaxAgeDuration`: Maximum age of evidence in time + - `evidenceMaxAgeNumBlocks`: Maximum age of evidence in blocks + - `evidenceMaxBytes`: Maximum size of evidence + +3. **Validator Parameters** + - `validatorSlashAmount`: Amount to slash validators for misbehavior + +These parameters govern the fundamental rules of the blockchain, controlling aspects like performance, security, and economic incentives. They can change over time through governance processes, which is why the API allows retrieving parameters at specific heights. \ No newline at end of file diff --git a/packages/dapi/doc/endpoints/platform/getStatus.md b/packages/dapi/doc/endpoints/platform/getStatus.md new file mode 100644 index 00000000000..2510a7bcf6d --- /dev/null +++ b/packages/dapi/doc/endpoints/platform/getStatus.md @@ -0,0 +1,118 @@ +# getStatus + +## Client API + +Retrieves the current status of the Dash Platform. + +**Request Parameters**: None + +**Response Parameters**: +- `version`: Version information + - `protocolVersion`: Protocol version number + - `software`: Software version string +- `time`: Time information + - `blockTime`: Last block time + - `genesisTime`: Blockchain genesis time + - `localTime`: Local node time +- `chain`: Chain information + - `blockHeight`: Current block height + - `blocksPerDay`: Average blocks per day + - `bestBlockHash`: Hash of the best block + - `syncStatus`: Sync status (SYNCING or READY) +- `sync`: Sync information + - `startingBlockHeight`: Height when sync started + - `currentBlockHeight`: Current sync height + - `latestHeight`: Latest known height in the network +- `network`: Network information + - `peerCount`: Number of connected peers + - `isListening`: Whether node is listening for connections + - `chainId`: Chain identifier string +- `nodeId`: Node identifier +- `proTxHash`: Protx hash (for masternodes) + +**Example Usage**: +```javascript +const status = await dapiClient.platform.getStatus(); +console.log(`Platform block height: ${status.chain.blockHeight}`); +console.log(`Platform version: ${status.version.software}`); +console.log(`Sync status: ${status.chain.syncStatus}`); +``` + +## Internal Implementation + +The `getStatus` endpoint is implemented in the `getStatusHandlerFactory.js` file. + +### Implementation Details + +1. **Caching Mechanism** + - Implements a caching strategy to reduce load on Platform subsystems + - Cache is valid for 3 minutes by default + - Cache is invalidated when new platform blocks are detected + +2. **Data Collection** + - Fetches status information from multiple sources in parallel: + - Drive client status + - Tenderdash status through RPC + - Tenderdash network information + - Uses `Promise.allSettled` to handle potential failures in any subsystem + - Constructs a comprehensive response from all available data + +3. **Status Determination** + - Calculates sync status based on current height vs. latest known height + - Provides sync progress information when syncing + - Includes chain, network, and time information + +4. **Partial Results** + - Handles scenarios where some components are unavailable + - Returns partial status information when possible + - Provides fallback values for non-critical fields + +5. **Dependencies** + - Drive client for Drive status + - Tenderdash RPC for blockchain status + - Tenderdash networking for peer information + +### Code Flow + +``` +Client Request + → gRPC Server + → getStatusHandler + → Check Cache + → If Valid: Return Cached Status + → If Invalid: + → Parallel Requests (Promise.allSettled): + → Drive Status + → Tenderdash Status + → Tenderdash Network Info + → Process All Results + → Handle Any Failed Requests + → Calculate Derived Fields + → Cache Response + → Return Complete Status +``` + +### Response Construction + +The handler carefully builds a comprehensive status response: + +1. **Version Information** + - Protocol version: Consensus protocol version number + - Software version: Implementation version string + +2. **Time Information** + - Block time: Timestamp of the most recent block + - Genesis time: When the blockchain started + - Local time: Current node's time (for comparison) + +3. **Chain Information** + - Current height and hash information + - Sync status determination (SYNCING or READY) + - Estimated blocks per day calculation + +4. **Network Status** + - Peer count and listening status + - Chain ID for network identification + - Node identifiers for the current node + +This comprehensive status provides clients with a complete picture of the platform's current state and health. \ No newline at end of file diff --git a/packages/dapi/doc/endpoints/platform/waitForStateTransitionResult.md b/packages/dapi/doc/endpoints/platform/waitForStateTransitionResult.md new file mode 100644 index 00000000000..2134ff31741 --- /dev/null +++ b/packages/dapi/doc/endpoints/platform/waitForStateTransitionResult.md @@ -0,0 +1,104 @@ +# waitForStateTransitionResult + +## Client API + +Waits for a state transition to be processed by the platform and returns the result. + +**Request Parameters**: +- `stateTransitionHash`: Hash of the state transition to wait for (string, required) +- `prove`: Boolean indicating whether to return a proof (optional, default: false) + +**Response Parameters**: +- If successful: + - `proof`: Merkle proof of the state transition (if requested) +- If error: + - `error`: Error details object + - `error.code`: Error code + - `error.message`: Error message + - `error.data`: Additional error data + +**Example Usage**: +```javascript +const stHash = '4bc5547b87323ef4efd9ef3ebfee4aec53a3e31877f6498126318839a01cd943'; +const result = await dapiClient.platform.waitForStateTransitionResult(stHash, true); +if (result.error) { + console.error(`Error processing state transition: ${result.error.message}`); +} else { + console.log('State transition processed successfully with proof:', result.proof); +} +``` + +## Internal Implementation + +The `waitForStateTransitionResult` endpoint is implemented in the `waitForStateTransitionResultHandlerFactory.js` file. + +### Implementation Details + +1. **Wait Mechanism** + - Uses the `waitForTransactionToBeProvable` function to monitor transaction state + - Polls Tenderdash until the transaction is either confirmed or rejected + - Has configurable timeout periods to prevent indefinite waiting + +2. **Proof Generation** + - If the `prove` parameter is true, fetches a cryptographic proof of inclusion + - Calls Drive to generate the state transition proof + - This proof can be used for verification without trusting DAPI + +3. **Result Processing** + - Processes both successful and unsuccessful state transitions + - For successful transactions, returns proof if requested + - For failed transactions, returns detailed error information + +4. **Error Handling** + - Handles timeout errors with `DeadlineExceededGrpcError` + - Captures and formats transaction execution errors from Tenderdash + - Handles Drive unavailability for proof generation + +5. **Dependencies** + - Tenderdash for transaction monitoring + - Drive for proof generation + - Internal waitForTransactionToBeProvable utility + +### Code Flow + +``` +Client Request + → gRPC Server + → waitForStateTransitionResultHandler + → Verify Tenderdash Availability + → Call waitForTransactionToBeProvable + → Poll Transaction Status + → If Timeout: Return DeadlineExceededError + → If Error: Process Transaction Error + → If Success: + → If Prove=true: + → Call Drive to Generate Proof + → Return Proof + → If Prove=false: + → Return Empty Success Response + → Return Response +``` + +### Transaction Status Monitoring + +The handler uses sophisticated techniques to monitor transaction status: + +1. **Initial Check** + - Checks if the transaction is already confirmed + - Avoids unnecessary waiting for already-processed transactions + +2. **Subscription** + - Subscribes to Tenderdash events to receive real-time updates + - More efficient than polling for transaction status + +3. **Timeout Management** + - Uses configurable timeouts based on network conditions + - Provides meaningful errors when timeouts occur + +4. **Error Classification** + - Classifies transaction errors into categories: + - Validation errors (transaction rejected) + - System errors (node unavailable) + - Timeout errors (transaction not confirmed in time) + +This comprehensive approach ensures reliable tracking of state transition processing and provides clients with clear information about the outcome. \ No newline at end of file diff --git a/packages/dapi/doc/endpoints/streams/subscribeToBlockHeadersWithChainLocks.md b/packages/dapi/doc/endpoints/streams/subscribeToBlockHeadersWithChainLocks.md new file mode 100644 index 00000000000..6985a6c678e --- /dev/null +++ b/packages/dapi/doc/endpoints/streams/subscribeToBlockHeadersWithChainLocks.md @@ -0,0 +1,104 @@ +# subscribeToBlockHeadersWithChainLocks + +## Client API + +Streams block headers and chain locks. + +**Request Parameters**: +- `fromBlockHash` or `fromBlockHeight`: Starting point (optional) +- `count`: Number of blocks to fetch (0 means subscribe to new blocks) + +**Response Parameters**: +- Stream of block headers and chain locks + - `rawBlockHeader`: Serialized block header + - `rawChainLock`: Serialized chain lock + +**Example Usage**: +```javascript +const stream = dapiClient.core.subscribeToBlockHeadersWithChainLocks({ fromBlockHeight: 1000, count: 10 }); + +stream.on('data', (response) => { + if (response.rawBlockHeader) { + console.log('Received block header'); + } else if (response.rawChainLock) { + console.log('Received chain lock'); + } +}); +``` + +## Internal Implementation + +The `subscribeToBlockHeadersWithChainLocks` endpoint is implemented in the `subscribeToBlockHeadersWithChainLocksHandlerFactory.js` file. + +### Implementation Details + +1. **Dual Operation Modes** + - **Historical Mode**: Retrieves a specific count of block headers from a starting point + - **Streaming Mode**: Provides real-time updates when new blocks are created + - **Combined Mode**: Historical headers followed by real-time streaming + +2. **Historical Data Retrieval** + - Uses an iterator pattern for efficient header retrieval + - Supports two ways to specify the starting point: + - `fromBlockHash`: Start from a specific block hash + - `fromBlockHeight`: Start from a specific block height + - Fetches headers in batches for better performance + - Includes associated chain locks when available + +3. **Real-time Streaming** + - Uses a `ProcessMediator` for event-based communication + - Subscribes to ZMQ events from Dash Core + - Emits block headers and chain locks as they are received + - Implements proper cleanup on client disconnection + +4. **Flow Control** + - Implements back-pressure handling + - Uses acknowledgment for stream responses + - Prevents overwhelming clients with data + +5. **Dependencies** + - BlockHeadersCache for efficient access to historical headers + - ZMQ client for real-time notifications + - ProcessMediator for event management + +### Code Flow + +``` +Client Request + → gRPC Server + → subscribeToBlockHeadersWithChainLocksHandler + → Validate Parameters + → If Historical Data Requested (count > 0): + → Create Historical Headers Iterator + → Stream Headers Until Count Reached + → If Streaming Requested (count = 0 or all historical sent): + → Subscribe to ZMQ Events + → On New Block: + → Format Block Header + → Send to Client + → On New ChainLock: + → Format ChainLock + → Send to Client + → On Client Disconnect: + → Clean Up Subscriptions +``` + +### Stream Lifecycle Management + +The handler implements careful resource management: + +1. **Initialization** + - Sets up event listeners and iterators + - Prepares caches for efficient data retrieval + +2. **Active Streaming** + - Monitors Core node for new blocks and chain locks + - Transforms raw data to client-friendly format + - Sends data through the gRPC stream + +3. **Cleanup** + - Detects client disconnection (explicit or timeout) + - Removes event listeners and subscriptions + - Releases resources to prevent memory leaks + +This lifecycle management ensures efficient operation even with long-lived streaming connections. \ No newline at end of file diff --git a/packages/dapi/doc/endpoints/streams/subscribeToTransactionsWithProofs.md b/packages/dapi/doc/endpoints/streams/subscribeToTransactionsWithProofs.md new file mode 100644 index 00000000000..77ec249b740 --- /dev/null +++ b/packages/dapi/doc/endpoints/streams/subscribeToTransactionsWithProofs.md @@ -0,0 +1,127 @@ +# subscribeToTransactionsWithProofs + +## Client API + +Streams transactions matching a bloom filter with merkle proofs. + +**Request Parameters**: +- `bloomFilter`: Parameters for bloom filter (object, required) + - `vData`: Filter data + - `nHashFuncs`: Number of hash functions + - `nTweak`: Random value + - `nFlags`: Bloom filter update flags +- `fromBlockHash` or `fromBlockHeight`: Starting point (optional) +- `count`: Number of blocks to fetch (0 means subscribe to new transactions) + +**Response Parameters**: +- Stream of: + - `rawTransaction`: Serialized transaction + - `rawMerkleBlock`: Serialized merkle block (proof) + - `instantSendLockMessages`: Instant send lock data + +**Example Usage**: +```javascript +const bloomFilter = { + vData: '...', + nHashFuncs: 11, + nTweak: 0, + nFlags: 0 +}; + +const stream = dapiClient.core.subscribeToTransactionsWithProofs(bloomFilter); + +stream.on('data', (response) => { + if (response.rawMerkleBlock) { + console.log('Received merkle block'); + } else if (response.rawTransaction) { + console.log('Received transaction'); + } else if (response.instantSendLockMessages) { + console.log('Received instant send lock'); + } +}); +``` + +## Internal Implementation + +The `subscribeToTransactionsWithProofs` endpoint is implemented in the `subscribeToTransactionsWithProofsHandlerFactory.js` file. + +### Implementation Details + +1. **Bloom Filtering** + - Uses Bloom filters to efficiently match transactions of interest + - Applies filter to both historical and new transactions + - Supports standard Bloom filter flags for filter updates + +2. **Operation Modes** + - **Historical Mode**: Retrieves transactions from past blocks + - **Streaming Mode**: Provides real-time transaction updates + - **Combined Mode**: Historical data followed by real-time streaming + +3. **Historical Data Processing** + - Creates an iterator to efficiently process historical blocks + - For each block, filters transactions using the provided Bloom filter + - Sends matching transactions along with Merkle proofs + - Sends associated InstantLock messages when available + +4. **Real-time Streaming** + - Uses a `ProcessMediator` for event-driven architecture + - Subscribes to Core ZMQ events for new transactions and blocks + - Tests each transaction against the filter before sending + - Includes Merkle proofs for transaction inclusion verification + +5. **Mempool Handling** + - Processes mempool transactions to catch recent unconfirmed transactions + - Applies rate limiting to reduce load on Core + - Sends mempool transactions that match the filter + +6. **Dependencies** + - ZMQ client for real-time notifications + - Bloom filter implementation for transaction filtering + - ProcessMediator for event management + - Block cache for efficient block retrieval + +### Code Flow + +``` +Client Request + → gRPC Server + → subscribeToTransactionsWithProofsHandler + → Validate Bloom Filter Parameters + → Create BloomFilter Instance + → If Historical Data Requested (count > 0): + → Process Mempool Transactions + → Create Historical Transactions Iterator + → For Each Block: + → Filter Transactions Using Bloom Filter + → Send Matching Transactions + → Send Merkle Block (Proof) + → Send Associated InstantLocks + → If Streaming Requested (count = 0 or all historical sent): + → Subscribe to ZMQ Events + → On New Block: + → Filter Transactions + → Send Matching Transactions with Proofs + → On New Transaction: + → Test Against Filter + → If Match: Send Transaction + → On Client Disconnect: + → Clean Up Resources +``` + +### Response Types + +The endpoint emits three types of responses: + +1. **Raw Transactions** + - Serialized transaction data for transactions matching the filter + - Includes transaction metadata + +2. **Merkle Blocks** + - Partial block data that proves transaction inclusion + - Contains Merkle path to verify transactions without downloading the entire block + +3. **InstantSend Locks** + - Provides instant transaction finality information + - Allows clients to know when a transaction is secured by InstantSend + +These responses collectively enable lightweight clients to validate transactions without downloading the full blockchain. \ No newline at end of file diff --git a/packages/dapi/doc/getting-started.md b/packages/dapi/doc/getting-started.md deleted file mode 100644 index b8a02c1ffa7..00000000000 --- a/packages/dapi/doc/getting-started.md +++ /dev/null @@ -1,156 +0,0 @@ -# Getting Started with DAPI - -This guide will help you set up DAPI, understand its dependencies, and make your first API requests. - -## Installation - -To install DAPI, follow these steps: - -```sh -# Clone the repository (if you haven't already) -git clone https://github.com/dashpay/platform.git -cd platform/packages/dapi - -# Install dependencies -npm install -``` - -## Dependencies - -DAPI requires several dependencies to function properly: - -### 1. Node.js - -DAPI targets the latest v20 release of Node.js. - -### 2. Dash Core - -DAPI requires the latest version of [Dash Core](https://github.com/dashevo/dash-evo-branches/tree/evo) with Evolution features. - -#### Installing Dash Core: - -You can either: -- Use the Docker image: `dashcore:evo` -- Clone and build from [the repository](https://github.com/dashevo/dash-evo-branches/tree/evo) - - Switch to the `evo` branch - - Follow the [build instructions](https://github.com/dashevo/dash-evo-branches/tree/evo/doc) - -#### Configuring Dash Core: - -DAPI needs Dash Core's ZMQ interface to be exposed and all indexes enabled. You can find an example config for Dash Core [here](./dependencies_configs/dash.conf). - -To start Dash Core with this config: -```sh -./src/dashd -conf=/path/to/your/dash.conf -``` - -### 3. Drive and Tenderdash - -For Platform functionality, DAPI requires Drive and Tenderdash. The easiest way to set up a local development environment with all components is to use [Dash Platform Test Suite](https://github.com/dashevo/platform-test-suite). - -## Configuration - -DAPI is configured through environment variables, which can be passed directly or via a `.env` file. The main configuration options include: - -- `API_JSON_RPC_PORT`: JSON-RPC server port (default: 2501) -- `API_GRPC_PORT`: gRPC server port (default: 2500) -- `TX_FILTER_STREAM_GRPC_PORT`: Transaction filter stream port (default: 2510) -- `DASHCORE_RPC_HOST`, `DASHCORE_RPC_PORT`, `DASHCORE_RPC_USER`, `DASHCORE_RPC_PASS`: Dash Core connection settings -- `DRIVE_RPC_HOST`, `DRIVE_RPC_PORT`: Drive connection settings -- `TENDERMINT_RPC_HOST`, `TENDERMINT_RPC_PORT`: Tenderdash connection settings - -For a complete list of configuration options, see the [Configuration](./configuration.md) document. - -## Running DAPI - -DAPI consists of two separate processes: - -```sh -# Start both processes using npm -npm start - -# Or start them individually -node scripts/api.js # API process -node scripts/core-streams.js # Core Streams process -``` - -Both processes should be running for DAPI to function correctly. - -## Making API Requests - -DAPI provides two interfaces: gRPC (recommended) and JSON-RPC (legacy). - -### gRPC Examples - -For gRPC, you can use client libraries in various languages or tools like [grpcurl](https://github.com/fullstorydev/grpcurl) for testing: - -```bash -# Get blockchain status -grpcurl -plaintext localhost:2500 org.dash.platform.dapi.v0.Core/getBlockchainStatus - -# Get best block height -grpcurl -plaintext localhost:2500 org.dash.platform.dapi.v0.Core/getBestBlockHeight - -# Get Platform status -grpcurl -plaintext localhost:2500 org.dash.platform.dapi.v0.Platform/getStatus -``` - -### JSON-RPC Examples - -For JSON-RPC, you can use any HTTP client, like `curl`: - -```bash -# Get best block hash -curl -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"getBestBlockHash","params":[],"id":1}' http://localhost:2501 - -# Get block hash at height 1000 -curl -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"getBlockHash","params":[1000],"id":1}' http://localhost:2501 -``` - -## Using Client Libraries - -For application development, we recommend using the DAPI client libraries rather than directly interfacing with DAPI: - -### JavaScript - -```js -const { DAPIClient } = require('@dashevo/dapi-client'); -const client = new DAPIClient(); - -// Core API example -async function getBlockchainInfo() { - const status = await client.core.getBlockchainStatus(); - console.log('Blockchain status:', status); -} - -// Platform API example -async function getPlatformStatus() { - const status = await client.platform.getStatus(); - console.log('Platform status:', status); -} -``` - -### Streaming Example - -```js -const { DAPIClient } = require('@dashevo/dapi-client'); -const client = new DAPIClient(); - -// Stream block headers -const stream = client.core.subscribeToBlockHeadersWithChainLocks(); - -stream.on('data', (response) => { - if (response.rawBlockHeader) { - console.log('Received block header'); - } else if (response.rawChainLock) { - console.log('Received chain lock'); - } -}); -``` - -## Next Steps - -- Learn about [DAPI's architecture](./architecture.md) -- Explore the [available endpoints](./endpoints/index.md) -- Understand how to [configure DAPI](./configuration.md) for your needs -- Consult the [Dash Platform Developer Documentation](https://docs.dash.org/projects/platform/en/stable/) for more information about the broader Dash Platform ecosystem \ No newline at end of file diff --git a/packages/dapi/doc/index.md b/packages/dapi/doc/index.md index 89cb457cc38..7f299ea38b5 100644 --- a/packages/dapi/doc/index.md +++ b/packages/dapi/doc/index.md @@ -1,10 +1,14 @@ # DAPI Documentation -Welcome to the DAPI (Decentralized API) documentation. This guide provides comprehensive information about DAPI, its architecture, configuration, and available endpoints. +This guide provides comprehensive information about DAPI, its architecture, configuration, and available endpoints. ## What is DAPI? -DAPI (Decentralized API) is the decentralized HTTP API layer for the Dash Evolution platform. It provides a simple interface for accessing both the Dash blockchain (Core) and the Dash Platform (Evolution) features. +Historically, nodes in most cryptocurrency networks communicated with each other, and the outside world, according to a peer-to-peer (P2P) protocol. +The use of P2P protocols presented some downsides for developers, namely, network resources were difficult to access without specialized knowledge or trusted third-party services. + +To overcome these obstacles, the Dash decentralized API (DAPI) uses Dash's robust masternode infrastructure to provide an API for accessing the network. +DAPI supports both layer 1 (Core blockchain) and layer 2 (Dash Platform) functionality so all developers can interact with Dash via a single interface. DAPI offers several advantages over traditional centralized APIs: @@ -31,20 +35,31 @@ Each process connects independently to the underlying Dash infrastructure (Core, Learn more about DAPI's architecture in the [Architecture](./architecture.md) section. -## Documentation Sections +## Endpoints -### Getting Started -- [Getting Started](./getting-started.md) - Quick start guide for developers +### Overview +- [Endpoints Overview](./endpoints/index.md) - Index of all available API endpoints -### Core Documentation -- [Architecture](./architecture.md) - Detailed explanation of DAPI's design -- [Configuration](./configuration.md) - How to configure DAPI for different environments +### Core Endpoints +- [getBestBlockHeight](./endpoints/core/getBestBlockHeight.md) +- [getBlockchainStatus](./endpoints/core/getBlockchainStatus.md) +- [getTransaction](./endpoints/core/getTransaction.md) +- [broadcastTransaction](./endpoints/core/broadcastTransaction.md) +- [subscribeToMasternodeList](./endpoints/core/subscribeToMasternodeList.md) -### Endpoints -- [Endpoints Overview](./endpoints/index.md) - Index of all available API endpoints -- [Core Endpoints](./endpoints/core-endpoints.md) - Interact with the Dash blockchain -- [Platform Endpoints](./endpoints/platform-endpoints.md) - Interact with Dash Platform -- [JSON-RPC Endpoints](./endpoints/json-rpc-endpoints.md) - Legacy endpoints +### Platform Endpoints +- [broadcastStateTransition](./endpoints/platform/broadcastStateTransition.md) +- [waitForStateTransitionResult](./endpoints/platform/waitForStateTransitionResult.md) +- [getConsensusParams](./endpoints/platform/getConsensusParams.md) +- [getStatus](./endpoints/platform/getStatus.md) + +### Stream Endpoints +- [subscribeToBlockHeadersWithChainLocks](./endpoints/streams/subscribeToBlockHeadersWithChainLocks.md) +- [subscribeToTransactionsWithProofs](./endpoints/streams/subscribeToTransactionsWithProofs.md) + +### JSON-RPC Endpoints +- [getBestBlockHash](./endpoints/json-rpc/getBestBlockHash.md) +- [getBlockHash](./endpoints/json-rpc/getBlockHash.md) ## Client Libraries @@ -55,4 +70,4 @@ Rather than directly interacting with DAPI's gRPC or JSON-RPC interfaces, most d - [DAPI Client (JavaScript)](https://docs.dash.org/projects/platform/en/stable/docs/dapi-client-js/overview.html) - [gRPC Clients](https://github.com/dashpay/platform/tree/master/packages/dapi-grpc) (for other languages) -These libraries handle the complexity of interacting with DAPI and provide idiomatic interfaces in their respective languages. \ No newline at end of file +These libraries handle the complexity of interacting with DAPI and provide idiomatic interfaces in their respective languages. diff --git a/packages/dapi/doc/overview.md b/packages/dapi/doc/overview.md deleted file mode 100644 index 150e4edf7ad..00000000000 --- a/packages/dapi/doc/overview.md +++ /dev/null @@ -1,70 +0,0 @@ -# DAPI Overview - -DAPI (Decentralized API) is the decentralized API for the Dash Evolution platform. It serves as a distributed and decentralized HTTP API that functions as the developers' access point to the Dash network. - -## What is DAPI? - -DAPI is an HTTP API that allows developers to interact with the Dash network in a simple and efficient way. By being a decentralized solution running on the masternode network, DAPI offers several advantages over traditional centralized APIs: - -- No single point of failure -- Censorship resistance -- High availability -- Built-in scalability - -DAPI supports both traditional Dash operations (sending transactions, querying blocks) and Dash Platform (Evolution) operations (state transitions, data contracts). - -Read more: https://docs.dash.org/projects/platform/en/stable/docs/explanations/dapi.html - -## Architecture - -DAPI consists of two main processes: - -1. **API Process** (`api.js`) - Handles the main gRPC and JSON-RPC endpoints -2. **Core Streams Process** (`core-streams.js`) - Handles streaming endpoints like block headers and transactions - -Each process serves different types of endpoints: - -### API Process Endpoints -- Core endpoints for interacting with Dash Core -- Platform endpoints for Dash Platform (Evolution) services -- Legacy JSON-RPC endpoints - -### Core Streams Process Endpoints -- Block headers streaming -- Transaction streaming with bloom filters -- Masternode list streaming - -For more details about the DAPI architecture, see the [Architecture](./architecture.md) document. - -## DAPI Interfaces - -DAPI offers two main interfaces: - -1. **gRPC** - Modern, high-performance interface using Protocol Buffers -2. **JSON-RPC** - Legacy interface that will be removed in the future. - -The gRPC interface is recommended for new applications due to its better performance, type safety, and streaming capabilities. - -## Getting Started - -To connect to DAPI, you can use either: - -- Dash SDK - - https://docs.dash.org/projects/platform/en/stable/docs/sdk-js/overview.html - - https://docs.dash.org/projects/platform/en/stable/docs/sdk-rs/overview.html -- Low-level DAPI Client - - https://docs.dash.org/projects/platform/en/stable/docs/dapi-client-js/overview.html -- Generated gRPC clients - - https://github.com/dashpay/platform/tree/master/packages/dapi-grpc - -For a step-by-step guide on setting up and using DAPI, see the [Getting Started](./getting-started.md) document. - -## Dependencies - -DAPI relies on several underlying services: - -- **Dash Core** - Provides access to the Dash blockchain -- **Drive ABCI** - Provides access to the Dash Platform state -- **Tenderdash** - Consensus engine for Dash Platform - -See the [Configuration](./configuration.md) document for details on how to set up these dependencies. From d2a530b6b516fa5c98d427ffa682f4c91f14c11c Mon Sep 17 00:00:00 2001 From: Ivan Shumkov Date: Fri, 18 Apr 2025 20:23:45 +0700 Subject: [PATCH 14/15] revert: dapi grpc changes --- packages/dapi-grpc/build.rs | 2 +- .../java/org/dash/platform/dapi/v0/PlatformGrpc.java | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/dapi-grpc/build.rs b/packages/dapi-grpc/build.rs index c8c08fbcaca..7f376f254e8 100644 --- a/packages/dapi-grpc/build.rs +++ b/packages/dapi-grpc/build.rs @@ -125,7 +125,7 @@ fn configure_platform(mut platform: MappingConfig) -> MappingConfig { // - "GetIdentityByNonUniquePublicKeyHashResponse" // // "GetEvonodesProposedEpochBlocksResponse" is used for 2 Requests - const VERSIONED_RESPONSES: [&str; 38] = [ + const VERSIONED_RESPONSES: [&str; 39] = [ "GetDataContractHistoryResponse", "GetDataContractResponse", "GetDataContractsResponse", diff --git a/packages/dapi-grpc/clients/platform/v0/java/org/dash/platform/dapi/v0/PlatformGrpc.java b/packages/dapi-grpc/clients/platform/v0/java/org/dash/platform/dapi/v0/PlatformGrpc.java index 796ae2a104e..53fc70531c9 100644 --- a/packages/dapi-grpc/clients/platform/v0/java/org/dash/platform/dapi/v0/PlatformGrpc.java +++ b/packages/dapi-grpc/clients/platform/v0/java/org/dash/platform/dapi/v0/PlatformGrpc.java @@ -3134,13 +3134,13 @@ public com.google.common.util.concurrent.ListenableFuture implements io.grpc.stub.ServerCalls.UnaryMethod, From f1872483e66bb7ae11752a3217f6fccc0de657a8 Mon Sep 17 00:00:00 2001 From: Ivan Shumkov Date: Fri, 18 Apr 2025 20:25:33 +0700 Subject: [PATCH 15/15] revert: drive abci changes --- .../create_genesis_state/test/tokens.rs | 179 +++++++++--------- packages/rs-drive-abci/src/query/service.rs | 18 +- 2 files changed, 91 insertions(+), 106 deletions(-) diff --git a/packages/rs-drive-abci/src/execution/platform_events/initialization/create_genesis_state/test/tokens.rs b/packages/rs-drive-abci/src/execution/platform_events/initialization/create_genesis_state/test/tokens.rs index f17c9a821da..a7ca5d32ffb 100644 --- a/packages/rs-drive-abci/src/execution/platform_events/initialization/create_genesis_state/test/tokens.rs +++ b/packages/rs-drive-abci/src/execution/platform_events/initialization/create_genesis_state/test/tokens.rs @@ -1,9 +1,12 @@ - use crate::error::Error; use crate::platform_types::platform::Platform; use dpp::block::block_info::BlockInfo; +use dpp::data_contract::associated_token::token_configuration::accessors::v0::TokenConfigurationV0Getters; use dpp::data_contract::associated_token::token_configuration::v0::TokenConfigurationV0; +use dpp::data_contract::associated_token::token_configuration_convention::accessors::v0::TokenConfigurationConventionV0Getters; use dpp::data_contract::associated_token::token_configuration_convention::v0::TokenConfigurationConventionV0; +use dpp::data_contract::associated_token::token_configuration_localization::v0::TokenConfigurationLocalizationV0; +use dpp::data_contract::associated_token::token_configuration_localization::TokenConfigurationLocalization; use dpp::data_contract::associated_token::token_distribution_rules::v0::TokenDistributionRulesV0; use dpp::data_contract::associated_token::token_keeps_history_rules::v0::TokenKeepsHistoryRulesV0; use dpp::data_contract::change_control_rules::authorized_action_takers::AuthorizedActionTakers; @@ -25,10 +28,6 @@ use dpp::tokens::calculate_token_id; use dpp::tokens::status::v0::TokenStatusV0; use dpp::tokens::status::TokenStatus; use dpp::tokens::token_event::TokenEvent; -use dpp::data_contract::associated_token::token_configuration::accessors::v0::TokenConfigurationV0Getters; -use dpp::data_contract::associated_token::token_configuration_convention::accessors::v0::TokenConfigurationConventionV0Getters; -use dpp::data_contract::associated_token::token_configuration_localization::v0::TokenConfigurationLocalizationV0; -use dpp::data_contract::associated_token::token_configuration_localization::TokenConfigurationLocalization; use dpp::tokens::token_pricing_schedule::TokenPricingSchedule; use dpp::version::PlatformVersion; use drive::grovedb::TransactionArg; @@ -54,59 +53,59 @@ static TOKEN_ID_2: LazyLock = impl Platform { /// This data is used for testing token and group queries in RS SDK tests. pub(super) fn create_data_for_group_token_queries( - &self, - block_info: &BlockInfo, - transaction: TransactionArg, - platform_version: &PlatformVersion, -) -> Result<(), Error> { - self.register_identities(block_info, transaction, platform_version)?; - - self.create_data_contract(block_info, transaction, platform_version)?; - - self.mint_tokens(block_info, transaction, platform_version)?; - - // Freeze tokens for identity 2 - self.drive.token_freeze( - *TOKEN_ID_0, - IDENTITY_ID_2, - block_info, - true, - transaction, - platform_version, - )?; - - // Pause token 2 - let status = TokenStatus::V0(TokenStatusV0 { paused: true }); - self.drive.token_apply_status( - TOKEN_ID_1.to_buffer(), - status, - block_info, - true, - transaction, - platform_version, - )?; - - // Add burn token group action - let action_id = Identifier::new([32; 32]); - let group_action = GroupAction::V0(GroupActionV0 { - event: GroupActionEvent::TokenEvent(TokenEvent::Burn(10, Some("world on fire".into()))), - }); - - self.drive.add_group_action( - DATA_CONTRACT_ID, - 2, - Some(group_action), - action_id, - IDENTITY_ID_1, - 1, - block_info, - true, - transaction, - platform_version, - )?; - - Ok(()) -} + &self, + block_info: &BlockInfo, + transaction: TransactionArg, + platform_version: &PlatformVersion, + ) -> Result<(), Error> { + self.register_identities(block_info, transaction, platform_version)?; + + self.create_data_contract(block_info, transaction, platform_version)?; + + self.mint_tokens(block_info, transaction, platform_version)?; + + // Freeze tokens for identity 2 + self.drive.token_freeze( + *TOKEN_ID_0, + IDENTITY_ID_2, + block_info, + true, + transaction, + platform_version, + )?; + + // Pause token 2 + let status = TokenStatus::V0(TokenStatusV0 { paused: true }); + self.drive.token_apply_status( + TOKEN_ID_1.to_buffer(), + status, + block_info, + true, + transaction, + platform_version, + )?; + + // Add burn token group action + let action_id = Identifier::new([32; 32]); + let group_action = GroupAction::V0(GroupActionV0 { + event: GroupActionEvent::TokenEvent(TokenEvent::Burn(10, Some("world on fire".into()))), + }); + + self.drive.add_group_action( + DATA_CONTRACT_ID, + 2, + Some(group_action), + action_id, + IDENTITY_ID_1, + 1, + block_info, + true, + transaction, + platform_version, + )?; + + Ok(()) + } /// Create some test data for token direct prices. /// @@ -115,38 +114,38 @@ impl Platform { /// /// Tokens must be already created. pub(crate) fn create_data_for_token_direct_prices( - &self, - block_info: &BlockInfo, - transaction: TransactionArg, - platform_version: &PlatformVersion, -) -> Result<(), Error> { - self.drive.token_set_direct_purchase_price( - TOKEN_ID_1.to_buffer(), - Some(TokenPricingSchedule::SinglePrice(25)), - block_info, - true, - transaction, - platform_version, - )?; - - let pricing = TokenPricingSchedule::SetPrices( - (0..=900) - .step_by(100) - .map(|amount| (amount, 1000 - amount)) - .collect(), - ); - - self.drive.token_set_direct_purchase_price( - TOKEN_ID_2.to_buffer(), - Some(pricing), - block_info, - true, - transaction, - platform_version, - )?; - - Ok(()) -} + &self, + block_info: &BlockInfo, + transaction: TransactionArg, + platform_version: &PlatformVersion, + ) -> Result<(), Error> { + self.drive.token_set_direct_purchase_price( + TOKEN_ID_1.to_buffer(), + Some(TokenPricingSchedule::SinglePrice(25)), + block_info, + true, + transaction, + platform_version, + )?; + + let pricing = TokenPricingSchedule::SetPrices( + (0..=900) + .step_by(100) + .map(|amount| (amount, 1000 - amount)) + .collect(), + ); + + self.drive.token_set_direct_purchase_price( + TOKEN_ID_2.to_buffer(), + Some(pricing), + block_info, + true, + transaction, + platform_version, + )?; + + Ok(()) + } fn register_identities( &self, diff --git a/packages/rs-drive-abci/src/query/service.rs b/packages/rs-drive-abci/src/query/service.rs index 03f27806cc3..3e6b2d876a2 100644 --- a/packages/rs-drive-abci/src/query/service.rs +++ b/packages/rs-drive-abci/src/query/service.rs @@ -40,7 +40,8 @@ use dapi_grpc::platform::v0::{ GetPrefundedSpecializedBalanceResponse, GetProtocolVersionUpgradeStateRequest, GetProtocolVersionUpgradeStateResponse, GetProtocolVersionUpgradeVoteStatusRequest, GetProtocolVersionUpgradeVoteStatusResponse, GetStatusRequest, GetStatusResponse, - GetTokenDirectPurchasePricesRequest, GetTokenDirectPurchasePricesResponse, GetTokenPreProgrammedDistributionsRequest, GetTokenPreProgrammedDistributionsResponse, + GetTokenDirectPurchasePricesRequest, GetTokenDirectPurchasePricesResponse, + GetTokenPreProgrammedDistributionsRequest, GetTokenPreProgrammedDistributionsResponse, GetTokenStatusesRequest, GetTokenStatusesResponse, GetTokenTotalSupplyRequest, GetTokenTotalSupplyResponse, GetTotalCreditsInPlatformRequest, GetTotalCreditsInPlatformResponse, GetVotePollsByEndDateRequest, GetVotePollsByEndDateResponse, @@ -780,21 +781,6 @@ impl DriveInternal for QueryService { } } -#[async_trait] -impl DriveInternal for QueryService { - async fn get_proofs( - &self, - request: Request, - ) -> Result, Status> { - self.handle_blocking_query( - request, - Platform::::query_proofs, - "get_proofs", - ) - .await - } -} - fn query_error_into_status(error: QueryError) -> Status { match error { QueryError::NotFound(message) => Status::not_found(message),