diff --git a/.github/grpc-queries-cache.json b/.github/grpc-queries-cache.json index e64b0a92cf1..a085a013bc7 100644 --- a/.github/grpc-queries-cache.json +++ b/.github/grpc-queries-cache.json @@ -191,6 +191,9 @@ }, "getShieldedNotesCount": { "status": "implemented" + }, + "subscribeToStateTransitions": { + "status": "implemented" } } } diff --git a/Cargo.lock b/Cargo.lock index 84af3bdb6e2..3694027cb65 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6598,6 +6598,7 @@ dependencies = [ "ciborium", "clap", "dapi-grpc", + "dash-platform-queries", "dash-spv", "dashcore-rpc", "dotenvy", diff --git a/packages/dapi-grpc/Cargo.toml b/packages/dapi-grpc/Cargo.toml index 17d932096c9..5f47c3e8193 100644 --- a/packages/dapi-grpc/Cargo.toml +++ b/packages/dapi-grpc/Cargo.toml @@ -53,13 +53,14 @@ server = [ "tonic/router", ] -serde = ["dep:serde", "dep:serde_bytes", "tenderdash-proto/serde"] +serde = ["dep:serde", "dep:serde_bytes", "tenderdash-proto/serde", "bytes/serde"] mocks = ["serde", "dep:serde_json"] [dependencies] tenderdash-proto = { git = "https://github.com/dashpay/rs-tenderdash-abci", tag = "v1.8.0", default-features = false } prost = { version = "0.14" } +bytes = "1" futures-core = "0.3.30" serde = { version = "1.0.219", optional = true, features = ["derive"] } serde_bytes = { version = "0.11.12", optional = true } diff --git a/packages/dapi-grpc/build.rs b/packages/dapi-grpc/build.rs index 60d4ba62665..de337fb745d 100644 --- a/packages/dapi-grpc/build.rs +++ b/packages/dapi-grpc/build.rs @@ -111,7 +111,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; 69] = [ + const VERSIONED_REQUESTS: [&str; 70] = [ "GetContractModerationStatusRequest", "GetContractModerationEntriesRequest", "GetContractDocumentRemovalsRequest", @@ -181,6 +181,7 @@ fn configure_platform(mut platform: MappingConfig) -> MappingConfig { "GetShieldedPoolStateRequest", "GetShieldedNotesCountRequest", "GetShieldedNullifiersRequest", + "SubscribeToStateTransitionsRequest", ]; const PROOF_ONLY_VERSIONED_REQUESTS: [&str; 1] = ["GetAddressesTrunkStateRequest"]; @@ -401,6 +402,9 @@ fn configure_platform(mut platform: MappingConfig) -> MappingConfig { .field_attribute("ResponseMetadata.height", SERDE_WITH_STRING) .field_attribute("ResponseMetadata.time_ms", SERDE_WITH_STRING) .field_attribute("start_at_ms", SERDE_WITH_STRING) + .field_attribute("StateTransitionMatch.block_height", SERDE_WITH_STRING) + .field_attribute("StateTransitionMatch.block_time_ms", SERDE_WITH_STRING) + .field_attribute("Checkpoint.block_height", SERDE_WITH_STRING) .field_attribute("public_key_hash", SERDE_WITH_BYTES) .field_attribute("public_key_hashes", SERDE_WITH_BASE64) .field_attribute("nullifiers", SERDE_WITH_BASE64) @@ -415,7 +419,9 @@ fn configure_platform(mut platform: MappingConfig) -> MappingConfig { .field_attribute("Proof.grovedb_proof", SERDE_WITH_BYTES) .field_attribute("Proof.quorum_hash", SERDE_WITH_BYTES) .field_attribute("Proof.signature", SERDE_WITH_BYTES) - .field_attribute("Proof.block_id_hash", SERDE_WITH_BYTES); + .field_attribute("Proof.block_id_hash", SERDE_WITH_BYTES) + // A shared buffer, so DAPI sends one block's transaction to every subscriber uncopied. + .bytes(".org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch.state_transition"); #[allow(clippy::let_and_return)] platform @@ -579,6 +585,12 @@ impl MappingConfig { self } + #[allow(unused)] + fn bytes(mut self, path: &str) -> Self { + self.builder = self.builder.bytes(path); + self + } + #[allow(unused)] fn message_attribute(mut self, path: &str, attribute: &str) -> Self { self.builder = self.builder.message_attribute(path, attribute); diff --git a/packages/dapi-grpc/clients/drive/v0/nodejs/drive_pbjs.js b/packages/dapi-grpc/clients/drive/v0/nodejs/drive_pbjs.js index 4f85b3d1350..6d02c1aed00 100644 --- a/packages/dapi-grpc/clients/drive/v0/nodejs/drive_pbjs.js +++ b/packages/dapi-grpc/clients/drive/v0/nodejs/drive_pbjs.js @@ -3003,6 +3003,39 @@ $root.org = (function() { * @variation 2 */ + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#subscribeToStateTransitions}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef subscribeToStateTransitionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse} [response] SubscribeToStateTransitionsResponse + */ + + /** + * Calls subscribeToStateTransitions. + * @function subscribeToStateTransitions + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.ISubscribeToStateTransitionsRequest} request SubscribeToStateTransitionsRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.subscribeToStateTransitionsCallback} callback Node-style callback called with the error, if any, and SubscribeToStateTransitionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.subscribeToStateTransitions = function subscribeToStateTransitions(request, callback) { + return this.rpcCall(subscribeToStateTransitions, $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest, $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse, request, callback); + }, "name", { value: "subscribeToStateTransitions" }); + + /** + * Calls subscribeToStateTransitions. + * @function subscribeToStateTransitions + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.ISubscribeToStateTransitionsRequest} request SubscribeToStateTransitionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + return Platform; })(); @@ -122929,6 +122962,3029 @@ $root.org = (function() { return GetShieldedNullifiersResponse; })(); + v0.SubscribeToStateTransitionsRequest = (function() { + + /** + * Properties of a SubscribeToStateTransitionsRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface ISubscribeToStateTransitionsRequest + * @property {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.ISubscribeToStateTransitionsRequestV0|null} [v0] SubscribeToStateTransitionsRequest v0 + */ + + /** + * Constructs a new SubscribeToStateTransitionsRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a SubscribeToStateTransitionsRequest. + * @implements ISubscribeToStateTransitionsRequest + * @constructor + * @param {org.dash.platform.dapi.v0.ISubscribeToStateTransitionsRequest=} [properties] Properties to set + */ + function SubscribeToStateTransitionsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SubscribeToStateTransitionsRequest v0. + * @member {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.ISubscribeToStateTransitionsRequestV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest + * @instance + */ + SubscribeToStateTransitionsRequest.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SubscribeToStateTransitionsRequest version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest + * @instance + */ + Object.defineProperty(SubscribeToStateTransitionsRequest.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SubscribeToStateTransitionsRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest + * @static + * @param {org.dash.platform.dapi.v0.ISubscribeToStateTransitionsRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest} SubscribeToStateTransitionsRequest instance + */ + SubscribeToStateTransitionsRequest.create = function create(properties) { + return new SubscribeToStateTransitionsRequest(properties); + }; + + /** + * Encodes the specified SubscribeToStateTransitionsRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest + * @static + * @param {org.dash.platform.dapi.v0.ISubscribeToStateTransitionsRequest} message SubscribeToStateTransitionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SubscribeToStateTransitionsRequest.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.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SubscribeToStateTransitionsRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest + * @static + * @param {org.dash.platform.dapi.v0.ISubscribeToStateTransitionsRequest} message SubscribeToStateTransitionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SubscribeToStateTransitionsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SubscribeToStateTransitionsRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest} SubscribeToStateTransitionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SubscribeToStateTransitionsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SubscribeToStateTransitionsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest} SubscribeToStateTransitionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SubscribeToStateTransitionsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SubscribeToStateTransitionsRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SubscribeToStateTransitionsRequest.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.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a SubscribeToStateTransitionsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest} SubscribeToStateTransitionsRequest + */ + SubscribeToStateTransitionsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a SubscribeToStateTransitionsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest + * @static + * @param {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest} message SubscribeToStateTransitionsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SubscribeToStateTransitionsRequest.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.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this SubscribeToStateTransitionsRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest + * @instance + * @returns {Object.} JSON object + */ + SubscribeToStateTransitionsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Role enum. + * @name org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.Role + * @enum {number} + * @property {number} ANY=0 ANY value + * @property {number} SENDER=1 SENDER value + * @property {number} RECIPIENT=2 RECIPIENT value + */ + SubscribeToStateTransitionsRequest.Role = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ANY"] = 0; + values[valuesById[1] = "SENDER"] = 1; + values[valuesById[2] = "RECIPIENT"] = 2; + return values; + })(); + + SubscribeToStateTransitionsRequest.DocumentFilter = (function() { + + /** + * Properties of a DocumentFilter. + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest + * @interface IDocumentFilter + * @property {Uint8Array|null} [dataContractId] DocumentFilter dataContractId + * @property {string|null} [documentTypeName] DocumentFilter documentTypeName + * @property {Array.|null} [actions] DocumentFilter actions + * @property {Uint8Array|null} [batchOwnerId] DocumentFilter batchOwnerId + */ + + /** + * Constructs a new DocumentFilter. + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest + * @classdesc Represents a DocumentFilter. + * @implements IDocumentFilter + * @constructor + * @param {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.IDocumentFilter=} [properties] Properties to set + */ + function DocumentFilter(properties) { + this.actions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DocumentFilter dataContractId. + * @member {Uint8Array} dataContractId + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter + * @instance + */ + DocumentFilter.prototype.dataContractId = $util.newBuffer([]); + + /** + * DocumentFilter documentTypeName. + * @member {string} documentTypeName + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter + * @instance + */ + DocumentFilter.prototype.documentTypeName = ""; + + /** + * DocumentFilter actions. + * @member {Array.} actions + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter + * @instance + */ + DocumentFilter.prototype.actions = $util.emptyArray; + + /** + * DocumentFilter batchOwnerId. + * @member {Uint8Array} batchOwnerId + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter + * @instance + */ + DocumentFilter.prototype.batchOwnerId = $util.newBuffer([]); + + /** + * Creates a new DocumentFilter instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter + * @static + * @param {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.IDocumentFilter=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter} DocumentFilter instance + */ + DocumentFilter.create = function create(properties) { + return new DocumentFilter(properties); + }; + + /** + * Encodes the specified DocumentFilter message. Does not implicitly {@link org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter + * @static + * @param {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.IDocumentFilter} message DocumentFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DocumentFilter.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.documentTypeName != null && Object.hasOwnProperty.call(message, "documentTypeName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.documentTypeName); + if (message.actions != null && message.actions.length) + for (var i = 0; i < message.actions.length; ++i) + $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch.encode(message.actions[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.batchOwnerId != null && Object.hasOwnProperty.call(message, "batchOwnerId")) + writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.batchOwnerId); + return writer; + }; + + /** + * Encodes the specified DocumentFilter message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter + * @static + * @param {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.IDocumentFilter} message DocumentFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DocumentFilter.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DocumentFilter message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter} DocumentFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DocumentFilter.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.dataContractId = reader.bytes(); + break; + case 2: + message.documentTypeName = reader.string(); + break; + case 3: + if (!(message.actions && message.actions.length)) + message.actions = []; + message.actions.push($root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch.decode(reader, reader.uint32())); + break; + case 4: + message.batchOwnerId = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DocumentFilter message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter} DocumentFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DocumentFilter.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DocumentFilter message. + * @function verify + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DocumentFilter.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + 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.documentTypeName != null && message.hasOwnProperty("documentTypeName")) + if (!$util.isString(message.documentTypeName)) + return "documentTypeName: string expected"; + if (message.actions != null && message.hasOwnProperty("actions")) { + if (!Array.isArray(message.actions)) + return "actions: array expected"; + for (var i = 0; i < message.actions.length; ++i) { + var error = $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch.verify(message.actions[i]); + if (error) + return "actions." + error; + } + } + if (message.batchOwnerId != null && message.hasOwnProperty("batchOwnerId")) + if (!(message.batchOwnerId && typeof message.batchOwnerId.length === "number" || $util.isString(message.batchOwnerId))) + return "batchOwnerId: buffer expected"; + return null; + }; + + /** + * Creates a DocumentFilter message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter} DocumentFilter + */ + DocumentFilter.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter) + return object; + var message = new $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter(); + 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.documentTypeName != null) + message.documentTypeName = String(object.documentTypeName); + if (object.actions) { + if (!Array.isArray(object.actions)) + throw TypeError(".org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.actions: array expected"); + message.actions = []; + for (var i = 0; i < object.actions.length; ++i) { + if (typeof object.actions[i] !== "object") + throw TypeError(".org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.actions: object expected"); + message.actions[i] = $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch.fromObject(object.actions[i]); + } + } + if (object.batchOwnerId != null) + if (typeof object.batchOwnerId === "string") + $util.base64.decode(object.batchOwnerId, message.batchOwnerId = $util.newBuffer($util.base64.length(object.batchOwnerId)), 0); + else if (object.batchOwnerId.length >= 0) + message.batchOwnerId = object.batchOwnerId; + return message; + }; + + /** + * Creates a plain object from a DocumentFilter message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter + * @static + * @param {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter} message DocumentFilter + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DocumentFilter.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.actions = []; + if (options.defaults) { + if (options.bytes === String) + object.dataContractId = ""; + else { + object.dataContractId = []; + if (options.bytes !== Array) + object.dataContractId = $util.newBuffer(object.dataContractId); + } + object.documentTypeName = ""; + if (options.bytes === String) + object.batchOwnerId = ""; + else { + object.batchOwnerId = []; + if (options.bytes !== Array) + object.batchOwnerId = $util.newBuffer(object.batchOwnerId); + } + } + 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.documentTypeName != null && message.hasOwnProperty("documentTypeName")) + object.documentTypeName = message.documentTypeName; + if (message.actions && message.actions.length) { + object.actions = []; + for (var j = 0; j < message.actions.length; ++j) + object.actions[j] = $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch.toObject(message.actions[j], options); + } + if (message.batchOwnerId != null && message.hasOwnProperty("batchOwnerId")) + object.batchOwnerId = options.bytes === String ? $util.base64.encode(message.batchOwnerId, 0, message.batchOwnerId.length) : options.bytes === Array ? Array.prototype.slice.call(message.batchOwnerId) : message.batchOwnerId; + return object; + }; + + /** + * Converts this DocumentFilter to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter + * @instance + * @returns {Object.} JSON object + */ + DocumentFilter.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Action enum. + * @name org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.Action + * @enum {number} + * @property {number} CREATE=0 CREATE value + * @property {number} REPLACE=1 REPLACE value + * @property {number} DELETE=2 DELETE value + * @property {number} TRANSFER=3 TRANSFER value + * @property {number} UPDATE_PRICE=4 UPDATE_PRICE value + * @property {number} PURCHASE=5 PURCHASE value + */ + DocumentFilter.Action = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CREATE"] = 0; + values[valuesById[1] = "REPLACE"] = 1; + values[valuesById[2] = "DELETE"] = 2; + values[valuesById[3] = "TRANSFER"] = 3; + values[valuesById[4] = "UPDATE_PRICE"] = 4; + values[valuesById[5] = "PURCHASE"] = 5; + return values; + })(); + + DocumentFilter.PriceClause = (function() { + + /** + * Properties of a PriceClause. + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter + * @interface IPriceClause + * @property {org.dash.platform.dapi.v0.GetDocumentsRequest.WhereOperator|null} [operator] PriceClause operator + * @property {org.dash.platform.dapi.v0.GetDocumentsRequest.IDocumentFieldValue|null} [value] PriceClause value + */ + + /** + * Constructs a new PriceClause. + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter + * @classdesc Represents a PriceClause. + * @implements IPriceClause + * @constructor + * @param {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.IPriceClause=} [properties] Properties to set + */ + function PriceClause(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PriceClause operator. + * @member {org.dash.platform.dapi.v0.GetDocumentsRequest.WhereOperator} operator + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.PriceClause + * @instance + */ + PriceClause.prototype.operator = 0; + + /** + * PriceClause value. + * @member {org.dash.platform.dapi.v0.GetDocumentsRequest.IDocumentFieldValue|null|undefined} value + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.PriceClause + * @instance + */ + PriceClause.prototype.value = null; + + /** + * Creates a new PriceClause instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.PriceClause + * @static + * @param {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.IPriceClause=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.PriceClause} PriceClause instance + */ + PriceClause.create = function create(properties) { + return new PriceClause(properties); + }; + + /** + * Encodes the specified PriceClause message. Does not implicitly {@link org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.PriceClause.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.PriceClause + * @static + * @param {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.IPriceClause} message PriceClause message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PriceClause.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.operator != null && Object.hasOwnProperty.call(message, "operator")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.operator); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + $root.org.dash.platform.dapi.v0.GetDocumentsRequest.DocumentFieldValue.encode(message.value, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PriceClause message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.PriceClause.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.PriceClause + * @static + * @param {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.IPriceClause} message PriceClause message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PriceClause.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PriceClause message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.PriceClause + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.PriceClause} PriceClause + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PriceClause.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.PriceClause(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.operator = reader.int32(); + break; + case 2: + message.value = $root.org.dash.platform.dapi.v0.GetDocumentsRequest.DocumentFieldValue.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PriceClause message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.PriceClause + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.PriceClause} PriceClause + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PriceClause.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PriceClause message. + * @function verify + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.PriceClause + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PriceClause.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.operator != null && message.hasOwnProperty("operator")) + switch (message.operator) { + default: + return "operator: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + break; + } + if (message.value != null && message.hasOwnProperty("value")) { + var error = $root.org.dash.platform.dapi.v0.GetDocumentsRequest.DocumentFieldValue.verify(message.value); + if (error) + return "value." + error; + } + return null; + }; + + /** + * Creates a PriceClause message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.PriceClause + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.PriceClause} PriceClause + */ + PriceClause.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.PriceClause) + return object; + var message = new $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.PriceClause(); + switch (object.operator) { + case "EQUAL": + case 0: + message.operator = 0; + break; + case "GREATER_THAN": + case 1: + message.operator = 1; + break; + case "GREATER_THAN_OR_EQUALS": + case 2: + message.operator = 2; + break; + case "LESS_THAN": + case 3: + message.operator = 3; + break; + case "LESS_THAN_OR_EQUALS": + case 4: + message.operator = 4; + break; + case "BETWEEN": + case 5: + message.operator = 5; + break; + case "BETWEEN_EXCLUDE_BOUNDS": + case 6: + message.operator = 6; + break; + case "BETWEEN_EXCLUDE_LEFT": + case 7: + message.operator = 7; + break; + case "BETWEEN_EXCLUDE_RIGHT": + case 8: + message.operator = 8; + break; + case "IN": + case 9: + message.operator = 9; + break; + case "STARTS_WITH": + case 10: + message.operator = 10; + break; + case "IN_TIME_RANGE": + case 11: + message.operator = 11; + break; + case "IN_INTEGER_RANGE": + case 12: + message.operator = 12; + break; + case "CONTAINS": + case 13: + message.operator = 13; + break; + case "CONTAINS_ANY": + case 14: + message.operator = 14; + break; + } + if (object.value != null) { + if (typeof object.value !== "object") + throw TypeError(".org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.PriceClause.value: object expected"); + message.value = $root.org.dash.platform.dapi.v0.GetDocumentsRequest.DocumentFieldValue.fromObject(object.value); + } + return message; + }; + + /** + * Creates a plain object from a PriceClause message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.PriceClause + * @static + * @param {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.PriceClause} message PriceClause + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PriceClause.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.operator = options.enums === String ? "EQUAL" : 0; + object.value = null; + } + if (message.operator != null && message.hasOwnProperty("operator")) + object.operator = options.enums === String ? $root.org.dash.platform.dapi.v0.GetDocumentsRequest.WhereOperator[message.operator] : message.operator; + if (message.value != null && message.hasOwnProperty("value")) + object.value = $root.org.dash.platform.dapi.v0.GetDocumentsRequest.DocumentFieldValue.toObject(message.value, options); + return object; + }; + + /** + * Converts this PriceClause to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.PriceClause + * @instance + * @returns {Object.} JSON object + */ + PriceClause.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PriceClause; + })(); + + DocumentFilter.ActionMatch = (function() { + + /** + * Properties of an ActionMatch. + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter + * @interface IActionMatch + * @property {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.Action|null} [action] ActionMatch action + * @property {Array.|null} [newDocumentWhere] ActionMatch newDocumentWhere + * @property {Array.|null} [originalDocumentWhere] ActionMatch originalDocumentWhere + * @property {Array.|null} [ownerIds] ActionMatch ownerIds + * @property {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.IPriceClause|null} [price] ActionMatch price + */ + + /** + * Constructs a new ActionMatch. + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter + * @classdesc Represents an ActionMatch. + * @implements IActionMatch + * @constructor + * @param {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.IActionMatch=} [properties] Properties to set + */ + function ActionMatch(properties) { + this.newDocumentWhere = []; + this.originalDocumentWhere = []; + this.ownerIds = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ActionMatch action. + * @member {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.Action} action + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch + * @instance + */ + ActionMatch.prototype.action = 0; + + /** + * ActionMatch newDocumentWhere. + * @member {Array.} newDocumentWhere + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch + * @instance + */ + ActionMatch.prototype.newDocumentWhere = $util.emptyArray; + + /** + * ActionMatch originalDocumentWhere. + * @member {Array.} originalDocumentWhere + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch + * @instance + */ + ActionMatch.prototype.originalDocumentWhere = $util.emptyArray; + + /** + * ActionMatch ownerIds. + * @member {Array.} ownerIds + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch + * @instance + */ + ActionMatch.prototype.ownerIds = $util.emptyArray; + + /** + * ActionMatch price. + * @member {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.IPriceClause|null|undefined} price + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch + * @instance + */ + ActionMatch.prototype.price = null; + + /** + * Creates a new ActionMatch instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch + * @static + * @param {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.IActionMatch=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch} ActionMatch instance + */ + ActionMatch.create = function create(properties) { + return new ActionMatch(properties); + }; + + /** + * Encodes the specified ActionMatch message. Does not implicitly {@link org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch + * @static + * @param {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.IActionMatch} message ActionMatch message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ActionMatch.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.action != null && Object.hasOwnProperty.call(message, "action")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.action); + if (message.newDocumentWhere != null && message.newDocumentWhere.length) + for (var i = 0; i < message.newDocumentWhere.length; ++i) + $root.org.dash.platform.dapi.v0.GetDocumentsRequest.WhereClause.encode(message.newDocumentWhere[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.originalDocumentWhere != null && message.originalDocumentWhere.length) + for (var i = 0; i < message.originalDocumentWhere.length; ++i) + $root.org.dash.platform.dapi.v0.GetDocumentsRequest.WhereClause.encode(message.originalDocumentWhere[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.ownerIds != null && message.ownerIds.length) + for (var i = 0; i < message.ownerIds.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.ownerIds[i]); + if (message.price != null && Object.hasOwnProperty.call(message, "price")) + $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.PriceClause.encode(message.price, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ActionMatch message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch + * @static + * @param {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.IActionMatch} message ActionMatch message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ActionMatch.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ActionMatch message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch} ActionMatch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ActionMatch.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.action = reader.int32(); + break; + case 2: + if (!(message.newDocumentWhere && message.newDocumentWhere.length)) + message.newDocumentWhere = []; + message.newDocumentWhere.push($root.org.dash.platform.dapi.v0.GetDocumentsRequest.WhereClause.decode(reader, reader.uint32())); + break; + case 3: + if (!(message.originalDocumentWhere && message.originalDocumentWhere.length)) + message.originalDocumentWhere = []; + message.originalDocumentWhere.push($root.org.dash.platform.dapi.v0.GetDocumentsRequest.WhereClause.decode(reader, reader.uint32())); + break; + case 4: + if (!(message.ownerIds && message.ownerIds.length)) + message.ownerIds = []; + message.ownerIds.push(reader.bytes()); + break; + case 5: + message.price = $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.PriceClause.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ActionMatch message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch} ActionMatch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ActionMatch.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ActionMatch message. + * @function verify + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ActionMatch.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.action != null && message.hasOwnProperty("action")) + switch (message.action) { + default: + return "action: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.newDocumentWhere != null && message.hasOwnProperty("newDocumentWhere")) { + if (!Array.isArray(message.newDocumentWhere)) + return "newDocumentWhere: array expected"; + for (var i = 0; i < message.newDocumentWhere.length; ++i) { + var error = $root.org.dash.platform.dapi.v0.GetDocumentsRequest.WhereClause.verify(message.newDocumentWhere[i]); + if (error) + return "newDocumentWhere." + error; + } + } + if (message.originalDocumentWhere != null && message.hasOwnProperty("originalDocumentWhere")) { + if (!Array.isArray(message.originalDocumentWhere)) + return "originalDocumentWhere: array expected"; + for (var i = 0; i < message.originalDocumentWhere.length; ++i) { + var error = $root.org.dash.platform.dapi.v0.GetDocumentsRequest.WhereClause.verify(message.originalDocumentWhere[i]); + if (error) + return "originalDocumentWhere." + error; + } + } + if (message.ownerIds != null && message.hasOwnProperty("ownerIds")) { + if (!Array.isArray(message.ownerIds)) + return "ownerIds: array expected"; + for (var i = 0; i < message.ownerIds.length; ++i) + if (!(message.ownerIds[i] && typeof message.ownerIds[i].length === "number" || $util.isString(message.ownerIds[i]))) + return "ownerIds: buffer[] expected"; + } + if (message.price != null && message.hasOwnProperty("price")) { + var error = $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.PriceClause.verify(message.price); + if (error) + return "price." + error; + } + return null; + }; + + /** + * Creates an ActionMatch message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch} ActionMatch + */ + ActionMatch.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch) + return object; + var message = new $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch(); + switch (object.action) { + case "CREATE": + case 0: + message.action = 0; + break; + case "REPLACE": + case 1: + message.action = 1; + break; + case "DELETE": + case 2: + message.action = 2; + break; + case "TRANSFER": + case 3: + message.action = 3; + break; + case "UPDATE_PRICE": + case 4: + message.action = 4; + break; + case "PURCHASE": + case 5: + message.action = 5; + break; + } + if (object.newDocumentWhere) { + if (!Array.isArray(object.newDocumentWhere)) + throw TypeError(".org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch.newDocumentWhere: array expected"); + message.newDocumentWhere = []; + for (var i = 0; i < object.newDocumentWhere.length; ++i) { + if (typeof object.newDocumentWhere[i] !== "object") + throw TypeError(".org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch.newDocumentWhere: object expected"); + message.newDocumentWhere[i] = $root.org.dash.platform.dapi.v0.GetDocumentsRequest.WhereClause.fromObject(object.newDocumentWhere[i]); + } + } + if (object.originalDocumentWhere) { + if (!Array.isArray(object.originalDocumentWhere)) + throw TypeError(".org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch.originalDocumentWhere: array expected"); + message.originalDocumentWhere = []; + for (var i = 0; i < object.originalDocumentWhere.length; ++i) { + if (typeof object.originalDocumentWhere[i] !== "object") + throw TypeError(".org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch.originalDocumentWhere: object expected"); + message.originalDocumentWhere[i] = $root.org.dash.platform.dapi.v0.GetDocumentsRequest.WhereClause.fromObject(object.originalDocumentWhere[i]); + } + } + if (object.ownerIds) { + if (!Array.isArray(object.ownerIds)) + throw TypeError(".org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch.ownerIds: array expected"); + message.ownerIds = []; + for (var i = 0; i < object.ownerIds.length; ++i) + if (typeof object.ownerIds[i] === "string") + $util.base64.decode(object.ownerIds[i], message.ownerIds[i] = $util.newBuffer($util.base64.length(object.ownerIds[i])), 0); + else if (object.ownerIds[i].length >= 0) + message.ownerIds[i] = object.ownerIds[i]; + } + if (object.price != null) { + if (typeof object.price !== "object") + throw TypeError(".org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch.price: object expected"); + message.price = $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.PriceClause.fromObject(object.price); + } + return message; + }; + + /** + * Creates a plain object from an ActionMatch message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch + * @static + * @param {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch} message ActionMatch + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ActionMatch.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.newDocumentWhere = []; + object.originalDocumentWhere = []; + object.ownerIds = []; + } + if (options.defaults) { + object.action = options.enums === String ? "CREATE" : 0; + object.price = null; + } + if (message.action != null && message.hasOwnProperty("action")) + object.action = options.enums === String ? $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.Action[message.action] : message.action; + if (message.newDocumentWhere && message.newDocumentWhere.length) { + object.newDocumentWhere = []; + for (var j = 0; j < message.newDocumentWhere.length; ++j) + object.newDocumentWhere[j] = $root.org.dash.platform.dapi.v0.GetDocumentsRequest.WhereClause.toObject(message.newDocumentWhere[j], options); + } + if (message.originalDocumentWhere && message.originalDocumentWhere.length) { + object.originalDocumentWhere = []; + for (var j = 0; j < message.originalDocumentWhere.length; ++j) + object.originalDocumentWhere[j] = $root.org.dash.platform.dapi.v0.GetDocumentsRequest.WhereClause.toObject(message.originalDocumentWhere[j], options); + } + if (message.ownerIds && message.ownerIds.length) { + object.ownerIds = []; + for (var j = 0; j < message.ownerIds.length; ++j) + object.ownerIds[j] = options.bytes === String ? $util.base64.encode(message.ownerIds[j], 0, message.ownerIds[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.ownerIds[j]) : message.ownerIds[j]; + } + if (message.price != null && message.hasOwnProperty("price")) + object.price = $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.PriceClause.toObject(message.price, options); + return object; + }; + + /** + * Converts this ActionMatch to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch + * @instance + * @returns {Object.} JSON object + */ + ActionMatch.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ActionMatch; + })(); + + return DocumentFilter; + })(); + + SubscribeToStateTransitionsRequest.AddressFilter = (function() { + + /** + * Properties of an AddressFilter. + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest + * @interface IAddressFilter + * @property {Array.|null} [addresses] AddressFilter addresses + * @property {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.Role|null} [role] AddressFilter role + */ + + /** + * Constructs a new AddressFilter. + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest + * @classdesc Represents an AddressFilter. + * @implements IAddressFilter + * @constructor + * @param {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.IAddressFilter=} [properties] Properties to set + */ + function AddressFilter(properties) { + this.addresses = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AddressFilter addresses. + * @member {Array.} addresses + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.AddressFilter + * @instance + */ + AddressFilter.prototype.addresses = $util.emptyArray; + + /** + * AddressFilter role. + * @member {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.Role} role + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.AddressFilter + * @instance + */ + AddressFilter.prototype.role = 0; + + /** + * Creates a new AddressFilter instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.AddressFilter + * @static + * @param {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.IAddressFilter=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.AddressFilter} AddressFilter instance + */ + AddressFilter.create = function create(properties) { + return new AddressFilter(properties); + }; + + /** + * Encodes the specified AddressFilter message. Does not implicitly {@link org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.AddressFilter.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.AddressFilter + * @static + * @param {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.IAddressFilter} message AddressFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AddressFilter.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.addresses != null && message.addresses.length) + for (var i = 0; i < message.addresses.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.addresses[i]); + if (message.role != null && Object.hasOwnProperty.call(message, "role")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.role); + return writer; + }; + + /** + * Encodes the specified AddressFilter message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.AddressFilter.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.AddressFilter + * @static + * @param {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.IAddressFilter} message AddressFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AddressFilter.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AddressFilter message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.AddressFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.AddressFilter} AddressFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AddressFilter.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.AddressFilter(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.addresses && message.addresses.length)) + message.addresses = []; + message.addresses.push(reader.bytes()); + break; + case 2: + message.role = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AddressFilter message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.AddressFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.AddressFilter} AddressFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AddressFilter.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AddressFilter message. + * @function verify + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.AddressFilter + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AddressFilter.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.addresses != null && message.hasOwnProperty("addresses")) { + if (!Array.isArray(message.addresses)) + return "addresses: array expected"; + for (var i = 0; i < message.addresses.length; ++i) + if (!(message.addresses[i] && typeof message.addresses[i].length === "number" || $util.isString(message.addresses[i]))) + return "addresses: buffer[] expected"; + } + if (message.role != null && message.hasOwnProperty("role")) + switch (message.role) { + default: + return "role: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates an AddressFilter message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.AddressFilter + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.AddressFilter} AddressFilter + */ + AddressFilter.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.AddressFilter) + return object; + var message = new $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.AddressFilter(); + if (object.addresses) { + if (!Array.isArray(object.addresses)) + throw TypeError(".org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.AddressFilter.addresses: array expected"); + message.addresses = []; + for (var i = 0; i < object.addresses.length; ++i) + if (typeof object.addresses[i] === "string") + $util.base64.decode(object.addresses[i], message.addresses[i] = $util.newBuffer($util.base64.length(object.addresses[i])), 0); + else if (object.addresses[i].length >= 0) + message.addresses[i] = object.addresses[i]; + } + switch (object.role) { + case "ANY": + case 0: + message.role = 0; + break; + case "SENDER": + case 1: + message.role = 1; + break; + case "RECIPIENT": + case 2: + message.role = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an AddressFilter message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.AddressFilter + * @static + * @param {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.AddressFilter} message AddressFilter + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AddressFilter.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.addresses = []; + if (options.defaults) + object.role = options.enums === String ? "ANY" : 0; + if (message.addresses && message.addresses.length) { + object.addresses = []; + for (var j = 0; j < message.addresses.length; ++j) + object.addresses[j] = options.bytes === String ? $util.base64.encode(message.addresses[j], 0, message.addresses[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.addresses[j]) : message.addresses[j]; + } + if (message.role != null && message.hasOwnProperty("role")) + object.role = options.enums === String ? $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.Role[message.role] : message.role; + return object; + }; + + /** + * Converts this AddressFilter to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.AddressFilter + * @instance + * @returns {Object.} JSON object + */ + AddressFilter.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AddressFilter; + })(); + + SubscribeToStateTransitionsRequest.StateTransitionFilter = (function() { + + /** + * Properties of a StateTransitionFilter. + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest + * @interface IStateTransitionFilter + * @property {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.IDocumentFilter|null} [documents] StateTransitionFilter documents + * @property {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.IAddressFilter|null} [addresses] StateTransitionFilter addresses + */ + + /** + * Constructs a new StateTransitionFilter. + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest + * @classdesc Represents a StateTransitionFilter. + * @implements IStateTransitionFilter + * @constructor + * @param {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.IStateTransitionFilter=} [properties] Properties to set + */ + function StateTransitionFilter(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StateTransitionFilter documents. + * @member {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.IDocumentFilter|null|undefined} documents + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter + * @instance + */ + StateTransitionFilter.prototype.documents = null; + + /** + * StateTransitionFilter addresses. + * @member {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.IAddressFilter|null|undefined} addresses + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter + * @instance + */ + StateTransitionFilter.prototype.addresses = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * StateTransitionFilter filter. + * @member {"documents"|"addresses"|undefined} filter + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter + * @instance + */ + Object.defineProperty(StateTransitionFilter.prototype, "filter", { + get: $util.oneOfGetter($oneOfFields = ["documents", "addresses"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new StateTransitionFilter instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter + * @static + * @param {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.IStateTransitionFilter=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter} StateTransitionFilter instance + */ + StateTransitionFilter.create = function create(properties) { + return new StateTransitionFilter(properties); + }; + + /** + * Encodes the specified StateTransitionFilter message. Does not implicitly {@link org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter + * @static + * @param {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.IStateTransitionFilter} message StateTransitionFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StateTransitionFilter.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.SubscribeToStateTransitionsRequest.DocumentFilter.encode(message.documents, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.addresses != null && Object.hasOwnProperty.call(message, "addresses")) + $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.AddressFilter.encode(message.addresses, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified StateTransitionFilter message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter + * @static + * @param {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.IStateTransitionFilter} message StateTransitionFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StateTransitionFilter.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StateTransitionFilter message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter} StateTransitionFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StateTransitionFilter.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.documents = $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.decode(reader, reader.uint32()); + break; + case 2: + message.addresses = $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.AddressFilter.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StateTransitionFilter message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter} StateTransitionFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StateTransitionFilter.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StateTransitionFilter message. + * @function verify + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StateTransitionFilter.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.documents != null && message.hasOwnProperty("documents")) { + properties.filter = 1; + { + var error = $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.verify(message.documents); + if (error) + return "documents." + error; + } + } + if (message.addresses != null && message.hasOwnProperty("addresses")) { + if (properties.filter === 1) + return "filter: multiple values"; + properties.filter = 1; + { + var error = $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.AddressFilter.verify(message.addresses); + if (error) + return "addresses." + error; + } + } + return null; + }; + + /** + * Creates a StateTransitionFilter message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter} StateTransitionFilter + */ + StateTransitionFilter.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter) + return object; + var message = new $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter(); + if (object.documents != null) { + if (typeof object.documents !== "object") + throw TypeError(".org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter.documents: object expected"); + message.documents = $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.fromObject(object.documents); + } + if (object.addresses != null) { + if (typeof object.addresses !== "object") + throw TypeError(".org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter.addresses: object expected"); + message.addresses = $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.AddressFilter.fromObject(object.addresses); + } + return message; + }; + + /** + * Creates a plain object from a StateTransitionFilter message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter + * @static + * @param {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter} message StateTransitionFilter + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StateTransitionFilter.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.documents != null && message.hasOwnProperty("documents")) { + object.documents = $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.toObject(message.documents, options); + if (options.oneofs) + object.filter = "documents"; + } + if (message.addresses != null && message.hasOwnProperty("addresses")) { + object.addresses = $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.AddressFilter.toObject(message.addresses, options); + if (options.oneofs) + object.filter = "addresses"; + } + return object; + }; + + /** + * Converts this StateTransitionFilter to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter + * @instance + * @returns {Object.} JSON object + */ + StateTransitionFilter.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return StateTransitionFilter; + })(); + + SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0 = (function() { + + /** + * Properties of a SubscribeToStateTransitionsRequestV0. + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest + * @interface ISubscribeToStateTransitionsRequestV0 + * @property {Array.|null} [filters] SubscribeToStateTransitionsRequestV0 filters + * @property {number|Long|null} [fromBlockHeight] SubscribeToStateTransitionsRequestV0 fromBlockHeight + */ + + /** + * Constructs a new SubscribeToStateTransitionsRequestV0. + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest + * @classdesc Represents a SubscribeToStateTransitionsRequestV0. + * @implements ISubscribeToStateTransitionsRequestV0 + * @constructor + * @param {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.ISubscribeToStateTransitionsRequestV0=} [properties] Properties to set + */ + function SubscribeToStateTransitionsRequestV0(properties) { + this.filters = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SubscribeToStateTransitionsRequestV0 filters. + * @member {Array.} filters + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0 + * @instance + */ + SubscribeToStateTransitionsRequestV0.prototype.filters = $util.emptyArray; + + /** + * SubscribeToStateTransitionsRequestV0 fromBlockHeight. + * @member {number|Long} fromBlockHeight + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0 + * @instance + */ + SubscribeToStateTransitionsRequestV0.prototype.fromBlockHeight = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new SubscribeToStateTransitionsRequestV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.ISubscribeToStateTransitionsRequestV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0} SubscribeToStateTransitionsRequestV0 instance + */ + SubscribeToStateTransitionsRequestV0.create = function create(properties) { + return new SubscribeToStateTransitionsRequestV0(properties); + }; + + /** + * Encodes the specified SubscribeToStateTransitionsRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.ISubscribeToStateTransitionsRequestV0} message SubscribeToStateTransitionsRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SubscribeToStateTransitionsRequestV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.filters != null && message.filters.length) + for (var i = 0; i < message.filters.length; ++i) + $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter.encode(message.filters[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.fromBlockHeight != null && Object.hasOwnProperty.call(message, "fromBlockHeight")) + writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.fromBlockHeight); + return writer; + }; + + /** + * Encodes the specified SubscribeToStateTransitionsRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.ISubscribeToStateTransitionsRequestV0} message SubscribeToStateTransitionsRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SubscribeToStateTransitionsRequestV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SubscribeToStateTransitionsRequestV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0} SubscribeToStateTransitionsRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SubscribeToStateTransitionsRequestV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.filters && message.filters.length)) + message.filters = []; + message.filters.push($root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter.decode(reader, reader.uint32())); + break; + case 2: + message.fromBlockHeight = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SubscribeToStateTransitionsRequestV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0} SubscribeToStateTransitionsRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SubscribeToStateTransitionsRequestV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SubscribeToStateTransitionsRequestV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SubscribeToStateTransitionsRequestV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.filters != null && message.hasOwnProperty("filters")) { + if (!Array.isArray(message.filters)) + return "filters: array expected"; + for (var i = 0; i < message.filters.length; ++i) { + var error = $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter.verify(message.filters[i]); + if (error) + return "filters." + error; + } + } + if (message.fromBlockHeight != null && message.hasOwnProperty("fromBlockHeight")) + if (!$util.isInteger(message.fromBlockHeight) && !(message.fromBlockHeight && $util.isInteger(message.fromBlockHeight.low) && $util.isInteger(message.fromBlockHeight.high))) + return "fromBlockHeight: integer|Long expected"; + return null; + }; + + /** + * Creates a SubscribeToStateTransitionsRequestV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0} SubscribeToStateTransitionsRequestV0 + */ + SubscribeToStateTransitionsRequestV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0(); + if (object.filters) { + if (!Array.isArray(object.filters)) + throw TypeError(".org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0.filters: array expected"); + message.filters = []; + for (var i = 0; i < object.filters.length; ++i) { + if (typeof object.filters[i] !== "object") + throw TypeError(".org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0.filters: object expected"); + message.filters[i] = $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter.fromObject(object.filters[i]); + } + } + if (object.fromBlockHeight != null) + if ($util.Long) + (message.fromBlockHeight = $util.Long.fromValue(object.fromBlockHeight)).unsigned = true; + else if (typeof object.fromBlockHeight === "string") + message.fromBlockHeight = parseInt(object.fromBlockHeight, 10); + else if (typeof object.fromBlockHeight === "number") + message.fromBlockHeight = object.fromBlockHeight; + else if (typeof object.fromBlockHeight === "object") + message.fromBlockHeight = new $util.LongBits(object.fromBlockHeight.low >>> 0, object.fromBlockHeight.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from a SubscribeToStateTransitionsRequestV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0} message SubscribeToStateTransitionsRequestV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SubscribeToStateTransitionsRequestV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.filters = []; + if (options.defaults) + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.fromBlockHeight = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.fromBlockHeight = options.longs === String ? "0" : 0; + if (message.filters && message.filters.length) { + object.filters = []; + for (var j = 0; j < message.filters.length; ++j) + object.filters[j] = $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter.toObject(message.filters[j], options); + } + if (message.fromBlockHeight != null && message.hasOwnProperty("fromBlockHeight")) + if (typeof message.fromBlockHeight === "number") + object.fromBlockHeight = options.longs === String ? String(message.fromBlockHeight) : message.fromBlockHeight; + else + object.fromBlockHeight = options.longs === String ? $util.Long.prototype.toString.call(message.fromBlockHeight) : options.longs === Number ? new $util.LongBits(message.fromBlockHeight.low >>> 0, message.fromBlockHeight.high >>> 0).toNumber(true) : message.fromBlockHeight; + return object; + }; + + /** + * Converts this SubscribeToStateTransitionsRequestV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0 + * @instance + * @returns {Object.} JSON object + */ + SubscribeToStateTransitionsRequestV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SubscribeToStateTransitionsRequestV0; + })(); + + return SubscribeToStateTransitionsRequest; + })(); + + v0.SubscribeToStateTransitionsResponse = (function() { + + /** + * Properties of a SubscribeToStateTransitionsResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface ISubscribeToStateTransitionsResponse + * @property {org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.ISubscribeToStateTransitionsResponseV0|null} [v0] SubscribeToStateTransitionsResponse v0 + */ + + /** + * Constructs a new SubscribeToStateTransitionsResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a SubscribeToStateTransitionsResponse. + * @implements ISubscribeToStateTransitionsResponse + * @constructor + * @param {org.dash.platform.dapi.v0.ISubscribeToStateTransitionsResponse=} [properties] Properties to set + */ + function SubscribeToStateTransitionsResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SubscribeToStateTransitionsResponse v0. + * @member {org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.ISubscribeToStateTransitionsResponseV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse + * @instance + */ + SubscribeToStateTransitionsResponse.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SubscribeToStateTransitionsResponse version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse + * @instance + */ + Object.defineProperty(SubscribeToStateTransitionsResponse.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SubscribeToStateTransitionsResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse + * @static + * @param {org.dash.platform.dapi.v0.ISubscribeToStateTransitionsResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse} SubscribeToStateTransitionsResponse instance + */ + SubscribeToStateTransitionsResponse.create = function create(properties) { + return new SubscribeToStateTransitionsResponse(properties); + }; + + /** + * Encodes the specified SubscribeToStateTransitionsResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse + * @static + * @param {org.dash.platform.dapi.v0.ISubscribeToStateTransitionsResponse} message SubscribeToStateTransitionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SubscribeToStateTransitionsResponse.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.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SubscribeToStateTransitionsResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse + * @static + * @param {org.dash.platform.dapi.v0.ISubscribeToStateTransitionsResponse} message SubscribeToStateTransitionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SubscribeToStateTransitionsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SubscribeToStateTransitionsResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse} SubscribeToStateTransitionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SubscribeToStateTransitionsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SubscribeToStateTransitionsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse} SubscribeToStateTransitionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SubscribeToStateTransitionsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SubscribeToStateTransitionsResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SubscribeToStateTransitionsResponse.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.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a SubscribeToStateTransitionsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse} SubscribeToStateTransitionsResponse + */ + SubscribeToStateTransitionsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a SubscribeToStateTransitionsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse + * @static + * @param {org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse} message SubscribeToStateTransitionsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SubscribeToStateTransitionsResponse.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.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this SubscribeToStateTransitionsResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse + * @instance + * @returns {Object.} JSON object + */ + SubscribeToStateTransitionsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0 = (function() { + + /** + * Properties of a SubscribeToStateTransitionsResponseV0. + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse + * @interface ISubscribeToStateTransitionsResponseV0 + * @property {org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.IStateTransitionMatch|null} [stateTransition] SubscribeToStateTransitionsResponseV0 stateTransition + * @property {org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.ICheckpoint|null} [checkpoint] SubscribeToStateTransitionsResponseV0 checkpoint + */ + + /** + * Constructs a new SubscribeToStateTransitionsResponseV0. + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse + * @classdesc Represents a SubscribeToStateTransitionsResponseV0. + * @implements ISubscribeToStateTransitionsResponseV0 + * @constructor + * @param {org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.ISubscribeToStateTransitionsResponseV0=} [properties] Properties to set + */ + function SubscribeToStateTransitionsResponseV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SubscribeToStateTransitionsResponseV0 stateTransition. + * @member {org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.IStateTransitionMatch|null|undefined} stateTransition + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0 + * @instance + */ + SubscribeToStateTransitionsResponseV0.prototype.stateTransition = null; + + /** + * SubscribeToStateTransitionsResponseV0 checkpoint. + * @member {org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.ICheckpoint|null|undefined} checkpoint + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0 + * @instance + */ + SubscribeToStateTransitionsResponseV0.prototype.checkpoint = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SubscribeToStateTransitionsResponseV0 responses. + * @member {"stateTransition"|"checkpoint"|undefined} responses + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0 + * @instance + */ + Object.defineProperty(SubscribeToStateTransitionsResponseV0.prototype, "responses", { + get: $util.oneOfGetter($oneOfFields = ["stateTransition", "checkpoint"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SubscribeToStateTransitionsResponseV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.ISubscribeToStateTransitionsResponseV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0} SubscribeToStateTransitionsResponseV0 instance + */ + SubscribeToStateTransitionsResponseV0.create = function create(properties) { + return new SubscribeToStateTransitionsResponseV0(properties); + }; + + /** + * Encodes the specified SubscribeToStateTransitionsResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.ISubscribeToStateTransitionsResponseV0} message SubscribeToStateTransitionsResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SubscribeToStateTransitionsResponseV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.stateTransition != null && Object.hasOwnProperty.call(message, "stateTransition")) + $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch.encode(message.stateTransition, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.checkpoint != null && Object.hasOwnProperty.call(message, "checkpoint")) + $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.Checkpoint.encode(message.checkpoint, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SubscribeToStateTransitionsResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.ISubscribeToStateTransitionsResponseV0} message SubscribeToStateTransitionsResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SubscribeToStateTransitionsResponseV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SubscribeToStateTransitionsResponseV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0} SubscribeToStateTransitionsResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SubscribeToStateTransitionsResponseV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.stateTransition = $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch.decode(reader, reader.uint32()); + break; + case 2: + message.checkpoint = $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.Checkpoint.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SubscribeToStateTransitionsResponseV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0} SubscribeToStateTransitionsResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SubscribeToStateTransitionsResponseV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SubscribeToStateTransitionsResponseV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SubscribeToStateTransitionsResponseV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.stateTransition != null && message.hasOwnProperty("stateTransition")) { + properties.responses = 1; + { + var error = $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch.verify(message.stateTransition); + if (error) + return "stateTransition." + error; + } + } + if (message.checkpoint != null && message.hasOwnProperty("checkpoint")) { + if (properties.responses === 1) + return "responses: multiple values"; + properties.responses = 1; + { + var error = $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.Checkpoint.verify(message.checkpoint); + if (error) + return "checkpoint." + error; + } + } + return null; + }; + + /** + * Creates a SubscribeToStateTransitionsResponseV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0} SubscribeToStateTransitionsResponseV0 + */ + SubscribeToStateTransitionsResponseV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0(); + if (object.stateTransition != null) { + if (typeof object.stateTransition !== "object") + throw TypeError(".org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.stateTransition: object expected"); + message.stateTransition = $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch.fromObject(object.stateTransition); + } + if (object.checkpoint != null) { + if (typeof object.checkpoint !== "object") + throw TypeError(".org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.checkpoint: object expected"); + message.checkpoint = $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.Checkpoint.fromObject(object.checkpoint); + } + return message; + }; + + /** + * Creates a plain object from a SubscribeToStateTransitionsResponseV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0} message SubscribeToStateTransitionsResponseV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SubscribeToStateTransitionsResponseV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.stateTransition != null && message.hasOwnProperty("stateTransition")) { + object.stateTransition = $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch.toObject(message.stateTransition, options); + if (options.oneofs) + object.responses = "stateTransition"; + } + if (message.checkpoint != null && message.hasOwnProperty("checkpoint")) { + object.checkpoint = $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.Checkpoint.toObject(message.checkpoint, options); + if (options.oneofs) + object.responses = "checkpoint"; + } + return object; + }; + + /** + * Converts this SubscribeToStateTransitionsResponseV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0 + * @instance + * @returns {Object.} JSON object + */ + SubscribeToStateTransitionsResponseV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + SubscribeToStateTransitionsResponseV0.StateTransitionMatch = (function() { + + /** + * Properties of a StateTransitionMatch. + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0 + * @interface IStateTransitionMatch + * @property {number|Long|null} [blockHeight] StateTransitionMatch blockHeight + * @property {number|Long|null} [blockTimeMs] StateTransitionMatch blockTimeMs + * @property {number|null} [protocolVersion] StateTransitionMatch protocolVersion + * @property {Uint8Array|null} [stateTransitionHash] StateTransitionMatch stateTransitionHash + * @property {Uint8Array|null} [stateTransition] StateTransitionMatch stateTransition + * @property {Array.|null} [matchedFilters] StateTransitionMatch matchedFilters + * @property {Array.|null} [matchedBatchPositions] StateTransitionMatch matchedBatchPositions + */ + + /** + * Constructs a new StateTransitionMatch. + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0 + * @classdesc Represents a StateTransitionMatch. + * @implements IStateTransitionMatch + * @constructor + * @param {org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.IStateTransitionMatch=} [properties] Properties to set + */ + function StateTransitionMatch(properties) { + this.matchedFilters = []; + this.matchedBatchPositions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StateTransitionMatch blockHeight. + * @member {number|Long} blockHeight + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch + * @instance + */ + StateTransitionMatch.prototype.blockHeight = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * StateTransitionMatch blockTimeMs. + * @member {number|Long} blockTimeMs + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch + * @instance + */ + StateTransitionMatch.prototype.blockTimeMs = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * StateTransitionMatch protocolVersion. + * @member {number} protocolVersion + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch + * @instance + */ + StateTransitionMatch.prototype.protocolVersion = 0; + + /** + * StateTransitionMatch stateTransitionHash. + * @member {Uint8Array} stateTransitionHash + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch + * @instance + */ + StateTransitionMatch.prototype.stateTransitionHash = $util.newBuffer([]); + + /** + * StateTransitionMatch stateTransition. + * @member {Uint8Array} stateTransition + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch + * @instance + */ + StateTransitionMatch.prototype.stateTransition = $util.newBuffer([]); + + /** + * StateTransitionMatch matchedFilters. + * @member {Array.} matchedFilters + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch + * @instance + */ + StateTransitionMatch.prototype.matchedFilters = $util.emptyArray; + + /** + * StateTransitionMatch matchedBatchPositions. + * @member {Array.} matchedBatchPositions + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch + * @instance + */ + StateTransitionMatch.prototype.matchedBatchPositions = $util.emptyArray; + + /** + * Creates a new StateTransitionMatch instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch + * @static + * @param {org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.IStateTransitionMatch=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch} StateTransitionMatch instance + */ + StateTransitionMatch.create = function create(properties) { + return new StateTransitionMatch(properties); + }; + + /** + * Encodes the specified StateTransitionMatch message. Does not implicitly {@link org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch + * @static + * @param {org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.IStateTransitionMatch} message StateTransitionMatch message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StateTransitionMatch.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.blockHeight != null && Object.hasOwnProperty.call(message, "blockHeight")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.blockHeight); + if (message.blockTimeMs != null && Object.hasOwnProperty.call(message, "blockTimeMs")) + writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.blockTimeMs); + if (message.protocolVersion != null && Object.hasOwnProperty.call(message, "protocolVersion")) + writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.protocolVersion); + if (message.stateTransitionHash != null && Object.hasOwnProperty.call(message, "stateTransitionHash")) + writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.stateTransitionHash); + if (message.stateTransition != null && Object.hasOwnProperty.call(message, "stateTransition")) + writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.stateTransition); + if (message.matchedFilters != null && message.matchedFilters.length) { + writer.uint32(/* id 6, wireType 2 =*/50).fork(); + for (var i = 0; i < message.matchedFilters.length; ++i) + writer.uint32(message.matchedFilters[i]); + writer.ldelim(); + } + if (message.matchedBatchPositions != null && message.matchedBatchPositions.length) { + writer.uint32(/* id 7, wireType 2 =*/58).fork(); + for (var i = 0; i < message.matchedBatchPositions.length; ++i) + writer.uint32(message.matchedBatchPositions[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified StateTransitionMatch message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch + * @static + * @param {org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.IStateTransitionMatch} message StateTransitionMatch message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StateTransitionMatch.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StateTransitionMatch message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch} StateTransitionMatch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StateTransitionMatch.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.blockHeight = reader.uint64(); + break; + case 2: + message.blockTimeMs = reader.uint64(); + break; + case 3: + message.protocolVersion = reader.uint32(); + break; + case 4: + message.stateTransitionHash = reader.bytes(); + break; + case 5: + message.stateTransition = reader.bytes(); + break; + case 6: + if (!(message.matchedFilters && message.matchedFilters.length)) + message.matchedFilters = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.matchedFilters.push(reader.uint32()); + } else + message.matchedFilters.push(reader.uint32()); + break; + case 7: + if (!(message.matchedBatchPositions && message.matchedBatchPositions.length)) + message.matchedBatchPositions = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.matchedBatchPositions.push(reader.uint32()); + } else + message.matchedBatchPositions.push(reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StateTransitionMatch message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch} StateTransitionMatch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StateTransitionMatch.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StateTransitionMatch message. + * @function verify + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StateTransitionMatch.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.blockHeight != null && message.hasOwnProperty("blockHeight")) + if (!$util.isInteger(message.blockHeight) && !(message.blockHeight && $util.isInteger(message.blockHeight.low) && $util.isInteger(message.blockHeight.high))) + return "blockHeight: integer|Long expected"; + if (message.blockTimeMs != null && message.hasOwnProperty("blockTimeMs")) + if (!$util.isInteger(message.blockTimeMs) && !(message.blockTimeMs && $util.isInteger(message.blockTimeMs.low) && $util.isInteger(message.blockTimeMs.high))) + return "blockTimeMs: integer|Long expected"; + if (message.protocolVersion != null && message.hasOwnProperty("protocolVersion")) + if (!$util.isInteger(message.protocolVersion)) + return "protocolVersion: integer 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.stateTransition != null && message.hasOwnProperty("stateTransition")) + if (!(message.stateTransition && typeof message.stateTransition.length === "number" || $util.isString(message.stateTransition))) + return "stateTransition: buffer expected"; + if (message.matchedFilters != null && message.hasOwnProperty("matchedFilters")) { + if (!Array.isArray(message.matchedFilters)) + return "matchedFilters: array expected"; + for (var i = 0; i < message.matchedFilters.length; ++i) + if (!$util.isInteger(message.matchedFilters[i])) + return "matchedFilters: integer[] expected"; + } + if (message.matchedBatchPositions != null && message.hasOwnProperty("matchedBatchPositions")) { + if (!Array.isArray(message.matchedBatchPositions)) + return "matchedBatchPositions: array expected"; + for (var i = 0; i < message.matchedBatchPositions.length; ++i) + if (!$util.isInteger(message.matchedBatchPositions[i])) + return "matchedBatchPositions: integer[] expected"; + } + return null; + }; + + /** + * Creates a StateTransitionMatch message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch} StateTransitionMatch + */ + StateTransitionMatch.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch) + return object; + var message = new $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch(); + if (object.blockHeight != null) + if ($util.Long) + (message.blockHeight = $util.Long.fromValue(object.blockHeight)).unsigned = true; + else if (typeof object.blockHeight === "string") + message.blockHeight = parseInt(object.blockHeight, 10); + else if (typeof object.blockHeight === "number") + message.blockHeight = object.blockHeight; + else if (typeof object.blockHeight === "object") + message.blockHeight = new $util.LongBits(object.blockHeight.low >>> 0, object.blockHeight.high >>> 0).toNumber(true); + if (object.blockTimeMs != null) + if ($util.Long) + (message.blockTimeMs = $util.Long.fromValue(object.blockTimeMs)).unsigned = true; + else if (typeof object.blockTimeMs === "string") + message.blockTimeMs = parseInt(object.blockTimeMs, 10); + else if (typeof object.blockTimeMs === "number") + message.blockTimeMs = object.blockTimeMs; + else if (typeof object.blockTimeMs === "object") + message.blockTimeMs = new $util.LongBits(object.blockTimeMs.low >>> 0, object.blockTimeMs.high >>> 0).toNumber(true); + if (object.protocolVersion != null) + message.protocolVersion = object.protocolVersion >>> 0; + 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.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; + if (object.matchedFilters) { + if (!Array.isArray(object.matchedFilters)) + throw TypeError(".org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch.matchedFilters: array expected"); + message.matchedFilters = []; + for (var i = 0; i < object.matchedFilters.length; ++i) + message.matchedFilters[i] = object.matchedFilters[i] >>> 0; + } + if (object.matchedBatchPositions) { + if (!Array.isArray(object.matchedBatchPositions)) + throw TypeError(".org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch.matchedBatchPositions: array expected"); + message.matchedBatchPositions = []; + for (var i = 0; i < object.matchedBatchPositions.length; ++i) + message.matchedBatchPositions[i] = object.matchedBatchPositions[i] >>> 0; + } + return message; + }; + + /** + * Creates a plain object from a StateTransitionMatch message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch + * @static + * @param {org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch} message StateTransitionMatch + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StateTransitionMatch.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.matchedFilters = []; + object.matchedBatchPositions = []; + } + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.blockHeight = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.blockHeight = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.blockTimeMs = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.blockTimeMs = options.longs === String ? "0" : 0; + object.protocolVersion = 0; + if (options.bytes === String) + object.stateTransitionHash = ""; + else { + object.stateTransitionHash = []; + if (options.bytes !== Array) + object.stateTransitionHash = $util.newBuffer(object.stateTransitionHash); + } + if (options.bytes === String) + object.stateTransition = ""; + else { + object.stateTransition = []; + if (options.bytes !== Array) + object.stateTransition = $util.newBuffer(object.stateTransition); + } + } + if (message.blockHeight != null && message.hasOwnProperty("blockHeight")) + if (typeof message.blockHeight === "number") + object.blockHeight = options.longs === String ? String(message.blockHeight) : message.blockHeight; + else + object.blockHeight = options.longs === String ? $util.Long.prototype.toString.call(message.blockHeight) : options.longs === Number ? new $util.LongBits(message.blockHeight.low >>> 0, message.blockHeight.high >>> 0).toNumber(true) : message.blockHeight; + if (message.blockTimeMs != null && message.hasOwnProperty("blockTimeMs")) + if (typeof message.blockTimeMs === "number") + object.blockTimeMs = options.longs === String ? String(message.blockTimeMs) : message.blockTimeMs; + else + object.blockTimeMs = options.longs === String ? $util.Long.prototype.toString.call(message.blockTimeMs) : options.longs === Number ? new $util.LongBits(message.blockTimeMs.low >>> 0, message.blockTimeMs.high >>> 0).toNumber(true) : message.blockTimeMs; + if (message.protocolVersion != null && message.hasOwnProperty("protocolVersion")) + object.protocolVersion = message.protocolVersion; + 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.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; + if (message.matchedFilters && message.matchedFilters.length) { + object.matchedFilters = []; + for (var j = 0; j < message.matchedFilters.length; ++j) + object.matchedFilters[j] = message.matchedFilters[j]; + } + if (message.matchedBatchPositions && message.matchedBatchPositions.length) { + object.matchedBatchPositions = []; + for (var j = 0; j < message.matchedBatchPositions.length; ++j) + object.matchedBatchPositions[j] = message.matchedBatchPositions[j]; + } + return object; + }; + + /** + * Converts this StateTransitionMatch to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch + * @instance + * @returns {Object.} JSON object + */ + StateTransitionMatch.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return StateTransitionMatch; + })(); + + SubscribeToStateTransitionsResponseV0.Checkpoint = (function() { + + /** + * Properties of a Checkpoint. + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0 + * @interface ICheckpoint + * @property {number|Long|null} [blockHeight] Checkpoint blockHeight + */ + + /** + * Constructs a new Checkpoint. + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0 + * @classdesc Represents a Checkpoint. + * @implements ICheckpoint + * @constructor + * @param {org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.ICheckpoint=} [properties] Properties to set + */ + function Checkpoint(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Checkpoint blockHeight. + * @member {number|Long} blockHeight + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.Checkpoint + * @instance + */ + Checkpoint.prototype.blockHeight = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new Checkpoint instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.Checkpoint + * @static + * @param {org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.ICheckpoint=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.Checkpoint} Checkpoint instance + */ + Checkpoint.create = function create(properties) { + return new Checkpoint(properties); + }; + + /** + * Encodes the specified Checkpoint message. Does not implicitly {@link org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.Checkpoint.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.Checkpoint + * @static + * @param {org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.ICheckpoint} message Checkpoint message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Checkpoint.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.blockHeight != null && Object.hasOwnProperty.call(message, "blockHeight")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.blockHeight); + return writer; + }; + + /** + * Encodes the specified Checkpoint message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.Checkpoint.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.Checkpoint + * @static + * @param {org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.ICheckpoint} message Checkpoint message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Checkpoint.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Checkpoint message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.Checkpoint + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.Checkpoint} Checkpoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Checkpoint.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.Checkpoint(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.blockHeight = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Checkpoint message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.Checkpoint + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.Checkpoint} Checkpoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Checkpoint.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Checkpoint message. + * @function verify + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.Checkpoint + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Checkpoint.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.blockHeight != null && message.hasOwnProperty("blockHeight")) + if (!$util.isInteger(message.blockHeight) && !(message.blockHeight && $util.isInteger(message.blockHeight.low) && $util.isInteger(message.blockHeight.high))) + return "blockHeight: integer|Long expected"; + return null; + }; + + /** + * Creates a Checkpoint message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.Checkpoint + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.Checkpoint} Checkpoint + */ + Checkpoint.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.Checkpoint) + return object; + var message = new $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.Checkpoint(); + if (object.blockHeight != null) + if ($util.Long) + (message.blockHeight = $util.Long.fromValue(object.blockHeight)).unsigned = true; + else if (typeof object.blockHeight === "string") + message.blockHeight = parseInt(object.blockHeight, 10); + else if (typeof object.blockHeight === "number") + message.blockHeight = object.blockHeight; + else if (typeof object.blockHeight === "object") + message.blockHeight = new $util.LongBits(object.blockHeight.low >>> 0, object.blockHeight.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from a Checkpoint message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.Checkpoint + * @static + * @param {org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.Checkpoint} message Checkpoint + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Checkpoint.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.blockHeight = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.blockHeight = options.longs === String ? "0" : 0; + if (message.blockHeight != null && message.hasOwnProperty("blockHeight")) + if (typeof message.blockHeight === "number") + object.blockHeight = options.longs === String ? String(message.blockHeight) : message.blockHeight; + else + object.blockHeight = options.longs === String ? $util.Long.prototype.toString.call(message.blockHeight) : options.longs === Number ? new $util.LongBits(message.blockHeight.low >>> 0, message.blockHeight.high >>> 0).toNumber(true) : message.blockHeight; + return object; + }; + + /** + * Converts this Checkpoint to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.Checkpoint + * @instance + * @returns {Object.} JSON object + */ + Checkpoint.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Checkpoint; + })(); + + return SubscribeToStateTransitionsResponseV0; + })(); + + return SubscribeToStateTransitionsResponse; + })(); + return v0; })(); 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 45894cd7762..af90f2b7d9a 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 @@ -2278,6 +2278,37 @@ org.dash.platform.dapi.v0.PlatformOuterClass.GetShieldedNullifiersResponse> getG return getGetShieldedNullifiersMethod; } + private static volatile io.grpc.MethodDescriptor getSubscribeToStateTransitionsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "subscribeToStateTransitions", + requestType = org.dash.platform.dapi.v0.PlatformOuterClass.SubscribeToStateTransitionsRequest.class, + responseType = org.dash.platform.dapi.v0.PlatformOuterClass.SubscribeToStateTransitionsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING) + public static io.grpc.MethodDescriptor getSubscribeToStateTransitionsMethod() { + io.grpc.MethodDescriptor getSubscribeToStateTransitionsMethod; + if ((getSubscribeToStateTransitionsMethod = PlatformGrpc.getSubscribeToStateTransitionsMethod) == null) { + synchronized (PlatformGrpc.class) { + if ((getSubscribeToStateTransitionsMethod = PlatformGrpc.getSubscribeToStateTransitionsMethod) == null) { + PlatformGrpc.getSubscribeToStateTransitionsMethod = getSubscribeToStateTransitionsMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "subscribeToStateTransitions")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + org.dash.platform.dapi.v0.PlatformOuterClass.SubscribeToStateTransitionsRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + org.dash.platform.dapi.v0.PlatformOuterClass.SubscribeToStateTransitionsResponse.getDefaultInstance())) + .setSchemaDescriptor(new PlatformMethodDescriptorSupplier("subscribeToStateTransitions")) + .build(); + } + } + } + return getSubscribeToStateTransitionsMethod; + } + /** * Creates a new async stub that supports all call types for the service */ @@ -2858,6 +2889,19 @@ public void getShieldedNullifiers(org.dash.platform.dapi.v0.PlatformOuterClass.G io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetShieldedNullifiersMethod(), responseObserver); } + /** + *
+     * Streams every committed, successfully executed state transition that matches
+     * one of the request's filters, block by block, from a chosen height onward.
+     * Served by DAPI from the Tenderdash block store; see
+     * `SubscribeToStateTransitionsResponse` for the stream contract.
+     * 
+ */ + public void subscribeToStateTransitions(org.dash.platform.dapi.v0.PlatformOuterClass.SubscribeToStateTransitionsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getSubscribeToStateTransitionsMethod(), responseObserver); + } + @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) .addMethod( @@ -3371,6 +3415,13 @@ public void getShieldedNullifiers(org.dash.platform.dapi.v0.PlatformOuterClass.G org.dash.platform.dapi.v0.PlatformOuterClass.GetShieldedNullifiersRequest, org.dash.platform.dapi.v0.PlatformOuterClass.GetShieldedNullifiersResponse>( this, METHODID_GET_SHIELDED_NULLIFIERS))) + .addMethod( + getSubscribeToStateTransitionsMethod(), + io.grpc.stub.ServerCalls.asyncServerStreamingCall( + new MethodHandlers< + org.dash.platform.dapi.v0.PlatformOuterClass.SubscribeToStateTransitionsRequest, + org.dash.platform.dapi.v0.PlatformOuterClass.SubscribeToStateTransitionsResponse>( + this, METHODID_SUBSCRIBE_TO_STATE_TRANSITIONS))) .build(); } } @@ -3993,6 +4044,20 @@ public void getShieldedNullifiers(org.dash.platform.dapi.v0.PlatformOuterClass.G io.grpc.stub.ClientCalls.asyncUnaryCall( getChannel().newCall(getGetShieldedNullifiersMethod(), getCallOptions()), request, responseObserver); } + + /** + *
+     * Streams every committed, successfully executed state transition that matches
+     * one of the request's filters, block by block, from a chosen height onward.
+     * Served by DAPI from the Tenderdash block store; see
+     * `SubscribeToStateTransitionsResponse` for the stream contract.
+     * 
+ */ + public void subscribeToStateTransitions(org.dash.platform.dapi.v0.PlatformOuterClass.SubscribeToStateTransitionsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncServerStreamingCall( + getChannel().newCall(getSubscribeToStateTransitionsMethod(), getCallOptions()), request, responseObserver); + } } /** @@ -4540,6 +4605,20 @@ public org.dash.platform.dapi.v0.PlatformOuterClass.GetShieldedNullifiersRespons return io.grpc.stub.ClientCalls.blockingUnaryCall( getChannel(), getGetShieldedNullifiersMethod(), getCallOptions(), request); } + + /** + *
+     * Streams every committed, successfully executed state transition that matches
+     * one of the request's filters, block by block, from a chosen height onward.
+     * Served by DAPI from the Tenderdash block store; see
+     * `SubscribeToStateTransitionsResponse` for the stream contract.
+     * 
+ */ + public java.util.Iterator subscribeToStateTransitions( + org.dash.platform.dapi.v0.PlatformOuterClass.SubscribeToStateTransitionsRequest request) { + return io.grpc.stub.ClientCalls.blockingServerStreamingCall( + getChannel(), getSubscribeToStateTransitionsMethod(), getCallOptions(), request); + } } /** @@ -5235,6 +5314,7 @@ public com.google.common.util.concurrent.ListenableFuture implements io.grpc.stub.ServerCalls.UnaryMethod, @@ -5545,6 +5625,10 @@ public void invoke(Req request, io.grpc.stub.StreamObserver responseObserv serviceImpl.getShieldedNullifiers((org.dash.platform.dapi.v0.PlatformOuterClass.GetShieldedNullifiersRequest) request, (io.grpc.stub.StreamObserver) responseObserver); break; + case METHODID_SUBSCRIBE_TO_STATE_TRANSITIONS: + serviceImpl.subscribeToStateTransitions((org.dash.platform.dapi.v0.PlatformOuterClass.SubscribeToStateTransitionsRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; default: throw new AssertionError(); } @@ -5679,6 +5763,7 @@ public static io.grpc.ServiceDescriptor getServiceDescriptor() { .addMethod(getGetShieldedPoolStateMethod()) .addMethod(getGetShieldedNotesCountMethod()) .addMethod(getGetShieldedNullifiersMethod()) + .addMethod(getSubscribeToStateTransitionsMethod()) .build(); } } 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 f0bd5f19b87..fc7553365e0 100644 --- a/packages/dapi-grpc/clients/platform/v0/nodejs/platform_pbjs.js +++ b/packages/dapi-grpc/clients/platform/v0/nodejs/platform_pbjs.js @@ -2495,6 +2495,39 @@ $root.org = (function() { * @variation 2 */ + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#subscribeToStateTransitions}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef subscribeToStateTransitionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse} [response] SubscribeToStateTransitionsResponse + */ + + /** + * Calls subscribeToStateTransitions. + * @function subscribeToStateTransitions + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.ISubscribeToStateTransitionsRequest} request SubscribeToStateTransitionsRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.subscribeToStateTransitionsCallback} callback Node-style callback called with the error, if any, and SubscribeToStateTransitionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.subscribeToStateTransitions = function subscribeToStateTransitions(request, callback) { + return this.rpcCall(subscribeToStateTransitions, $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest, $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse, request, callback); + }, "name", { value: "subscribeToStateTransitions" }); + + /** + * Calls subscribeToStateTransitions. + * @function subscribeToStateTransitions + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.ISubscribeToStateTransitionsRequest} request SubscribeToStateTransitionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + return Platform; })(); @@ -122421,6 +122454,3029 @@ $root.org = (function() { return GetShieldedNullifiersResponse; })(); + v0.SubscribeToStateTransitionsRequest = (function() { + + /** + * Properties of a SubscribeToStateTransitionsRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface ISubscribeToStateTransitionsRequest + * @property {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.ISubscribeToStateTransitionsRequestV0|null} [v0] SubscribeToStateTransitionsRequest v0 + */ + + /** + * Constructs a new SubscribeToStateTransitionsRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a SubscribeToStateTransitionsRequest. + * @implements ISubscribeToStateTransitionsRequest + * @constructor + * @param {org.dash.platform.dapi.v0.ISubscribeToStateTransitionsRequest=} [properties] Properties to set + */ + function SubscribeToStateTransitionsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SubscribeToStateTransitionsRequest v0. + * @member {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.ISubscribeToStateTransitionsRequestV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest + * @instance + */ + SubscribeToStateTransitionsRequest.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SubscribeToStateTransitionsRequest version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest + * @instance + */ + Object.defineProperty(SubscribeToStateTransitionsRequest.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SubscribeToStateTransitionsRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest + * @static + * @param {org.dash.platform.dapi.v0.ISubscribeToStateTransitionsRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest} SubscribeToStateTransitionsRequest instance + */ + SubscribeToStateTransitionsRequest.create = function create(properties) { + return new SubscribeToStateTransitionsRequest(properties); + }; + + /** + * Encodes the specified SubscribeToStateTransitionsRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest + * @static + * @param {org.dash.platform.dapi.v0.ISubscribeToStateTransitionsRequest} message SubscribeToStateTransitionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SubscribeToStateTransitionsRequest.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.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SubscribeToStateTransitionsRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest + * @static + * @param {org.dash.platform.dapi.v0.ISubscribeToStateTransitionsRequest} message SubscribeToStateTransitionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SubscribeToStateTransitionsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SubscribeToStateTransitionsRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest} SubscribeToStateTransitionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SubscribeToStateTransitionsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SubscribeToStateTransitionsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest} SubscribeToStateTransitionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SubscribeToStateTransitionsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SubscribeToStateTransitionsRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SubscribeToStateTransitionsRequest.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.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a SubscribeToStateTransitionsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest} SubscribeToStateTransitionsRequest + */ + SubscribeToStateTransitionsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a SubscribeToStateTransitionsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest + * @static + * @param {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest} message SubscribeToStateTransitionsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SubscribeToStateTransitionsRequest.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.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this SubscribeToStateTransitionsRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest + * @instance + * @returns {Object.} JSON object + */ + SubscribeToStateTransitionsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Role enum. + * @name org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.Role + * @enum {number} + * @property {number} ANY=0 ANY value + * @property {number} SENDER=1 SENDER value + * @property {number} RECIPIENT=2 RECIPIENT value + */ + SubscribeToStateTransitionsRequest.Role = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ANY"] = 0; + values[valuesById[1] = "SENDER"] = 1; + values[valuesById[2] = "RECIPIENT"] = 2; + return values; + })(); + + SubscribeToStateTransitionsRequest.DocumentFilter = (function() { + + /** + * Properties of a DocumentFilter. + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest + * @interface IDocumentFilter + * @property {Uint8Array|null} [dataContractId] DocumentFilter dataContractId + * @property {string|null} [documentTypeName] DocumentFilter documentTypeName + * @property {Array.|null} [actions] DocumentFilter actions + * @property {Uint8Array|null} [batchOwnerId] DocumentFilter batchOwnerId + */ + + /** + * Constructs a new DocumentFilter. + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest + * @classdesc Represents a DocumentFilter. + * @implements IDocumentFilter + * @constructor + * @param {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.IDocumentFilter=} [properties] Properties to set + */ + function DocumentFilter(properties) { + this.actions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DocumentFilter dataContractId. + * @member {Uint8Array} dataContractId + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter + * @instance + */ + DocumentFilter.prototype.dataContractId = $util.newBuffer([]); + + /** + * DocumentFilter documentTypeName. + * @member {string} documentTypeName + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter + * @instance + */ + DocumentFilter.prototype.documentTypeName = ""; + + /** + * DocumentFilter actions. + * @member {Array.} actions + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter + * @instance + */ + DocumentFilter.prototype.actions = $util.emptyArray; + + /** + * DocumentFilter batchOwnerId. + * @member {Uint8Array} batchOwnerId + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter + * @instance + */ + DocumentFilter.prototype.batchOwnerId = $util.newBuffer([]); + + /** + * Creates a new DocumentFilter instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter + * @static + * @param {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.IDocumentFilter=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter} DocumentFilter instance + */ + DocumentFilter.create = function create(properties) { + return new DocumentFilter(properties); + }; + + /** + * Encodes the specified DocumentFilter message. Does not implicitly {@link org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter + * @static + * @param {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.IDocumentFilter} message DocumentFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DocumentFilter.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.documentTypeName != null && Object.hasOwnProperty.call(message, "documentTypeName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.documentTypeName); + if (message.actions != null && message.actions.length) + for (var i = 0; i < message.actions.length; ++i) + $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch.encode(message.actions[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.batchOwnerId != null && Object.hasOwnProperty.call(message, "batchOwnerId")) + writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.batchOwnerId); + return writer; + }; + + /** + * Encodes the specified DocumentFilter message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter + * @static + * @param {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.IDocumentFilter} message DocumentFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DocumentFilter.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DocumentFilter message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter} DocumentFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DocumentFilter.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.dataContractId = reader.bytes(); + break; + case 2: + message.documentTypeName = reader.string(); + break; + case 3: + if (!(message.actions && message.actions.length)) + message.actions = []; + message.actions.push($root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch.decode(reader, reader.uint32())); + break; + case 4: + message.batchOwnerId = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DocumentFilter message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter} DocumentFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DocumentFilter.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DocumentFilter message. + * @function verify + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DocumentFilter.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + 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.documentTypeName != null && message.hasOwnProperty("documentTypeName")) + if (!$util.isString(message.documentTypeName)) + return "documentTypeName: string expected"; + if (message.actions != null && message.hasOwnProperty("actions")) { + if (!Array.isArray(message.actions)) + return "actions: array expected"; + for (var i = 0; i < message.actions.length; ++i) { + var error = $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch.verify(message.actions[i]); + if (error) + return "actions." + error; + } + } + if (message.batchOwnerId != null && message.hasOwnProperty("batchOwnerId")) + if (!(message.batchOwnerId && typeof message.batchOwnerId.length === "number" || $util.isString(message.batchOwnerId))) + return "batchOwnerId: buffer expected"; + return null; + }; + + /** + * Creates a DocumentFilter message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter} DocumentFilter + */ + DocumentFilter.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter) + return object; + var message = new $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter(); + 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.documentTypeName != null) + message.documentTypeName = String(object.documentTypeName); + if (object.actions) { + if (!Array.isArray(object.actions)) + throw TypeError(".org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.actions: array expected"); + message.actions = []; + for (var i = 0; i < object.actions.length; ++i) { + if (typeof object.actions[i] !== "object") + throw TypeError(".org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.actions: object expected"); + message.actions[i] = $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch.fromObject(object.actions[i]); + } + } + if (object.batchOwnerId != null) + if (typeof object.batchOwnerId === "string") + $util.base64.decode(object.batchOwnerId, message.batchOwnerId = $util.newBuffer($util.base64.length(object.batchOwnerId)), 0); + else if (object.batchOwnerId.length >= 0) + message.batchOwnerId = object.batchOwnerId; + return message; + }; + + /** + * Creates a plain object from a DocumentFilter message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter + * @static + * @param {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter} message DocumentFilter + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DocumentFilter.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.actions = []; + if (options.defaults) { + if (options.bytes === String) + object.dataContractId = ""; + else { + object.dataContractId = []; + if (options.bytes !== Array) + object.dataContractId = $util.newBuffer(object.dataContractId); + } + object.documentTypeName = ""; + if (options.bytes === String) + object.batchOwnerId = ""; + else { + object.batchOwnerId = []; + if (options.bytes !== Array) + object.batchOwnerId = $util.newBuffer(object.batchOwnerId); + } + } + 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.documentTypeName != null && message.hasOwnProperty("documentTypeName")) + object.documentTypeName = message.documentTypeName; + if (message.actions && message.actions.length) { + object.actions = []; + for (var j = 0; j < message.actions.length; ++j) + object.actions[j] = $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch.toObject(message.actions[j], options); + } + if (message.batchOwnerId != null && message.hasOwnProperty("batchOwnerId")) + object.batchOwnerId = options.bytes === String ? $util.base64.encode(message.batchOwnerId, 0, message.batchOwnerId.length) : options.bytes === Array ? Array.prototype.slice.call(message.batchOwnerId) : message.batchOwnerId; + return object; + }; + + /** + * Converts this DocumentFilter to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter + * @instance + * @returns {Object.} JSON object + */ + DocumentFilter.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Action enum. + * @name org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.Action + * @enum {number} + * @property {number} CREATE=0 CREATE value + * @property {number} REPLACE=1 REPLACE value + * @property {number} DELETE=2 DELETE value + * @property {number} TRANSFER=3 TRANSFER value + * @property {number} UPDATE_PRICE=4 UPDATE_PRICE value + * @property {number} PURCHASE=5 PURCHASE value + */ + DocumentFilter.Action = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CREATE"] = 0; + values[valuesById[1] = "REPLACE"] = 1; + values[valuesById[2] = "DELETE"] = 2; + values[valuesById[3] = "TRANSFER"] = 3; + values[valuesById[4] = "UPDATE_PRICE"] = 4; + values[valuesById[5] = "PURCHASE"] = 5; + return values; + })(); + + DocumentFilter.PriceClause = (function() { + + /** + * Properties of a PriceClause. + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter + * @interface IPriceClause + * @property {org.dash.platform.dapi.v0.GetDocumentsRequest.WhereOperator|null} [operator] PriceClause operator + * @property {org.dash.platform.dapi.v0.GetDocumentsRequest.IDocumentFieldValue|null} [value] PriceClause value + */ + + /** + * Constructs a new PriceClause. + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter + * @classdesc Represents a PriceClause. + * @implements IPriceClause + * @constructor + * @param {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.IPriceClause=} [properties] Properties to set + */ + function PriceClause(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PriceClause operator. + * @member {org.dash.platform.dapi.v0.GetDocumentsRequest.WhereOperator} operator + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.PriceClause + * @instance + */ + PriceClause.prototype.operator = 0; + + /** + * PriceClause value. + * @member {org.dash.platform.dapi.v0.GetDocumentsRequest.IDocumentFieldValue|null|undefined} value + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.PriceClause + * @instance + */ + PriceClause.prototype.value = null; + + /** + * Creates a new PriceClause instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.PriceClause + * @static + * @param {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.IPriceClause=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.PriceClause} PriceClause instance + */ + PriceClause.create = function create(properties) { + return new PriceClause(properties); + }; + + /** + * Encodes the specified PriceClause message. Does not implicitly {@link org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.PriceClause.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.PriceClause + * @static + * @param {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.IPriceClause} message PriceClause message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PriceClause.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.operator != null && Object.hasOwnProperty.call(message, "operator")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.operator); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + $root.org.dash.platform.dapi.v0.GetDocumentsRequest.DocumentFieldValue.encode(message.value, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PriceClause message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.PriceClause.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.PriceClause + * @static + * @param {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.IPriceClause} message PriceClause message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PriceClause.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PriceClause message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.PriceClause + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.PriceClause} PriceClause + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PriceClause.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.PriceClause(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.operator = reader.int32(); + break; + case 2: + message.value = $root.org.dash.platform.dapi.v0.GetDocumentsRequest.DocumentFieldValue.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PriceClause message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.PriceClause + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.PriceClause} PriceClause + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PriceClause.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PriceClause message. + * @function verify + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.PriceClause + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PriceClause.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.operator != null && message.hasOwnProperty("operator")) + switch (message.operator) { + default: + return "operator: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + break; + } + if (message.value != null && message.hasOwnProperty("value")) { + var error = $root.org.dash.platform.dapi.v0.GetDocumentsRequest.DocumentFieldValue.verify(message.value); + if (error) + return "value." + error; + } + return null; + }; + + /** + * Creates a PriceClause message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.PriceClause + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.PriceClause} PriceClause + */ + PriceClause.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.PriceClause) + return object; + var message = new $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.PriceClause(); + switch (object.operator) { + case "EQUAL": + case 0: + message.operator = 0; + break; + case "GREATER_THAN": + case 1: + message.operator = 1; + break; + case "GREATER_THAN_OR_EQUALS": + case 2: + message.operator = 2; + break; + case "LESS_THAN": + case 3: + message.operator = 3; + break; + case "LESS_THAN_OR_EQUALS": + case 4: + message.operator = 4; + break; + case "BETWEEN": + case 5: + message.operator = 5; + break; + case "BETWEEN_EXCLUDE_BOUNDS": + case 6: + message.operator = 6; + break; + case "BETWEEN_EXCLUDE_LEFT": + case 7: + message.operator = 7; + break; + case "BETWEEN_EXCLUDE_RIGHT": + case 8: + message.operator = 8; + break; + case "IN": + case 9: + message.operator = 9; + break; + case "STARTS_WITH": + case 10: + message.operator = 10; + break; + case "IN_TIME_RANGE": + case 11: + message.operator = 11; + break; + case "IN_INTEGER_RANGE": + case 12: + message.operator = 12; + break; + case "CONTAINS": + case 13: + message.operator = 13; + break; + case "CONTAINS_ANY": + case 14: + message.operator = 14; + break; + } + if (object.value != null) { + if (typeof object.value !== "object") + throw TypeError(".org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.PriceClause.value: object expected"); + message.value = $root.org.dash.platform.dapi.v0.GetDocumentsRequest.DocumentFieldValue.fromObject(object.value); + } + return message; + }; + + /** + * Creates a plain object from a PriceClause message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.PriceClause + * @static + * @param {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.PriceClause} message PriceClause + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PriceClause.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.operator = options.enums === String ? "EQUAL" : 0; + object.value = null; + } + if (message.operator != null && message.hasOwnProperty("operator")) + object.operator = options.enums === String ? $root.org.dash.platform.dapi.v0.GetDocumentsRequest.WhereOperator[message.operator] : message.operator; + if (message.value != null && message.hasOwnProperty("value")) + object.value = $root.org.dash.platform.dapi.v0.GetDocumentsRequest.DocumentFieldValue.toObject(message.value, options); + return object; + }; + + /** + * Converts this PriceClause to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.PriceClause + * @instance + * @returns {Object.} JSON object + */ + PriceClause.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PriceClause; + })(); + + DocumentFilter.ActionMatch = (function() { + + /** + * Properties of an ActionMatch. + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter + * @interface IActionMatch + * @property {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.Action|null} [action] ActionMatch action + * @property {Array.|null} [newDocumentWhere] ActionMatch newDocumentWhere + * @property {Array.|null} [originalDocumentWhere] ActionMatch originalDocumentWhere + * @property {Array.|null} [ownerIds] ActionMatch ownerIds + * @property {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.IPriceClause|null} [price] ActionMatch price + */ + + /** + * Constructs a new ActionMatch. + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter + * @classdesc Represents an ActionMatch. + * @implements IActionMatch + * @constructor + * @param {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.IActionMatch=} [properties] Properties to set + */ + function ActionMatch(properties) { + this.newDocumentWhere = []; + this.originalDocumentWhere = []; + this.ownerIds = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ActionMatch action. + * @member {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.Action} action + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch + * @instance + */ + ActionMatch.prototype.action = 0; + + /** + * ActionMatch newDocumentWhere. + * @member {Array.} newDocumentWhere + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch + * @instance + */ + ActionMatch.prototype.newDocumentWhere = $util.emptyArray; + + /** + * ActionMatch originalDocumentWhere. + * @member {Array.} originalDocumentWhere + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch + * @instance + */ + ActionMatch.prototype.originalDocumentWhere = $util.emptyArray; + + /** + * ActionMatch ownerIds. + * @member {Array.} ownerIds + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch + * @instance + */ + ActionMatch.prototype.ownerIds = $util.emptyArray; + + /** + * ActionMatch price. + * @member {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.IPriceClause|null|undefined} price + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch + * @instance + */ + ActionMatch.prototype.price = null; + + /** + * Creates a new ActionMatch instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch + * @static + * @param {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.IActionMatch=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch} ActionMatch instance + */ + ActionMatch.create = function create(properties) { + return new ActionMatch(properties); + }; + + /** + * Encodes the specified ActionMatch message. Does not implicitly {@link org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch + * @static + * @param {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.IActionMatch} message ActionMatch message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ActionMatch.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.action != null && Object.hasOwnProperty.call(message, "action")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.action); + if (message.newDocumentWhere != null && message.newDocumentWhere.length) + for (var i = 0; i < message.newDocumentWhere.length; ++i) + $root.org.dash.platform.dapi.v0.GetDocumentsRequest.WhereClause.encode(message.newDocumentWhere[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.originalDocumentWhere != null && message.originalDocumentWhere.length) + for (var i = 0; i < message.originalDocumentWhere.length; ++i) + $root.org.dash.platform.dapi.v0.GetDocumentsRequest.WhereClause.encode(message.originalDocumentWhere[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.ownerIds != null && message.ownerIds.length) + for (var i = 0; i < message.ownerIds.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.ownerIds[i]); + if (message.price != null && Object.hasOwnProperty.call(message, "price")) + $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.PriceClause.encode(message.price, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ActionMatch message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch + * @static + * @param {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.IActionMatch} message ActionMatch message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ActionMatch.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ActionMatch message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch} ActionMatch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ActionMatch.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.action = reader.int32(); + break; + case 2: + if (!(message.newDocumentWhere && message.newDocumentWhere.length)) + message.newDocumentWhere = []; + message.newDocumentWhere.push($root.org.dash.platform.dapi.v0.GetDocumentsRequest.WhereClause.decode(reader, reader.uint32())); + break; + case 3: + if (!(message.originalDocumentWhere && message.originalDocumentWhere.length)) + message.originalDocumentWhere = []; + message.originalDocumentWhere.push($root.org.dash.platform.dapi.v0.GetDocumentsRequest.WhereClause.decode(reader, reader.uint32())); + break; + case 4: + if (!(message.ownerIds && message.ownerIds.length)) + message.ownerIds = []; + message.ownerIds.push(reader.bytes()); + break; + case 5: + message.price = $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.PriceClause.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ActionMatch message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch} ActionMatch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ActionMatch.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ActionMatch message. + * @function verify + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ActionMatch.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.action != null && message.hasOwnProperty("action")) + switch (message.action) { + default: + return "action: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.newDocumentWhere != null && message.hasOwnProperty("newDocumentWhere")) { + if (!Array.isArray(message.newDocumentWhere)) + return "newDocumentWhere: array expected"; + for (var i = 0; i < message.newDocumentWhere.length; ++i) { + var error = $root.org.dash.platform.dapi.v0.GetDocumentsRequest.WhereClause.verify(message.newDocumentWhere[i]); + if (error) + return "newDocumentWhere." + error; + } + } + if (message.originalDocumentWhere != null && message.hasOwnProperty("originalDocumentWhere")) { + if (!Array.isArray(message.originalDocumentWhere)) + return "originalDocumentWhere: array expected"; + for (var i = 0; i < message.originalDocumentWhere.length; ++i) { + var error = $root.org.dash.platform.dapi.v0.GetDocumentsRequest.WhereClause.verify(message.originalDocumentWhere[i]); + if (error) + return "originalDocumentWhere." + error; + } + } + if (message.ownerIds != null && message.hasOwnProperty("ownerIds")) { + if (!Array.isArray(message.ownerIds)) + return "ownerIds: array expected"; + for (var i = 0; i < message.ownerIds.length; ++i) + if (!(message.ownerIds[i] && typeof message.ownerIds[i].length === "number" || $util.isString(message.ownerIds[i]))) + return "ownerIds: buffer[] expected"; + } + if (message.price != null && message.hasOwnProperty("price")) { + var error = $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.PriceClause.verify(message.price); + if (error) + return "price." + error; + } + return null; + }; + + /** + * Creates an ActionMatch message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch} ActionMatch + */ + ActionMatch.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch) + return object; + var message = new $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch(); + switch (object.action) { + case "CREATE": + case 0: + message.action = 0; + break; + case "REPLACE": + case 1: + message.action = 1; + break; + case "DELETE": + case 2: + message.action = 2; + break; + case "TRANSFER": + case 3: + message.action = 3; + break; + case "UPDATE_PRICE": + case 4: + message.action = 4; + break; + case "PURCHASE": + case 5: + message.action = 5; + break; + } + if (object.newDocumentWhere) { + if (!Array.isArray(object.newDocumentWhere)) + throw TypeError(".org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch.newDocumentWhere: array expected"); + message.newDocumentWhere = []; + for (var i = 0; i < object.newDocumentWhere.length; ++i) { + if (typeof object.newDocumentWhere[i] !== "object") + throw TypeError(".org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch.newDocumentWhere: object expected"); + message.newDocumentWhere[i] = $root.org.dash.platform.dapi.v0.GetDocumentsRequest.WhereClause.fromObject(object.newDocumentWhere[i]); + } + } + if (object.originalDocumentWhere) { + if (!Array.isArray(object.originalDocumentWhere)) + throw TypeError(".org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch.originalDocumentWhere: array expected"); + message.originalDocumentWhere = []; + for (var i = 0; i < object.originalDocumentWhere.length; ++i) { + if (typeof object.originalDocumentWhere[i] !== "object") + throw TypeError(".org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch.originalDocumentWhere: object expected"); + message.originalDocumentWhere[i] = $root.org.dash.platform.dapi.v0.GetDocumentsRequest.WhereClause.fromObject(object.originalDocumentWhere[i]); + } + } + if (object.ownerIds) { + if (!Array.isArray(object.ownerIds)) + throw TypeError(".org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch.ownerIds: array expected"); + message.ownerIds = []; + for (var i = 0; i < object.ownerIds.length; ++i) + if (typeof object.ownerIds[i] === "string") + $util.base64.decode(object.ownerIds[i], message.ownerIds[i] = $util.newBuffer($util.base64.length(object.ownerIds[i])), 0); + else if (object.ownerIds[i].length >= 0) + message.ownerIds[i] = object.ownerIds[i]; + } + if (object.price != null) { + if (typeof object.price !== "object") + throw TypeError(".org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch.price: object expected"); + message.price = $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.PriceClause.fromObject(object.price); + } + return message; + }; + + /** + * Creates a plain object from an ActionMatch message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch + * @static + * @param {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch} message ActionMatch + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ActionMatch.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.newDocumentWhere = []; + object.originalDocumentWhere = []; + object.ownerIds = []; + } + if (options.defaults) { + object.action = options.enums === String ? "CREATE" : 0; + object.price = null; + } + if (message.action != null && message.hasOwnProperty("action")) + object.action = options.enums === String ? $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.Action[message.action] : message.action; + if (message.newDocumentWhere && message.newDocumentWhere.length) { + object.newDocumentWhere = []; + for (var j = 0; j < message.newDocumentWhere.length; ++j) + object.newDocumentWhere[j] = $root.org.dash.platform.dapi.v0.GetDocumentsRequest.WhereClause.toObject(message.newDocumentWhere[j], options); + } + if (message.originalDocumentWhere && message.originalDocumentWhere.length) { + object.originalDocumentWhere = []; + for (var j = 0; j < message.originalDocumentWhere.length; ++j) + object.originalDocumentWhere[j] = $root.org.dash.platform.dapi.v0.GetDocumentsRequest.WhereClause.toObject(message.originalDocumentWhere[j], options); + } + if (message.ownerIds && message.ownerIds.length) { + object.ownerIds = []; + for (var j = 0; j < message.ownerIds.length; ++j) + object.ownerIds[j] = options.bytes === String ? $util.base64.encode(message.ownerIds[j], 0, message.ownerIds[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.ownerIds[j]) : message.ownerIds[j]; + } + if (message.price != null && message.hasOwnProperty("price")) + object.price = $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.PriceClause.toObject(message.price, options); + return object; + }; + + /** + * Converts this ActionMatch to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch + * @instance + * @returns {Object.} JSON object + */ + ActionMatch.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ActionMatch; + })(); + + return DocumentFilter; + })(); + + SubscribeToStateTransitionsRequest.AddressFilter = (function() { + + /** + * Properties of an AddressFilter. + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest + * @interface IAddressFilter + * @property {Array.|null} [addresses] AddressFilter addresses + * @property {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.Role|null} [role] AddressFilter role + */ + + /** + * Constructs a new AddressFilter. + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest + * @classdesc Represents an AddressFilter. + * @implements IAddressFilter + * @constructor + * @param {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.IAddressFilter=} [properties] Properties to set + */ + function AddressFilter(properties) { + this.addresses = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AddressFilter addresses. + * @member {Array.} addresses + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.AddressFilter + * @instance + */ + AddressFilter.prototype.addresses = $util.emptyArray; + + /** + * AddressFilter role. + * @member {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.Role} role + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.AddressFilter + * @instance + */ + AddressFilter.prototype.role = 0; + + /** + * Creates a new AddressFilter instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.AddressFilter + * @static + * @param {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.IAddressFilter=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.AddressFilter} AddressFilter instance + */ + AddressFilter.create = function create(properties) { + return new AddressFilter(properties); + }; + + /** + * Encodes the specified AddressFilter message. Does not implicitly {@link org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.AddressFilter.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.AddressFilter + * @static + * @param {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.IAddressFilter} message AddressFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AddressFilter.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.addresses != null && message.addresses.length) + for (var i = 0; i < message.addresses.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.addresses[i]); + if (message.role != null && Object.hasOwnProperty.call(message, "role")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.role); + return writer; + }; + + /** + * Encodes the specified AddressFilter message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.AddressFilter.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.AddressFilter + * @static + * @param {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.IAddressFilter} message AddressFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AddressFilter.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AddressFilter message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.AddressFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.AddressFilter} AddressFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AddressFilter.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.AddressFilter(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.addresses && message.addresses.length)) + message.addresses = []; + message.addresses.push(reader.bytes()); + break; + case 2: + message.role = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AddressFilter message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.AddressFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.AddressFilter} AddressFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AddressFilter.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AddressFilter message. + * @function verify + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.AddressFilter + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AddressFilter.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.addresses != null && message.hasOwnProperty("addresses")) { + if (!Array.isArray(message.addresses)) + return "addresses: array expected"; + for (var i = 0; i < message.addresses.length; ++i) + if (!(message.addresses[i] && typeof message.addresses[i].length === "number" || $util.isString(message.addresses[i]))) + return "addresses: buffer[] expected"; + } + if (message.role != null && message.hasOwnProperty("role")) + switch (message.role) { + default: + return "role: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates an AddressFilter message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.AddressFilter + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.AddressFilter} AddressFilter + */ + AddressFilter.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.AddressFilter) + return object; + var message = new $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.AddressFilter(); + if (object.addresses) { + if (!Array.isArray(object.addresses)) + throw TypeError(".org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.AddressFilter.addresses: array expected"); + message.addresses = []; + for (var i = 0; i < object.addresses.length; ++i) + if (typeof object.addresses[i] === "string") + $util.base64.decode(object.addresses[i], message.addresses[i] = $util.newBuffer($util.base64.length(object.addresses[i])), 0); + else if (object.addresses[i].length >= 0) + message.addresses[i] = object.addresses[i]; + } + switch (object.role) { + case "ANY": + case 0: + message.role = 0; + break; + case "SENDER": + case 1: + message.role = 1; + break; + case "RECIPIENT": + case 2: + message.role = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an AddressFilter message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.AddressFilter + * @static + * @param {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.AddressFilter} message AddressFilter + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AddressFilter.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.addresses = []; + if (options.defaults) + object.role = options.enums === String ? "ANY" : 0; + if (message.addresses && message.addresses.length) { + object.addresses = []; + for (var j = 0; j < message.addresses.length; ++j) + object.addresses[j] = options.bytes === String ? $util.base64.encode(message.addresses[j], 0, message.addresses[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.addresses[j]) : message.addresses[j]; + } + if (message.role != null && message.hasOwnProperty("role")) + object.role = options.enums === String ? $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.Role[message.role] : message.role; + return object; + }; + + /** + * Converts this AddressFilter to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.AddressFilter + * @instance + * @returns {Object.} JSON object + */ + AddressFilter.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AddressFilter; + })(); + + SubscribeToStateTransitionsRequest.StateTransitionFilter = (function() { + + /** + * Properties of a StateTransitionFilter. + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest + * @interface IStateTransitionFilter + * @property {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.IDocumentFilter|null} [documents] StateTransitionFilter documents + * @property {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.IAddressFilter|null} [addresses] StateTransitionFilter addresses + */ + + /** + * Constructs a new StateTransitionFilter. + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest + * @classdesc Represents a StateTransitionFilter. + * @implements IStateTransitionFilter + * @constructor + * @param {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.IStateTransitionFilter=} [properties] Properties to set + */ + function StateTransitionFilter(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StateTransitionFilter documents. + * @member {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.IDocumentFilter|null|undefined} documents + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter + * @instance + */ + StateTransitionFilter.prototype.documents = null; + + /** + * StateTransitionFilter addresses. + * @member {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.IAddressFilter|null|undefined} addresses + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter + * @instance + */ + StateTransitionFilter.prototype.addresses = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * StateTransitionFilter filter. + * @member {"documents"|"addresses"|undefined} filter + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter + * @instance + */ + Object.defineProperty(StateTransitionFilter.prototype, "filter", { + get: $util.oneOfGetter($oneOfFields = ["documents", "addresses"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new StateTransitionFilter instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter + * @static + * @param {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.IStateTransitionFilter=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter} StateTransitionFilter instance + */ + StateTransitionFilter.create = function create(properties) { + return new StateTransitionFilter(properties); + }; + + /** + * Encodes the specified StateTransitionFilter message. Does not implicitly {@link org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter + * @static + * @param {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.IStateTransitionFilter} message StateTransitionFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StateTransitionFilter.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.SubscribeToStateTransitionsRequest.DocumentFilter.encode(message.documents, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.addresses != null && Object.hasOwnProperty.call(message, "addresses")) + $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.AddressFilter.encode(message.addresses, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified StateTransitionFilter message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter + * @static + * @param {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.IStateTransitionFilter} message StateTransitionFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StateTransitionFilter.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StateTransitionFilter message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter} StateTransitionFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StateTransitionFilter.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.documents = $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.decode(reader, reader.uint32()); + break; + case 2: + message.addresses = $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.AddressFilter.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StateTransitionFilter message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter} StateTransitionFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StateTransitionFilter.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StateTransitionFilter message. + * @function verify + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StateTransitionFilter.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.documents != null && message.hasOwnProperty("documents")) { + properties.filter = 1; + { + var error = $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.verify(message.documents); + if (error) + return "documents." + error; + } + } + if (message.addresses != null && message.hasOwnProperty("addresses")) { + if (properties.filter === 1) + return "filter: multiple values"; + properties.filter = 1; + { + var error = $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.AddressFilter.verify(message.addresses); + if (error) + return "addresses." + error; + } + } + return null; + }; + + /** + * Creates a StateTransitionFilter message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter} StateTransitionFilter + */ + StateTransitionFilter.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter) + return object; + var message = new $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter(); + if (object.documents != null) { + if (typeof object.documents !== "object") + throw TypeError(".org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter.documents: object expected"); + message.documents = $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.fromObject(object.documents); + } + if (object.addresses != null) { + if (typeof object.addresses !== "object") + throw TypeError(".org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter.addresses: object expected"); + message.addresses = $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.AddressFilter.fromObject(object.addresses); + } + return message; + }; + + /** + * Creates a plain object from a StateTransitionFilter message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter + * @static + * @param {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter} message StateTransitionFilter + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StateTransitionFilter.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.documents != null && message.hasOwnProperty("documents")) { + object.documents = $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.toObject(message.documents, options); + if (options.oneofs) + object.filter = "documents"; + } + if (message.addresses != null && message.hasOwnProperty("addresses")) { + object.addresses = $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.AddressFilter.toObject(message.addresses, options); + if (options.oneofs) + object.filter = "addresses"; + } + return object; + }; + + /** + * Converts this StateTransitionFilter to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter + * @instance + * @returns {Object.} JSON object + */ + StateTransitionFilter.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return StateTransitionFilter; + })(); + + SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0 = (function() { + + /** + * Properties of a SubscribeToStateTransitionsRequestV0. + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest + * @interface ISubscribeToStateTransitionsRequestV0 + * @property {Array.|null} [filters] SubscribeToStateTransitionsRequestV0 filters + * @property {number|Long|null} [fromBlockHeight] SubscribeToStateTransitionsRequestV0 fromBlockHeight + */ + + /** + * Constructs a new SubscribeToStateTransitionsRequestV0. + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest + * @classdesc Represents a SubscribeToStateTransitionsRequestV0. + * @implements ISubscribeToStateTransitionsRequestV0 + * @constructor + * @param {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.ISubscribeToStateTransitionsRequestV0=} [properties] Properties to set + */ + function SubscribeToStateTransitionsRequestV0(properties) { + this.filters = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SubscribeToStateTransitionsRequestV0 filters. + * @member {Array.} filters + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0 + * @instance + */ + SubscribeToStateTransitionsRequestV0.prototype.filters = $util.emptyArray; + + /** + * SubscribeToStateTransitionsRequestV0 fromBlockHeight. + * @member {number|Long} fromBlockHeight + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0 + * @instance + */ + SubscribeToStateTransitionsRequestV0.prototype.fromBlockHeight = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new SubscribeToStateTransitionsRequestV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.ISubscribeToStateTransitionsRequestV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0} SubscribeToStateTransitionsRequestV0 instance + */ + SubscribeToStateTransitionsRequestV0.create = function create(properties) { + return new SubscribeToStateTransitionsRequestV0(properties); + }; + + /** + * Encodes the specified SubscribeToStateTransitionsRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.ISubscribeToStateTransitionsRequestV0} message SubscribeToStateTransitionsRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SubscribeToStateTransitionsRequestV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.filters != null && message.filters.length) + for (var i = 0; i < message.filters.length; ++i) + $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter.encode(message.filters[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.fromBlockHeight != null && Object.hasOwnProperty.call(message, "fromBlockHeight")) + writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.fromBlockHeight); + return writer; + }; + + /** + * Encodes the specified SubscribeToStateTransitionsRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.ISubscribeToStateTransitionsRequestV0} message SubscribeToStateTransitionsRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SubscribeToStateTransitionsRequestV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SubscribeToStateTransitionsRequestV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0} SubscribeToStateTransitionsRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SubscribeToStateTransitionsRequestV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.filters && message.filters.length)) + message.filters = []; + message.filters.push($root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter.decode(reader, reader.uint32())); + break; + case 2: + message.fromBlockHeight = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SubscribeToStateTransitionsRequestV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0} SubscribeToStateTransitionsRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SubscribeToStateTransitionsRequestV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SubscribeToStateTransitionsRequestV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SubscribeToStateTransitionsRequestV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.filters != null && message.hasOwnProperty("filters")) { + if (!Array.isArray(message.filters)) + return "filters: array expected"; + for (var i = 0; i < message.filters.length; ++i) { + var error = $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter.verify(message.filters[i]); + if (error) + return "filters." + error; + } + } + if (message.fromBlockHeight != null && message.hasOwnProperty("fromBlockHeight")) + if (!$util.isInteger(message.fromBlockHeight) && !(message.fromBlockHeight && $util.isInteger(message.fromBlockHeight.low) && $util.isInteger(message.fromBlockHeight.high))) + return "fromBlockHeight: integer|Long expected"; + return null; + }; + + /** + * Creates a SubscribeToStateTransitionsRequestV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0} SubscribeToStateTransitionsRequestV0 + */ + SubscribeToStateTransitionsRequestV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0(); + if (object.filters) { + if (!Array.isArray(object.filters)) + throw TypeError(".org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0.filters: array expected"); + message.filters = []; + for (var i = 0; i < object.filters.length; ++i) { + if (typeof object.filters[i] !== "object") + throw TypeError(".org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0.filters: object expected"); + message.filters[i] = $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter.fromObject(object.filters[i]); + } + } + if (object.fromBlockHeight != null) + if ($util.Long) + (message.fromBlockHeight = $util.Long.fromValue(object.fromBlockHeight)).unsigned = true; + else if (typeof object.fromBlockHeight === "string") + message.fromBlockHeight = parseInt(object.fromBlockHeight, 10); + else if (typeof object.fromBlockHeight === "number") + message.fromBlockHeight = object.fromBlockHeight; + else if (typeof object.fromBlockHeight === "object") + message.fromBlockHeight = new $util.LongBits(object.fromBlockHeight.low >>> 0, object.fromBlockHeight.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from a SubscribeToStateTransitionsRequestV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0} message SubscribeToStateTransitionsRequestV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SubscribeToStateTransitionsRequestV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.filters = []; + if (options.defaults) + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.fromBlockHeight = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.fromBlockHeight = options.longs === String ? "0" : 0; + if (message.filters && message.filters.length) { + object.filters = []; + for (var j = 0; j < message.filters.length; ++j) + object.filters[j] = $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter.toObject(message.filters[j], options); + } + if (message.fromBlockHeight != null && message.hasOwnProperty("fromBlockHeight")) + if (typeof message.fromBlockHeight === "number") + object.fromBlockHeight = options.longs === String ? String(message.fromBlockHeight) : message.fromBlockHeight; + else + object.fromBlockHeight = options.longs === String ? $util.Long.prototype.toString.call(message.fromBlockHeight) : options.longs === Number ? new $util.LongBits(message.fromBlockHeight.low >>> 0, message.fromBlockHeight.high >>> 0).toNumber(true) : message.fromBlockHeight; + return object; + }; + + /** + * Converts this SubscribeToStateTransitionsRequestV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0 + * @instance + * @returns {Object.} JSON object + */ + SubscribeToStateTransitionsRequestV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SubscribeToStateTransitionsRequestV0; + })(); + + return SubscribeToStateTransitionsRequest; + })(); + + v0.SubscribeToStateTransitionsResponse = (function() { + + /** + * Properties of a SubscribeToStateTransitionsResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface ISubscribeToStateTransitionsResponse + * @property {org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.ISubscribeToStateTransitionsResponseV0|null} [v0] SubscribeToStateTransitionsResponse v0 + */ + + /** + * Constructs a new SubscribeToStateTransitionsResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a SubscribeToStateTransitionsResponse. + * @implements ISubscribeToStateTransitionsResponse + * @constructor + * @param {org.dash.platform.dapi.v0.ISubscribeToStateTransitionsResponse=} [properties] Properties to set + */ + function SubscribeToStateTransitionsResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SubscribeToStateTransitionsResponse v0. + * @member {org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.ISubscribeToStateTransitionsResponseV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse + * @instance + */ + SubscribeToStateTransitionsResponse.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SubscribeToStateTransitionsResponse version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse + * @instance + */ + Object.defineProperty(SubscribeToStateTransitionsResponse.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SubscribeToStateTransitionsResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse + * @static + * @param {org.dash.platform.dapi.v0.ISubscribeToStateTransitionsResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse} SubscribeToStateTransitionsResponse instance + */ + SubscribeToStateTransitionsResponse.create = function create(properties) { + return new SubscribeToStateTransitionsResponse(properties); + }; + + /** + * Encodes the specified SubscribeToStateTransitionsResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse + * @static + * @param {org.dash.platform.dapi.v0.ISubscribeToStateTransitionsResponse} message SubscribeToStateTransitionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SubscribeToStateTransitionsResponse.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.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SubscribeToStateTransitionsResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse + * @static + * @param {org.dash.platform.dapi.v0.ISubscribeToStateTransitionsResponse} message SubscribeToStateTransitionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SubscribeToStateTransitionsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SubscribeToStateTransitionsResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse} SubscribeToStateTransitionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SubscribeToStateTransitionsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SubscribeToStateTransitionsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse} SubscribeToStateTransitionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SubscribeToStateTransitionsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SubscribeToStateTransitionsResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SubscribeToStateTransitionsResponse.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.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a SubscribeToStateTransitionsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse} SubscribeToStateTransitionsResponse + */ + SubscribeToStateTransitionsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a SubscribeToStateTransitionsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse + * @static + * @param {org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse} message SubscribeToStateTransitionsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SubscribeToStateTransitionsResponse.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.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this SubscribeToStateTransitionsResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse + * @instance + * @returns {Object.} JSON object + */ + SubscribeToStateTransitionsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0 = (function() { + + /** + * Properties of a SubscribeToStateTransitionsResponseV0. + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse + * @interface ISubscribeToStateTransitionsResponseV0 + * @property {org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.IStateTransitionMatch|null} [stateTransition] SubscribeToStateTransitionsResponseV0 stateTransition + * @property {org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.ICheckpoint|null} [checkpoint] SubscribeToStateTransitionsResponseV0 checkpoint + */ + + /** + * Constructs a new SubscribeToStateTransitionsResponseV0. + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse + * @classdesc Represents a SubscribeToStateTransitionsResponseV0. + * @implements ISubscribeToStateTransitionsResponseV0 + * @constructor + * @param {org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.ISubscribeToStateTransitionsResponseV0=} [properties] Properties to set + */ + function SubscribeToStateTransitionsResponseV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SubscribeToStateTransitionsResponseV0 stateTransition. + * @member {org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.IStateTransitionMatch|null|undefined} stateTransition + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0 + * @instance + */ + SubscribeToStateTransitionsResponseV0.prototype.stateTransition = null; + + /** + * SubscribeToStateTransitionsResponseV0 checkpoint. + * @member {org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.ICheckpoint|null|undefined} checkpoint + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0 + * @instance + */ + SubscribeToStateTransitionsResponseV0.prototype.checkpoint = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SubscribeToStateTransitionsResponseV0 responses. + * @member {"stateTransition"|"checkpoint"|undefined} responses + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0 + * @instance + */ + Object.defineProperty(SubscribeToStateTransitionsResponseV0.prototype, "responses", { + get: $util.oneOfGetter($oneOfFields = ["stateTransition", "checkpoint"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SubscribeToStateTransitionsResponseV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.ISubscribeToStateTransitionsResponseV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0} SubscribeToStateTransitionsResponseV0 instance + */ + SubscribeToStateTransitionsResponseV0.create = function create(properties) { + return new SubscribeToStateTransitionsResponseV0(properties); + }; + + /** + * Encodes the specified SubscribeToStateTransitionsResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.ISubscribeToStateTransitionsResponseV0} message SubscribeToStateTransitionsResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SubscribeToStateTransitionsResponseV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.stateTransition != null && Object.hasOwnProperty.call(message, "stateTransition")) + $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch.encode(message.stateTransition, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.checkpoint != null && Object.hasOwnProperty.call(message, "checkpoint")) + $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.Checkpoint.encode(message.checkpoint, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SubscribeToStateTransitionsResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.ISubscribeToStateTransitionsResponseV0} message SubscribeToStateTransitionsResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SubscribeToStateTransitionsResponseV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SubscribeToStateTransitionsResponseV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0} SubscribeToStateTransitionsResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SubscribeToStateTransitionsResponseV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.stateTransition = $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch.decode(reader, reader.uint32()); + break; + case 2: + message.checkpoint = $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.Checkpoint.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SubscribeToStateTransitionsResponseV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0} SubscribeToStateTransitionsResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SubscribeToStateTransitionsResponseV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SubscribeToStateTransitionsResponseV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SubscribeToStateTransitionsResponseV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.stateTransition != null && message.hasOwnProperty("stateTransition")) { + properties.responses = 1; + { + var error = $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch.verify(message.stateTransition); + if (error) + return "stateTransition." + error; + } + } + if (message.checkpoint != null && message.hasOwnProperty("checkpoint")) { + if (properties.responses === 1) + return "responses: multiple values"; + properties.responses = 1; + { + var error = $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.Checkpoint.verify(message.checkpoint); + if (error) + return "checkpoint." + error; + } + } + return null; + }; + + /** + * Creates a SubscribeToStateTransitionsResponseV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0} SubscribeToStateTransitionsResponseV0 + */ + SubscribeToStateTransitionsResponseV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0(); + if (object.stateTransition != null) { + if (typeof object.stateTransition !== "object") + throw TypeError(".org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.stateTransition: object expected"); + message.stateTransition = $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch.fromObject(object.stateTransition); + } + if (object.checkpoint != null) { + if (typeof object.checkpoint !== "object") + throw TypeError(".org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.checkpoint: object expected"); + message.checkpoint = $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.Checkpoint.fromObject(object.checkpoint); + } + return message; + }; + + /** + * Creates a plain object from a SubscribeToStateTransitionsResponseV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0} message SubscribeToStateTransitionsResponseV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SubscribeToStateTransitionsResponseV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.stateTransition != null && message.hasOwnProperty("stateTransition")) { + object.stateTransition = $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch.toObject(message.stateTransition, options); + if (options.oneofs) + object.responses = "stateTransition"; + } + if (message.checkpoint != null && message.hasOwnProperty("checkpoint")) { + object.checkpoint = $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.Checkpoint.toObject(message.checkpoint, options); + if (options.oneofs) + object.responses = "checkpoint"; + } + return object; + }; + + /** + * Converts this SubscribeToStateTransitionsResponseV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0 + * @instance + * @returns {Object.} JSON object + */ + SubscribeToStateTransitionsResponseV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + SubscribeToStateTransitionsResponseV0.StateTransitionMatch = (function() { + + /** + * Properties of a StateTransitionMatch. + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0 + * @interface IStateTransitionMatch + * @property {number|Long|null} [blockHeight] StateTransitionMatch blockHeight + * @property {number|Long|null} [blockTimeMs] StateTransitionMatch blockTimeMs + * @property {number|null} [protocolVersion] StateTransitionMatch protocolVersion + * @property {Uint8Array|null} [stateTransitionHash] StateTransitionMatch stateTransitionHash + * @property {Uint8Array|null} [stateTransition] StateTransitionMatch stateTransition + * @property {Array.|null} [matchedFilters] StateTransitionMatch matchedFilters + * @property {Array.|null} [matchedBatchPositions] StateTransitionMatch matchedBatchPositions + */ + + /** + * Constructs a new StateTransitionMatch. + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0 + * @classdesc Represents a StateTransitionMatch. + * @implements IStateTransitionMatch + * @constructor + * @param {org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.IStateTransitionMatch=} [properties] Properties to set + */ + function StateTransitionMatch(properties) { + this.matchedFilters = []; + this.matchedBatchPositions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StateTransitionMatch blockHeight. + * @member {number|Long} blockHeight + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch + * @instance + */ + StateTransitionMatch.prototype.blockHeight = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * StateTransitionMatch blockTimeMs. + * @member {number|Long} blockTimeMs + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch + * @instance + */ + StateTransitionMatch.prototype.blockTimeMs = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * StateTransitionMatch protocolVersion. + * @member {number} protocolVersion + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch + * @instance + */ + StateTransitionMatch.prototype.protocolVersion = 0; + + /** + * StateTransitionMatch stateTransitionHash. + * @member {Uint8Array} stateTransitionHash + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch + * @instance + */ + StateTransitionMatch.prototype.stateTransitionHash = $util.newBuffer([]); + + /** + * StateTransitionMatch stateTransition. + * @member {Uint8Array} stateTransition + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch + * @instance + */ + StateTransitionMatch.prototype.stateTransition = $util.newBuffer([]); + + /** + * StateTransitionMatch matchedFilters. + * @member {Array.} matchedFilters + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch + * @instance + */ + StateTransitionMatch.prototype.matchedFilters = $util.emptyArray; + + /** + * StateTransitionMatch matchedBatchPositions. + * @member {Array.} matchedBatchPositions + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch + * @instance + */ + StateTransitionMatch.prototype.matchedBatchPositions = $util.emptyArray; + + /** + * Creates a new StateTransitionMatch instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch + * @static + * @param {org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.IStateTransitionMatch=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch} StateTransitionMatch instance + */ + StateTransitionMatch.create = function create(properties) { + return new StateTransitionMatch(properties); + }; + + /** + * Encodes the specified StateTransitionMatch message. Does not implicitly {@link org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch + * @static + * @param {org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.IStateTransitionMatch} message StateTransitionMatch message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StateTransitionMatch.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.blockHeight != null && Object.hasOwnProperty.call(message, "blockHeight")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.blockHeight); + if (message.blockTimeMs != null && Object.hasOwnProperty.call(message, "blockTimeMs")) + writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.blockTimeMs); + if (message.protocolVersion != null && Object.hasOwnProperty.call(message, "protocolVersion")) + writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.protocolVersion); + if (message.stateTransitionHash != null && Object.hasOwnProperty.call(message, "stateTransitionHash")) + writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.stateTransitionHash); + if (message.stateTransition != null && Object.hasOwnProperty.call(message, "stateTransition")) + writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.stateTransition); + if (message.matchedFilters != null && message.matchedFilters.length) { + writer.uint32(/* id 6, wireType 2 =*/50).fork(); + for (var i = 0; i < message.matchedFilters.length; ++i) + writer.uint32(message.matchedFilters[i]); + writer.ldelim(); + } + if (message.matchedBatchPositions != null && message.matchedBatchPositions.length) { + writer.uint32(/* id 7, wireType 2 =*/58).fork(); + for (var i = 0; i < message.matchedBatchPositions.length; ++i) + writer.uint32(message.matchedBatchPositions[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified StateTransitionMatch message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch + * @static + * @param {org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.IStateTransitionMatch} message StateTransitionMatch message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StateTransitionMatch.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StateTransitionMatch message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch} StateTransitionMatch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StateTransitionMatch.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.blockHeight = reader.uint64(); + break; + case 2: + message.blockTimeMs = reader.uint64(); + break; + case 3: + message.protocolVersion = reader.uint32(); + break; + case 4: + message.stateTransitionHash = reader.bytes(); + break; + case 5: + message.stateTransition = reader.bytes(); + break; + case 6: + if (!(message.matchedFilters && message.matchedFilters.length)) + message.matchedFilters = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.matchedFilters.push(reader.uint32()); + } else + message.matchedFilters.push(reader.uint32()); + break; + case 7: + if (!(message.matchedBatchPositions && message.matchedBatchPositions.length)) + message.matchedBatchPositions = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.matchedBatchPositions.push(reader.uint32()); + } else + message.matchedBatchPositions.push(reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StateTransitionMatch message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch} StateTransitionMatch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StateTransitionMatch.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StateTransitionMatch message. + * @function verify + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StateTransitionMatch.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.blockHeight != null && message.hasOwnProperty("blockHeight")) + if (!$util.isInteger(message.blockHeight) && !(message.blockHeight && $util.isInteger(message.blockHeight.low) && $util.isInteger(message.blockHeight.high))) + return "blockHeight: integer|Long expected"; + if (message.blockTimeMs != null && message.hasOwnProperty("blockTimeMs")) + if (!$util.isInteger(message.blockTimeMs) && !(message.blockTimeMs && $util.isInteger(message.blockTimeMs.low) && $util.isInteger(message.blockTimeMs.high))) + return "blockTimeMs: integer|Long expected"; + if (message.protocolVersion != null && message.hasOwnProperty("protocolVersion")) + if (!$util.isInteger(message.protocolVersion)) + return "protocolVersion: integer 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.stateTransition != null && message.hasOwnProperty("stateTransition")) + if (!(message.stateTransition && typeof message.stateTransition.length === "number" || $util.isString(message.stateTransition))) + return "stateTransition: buffer expected"; + if (message.matchedFilters != null && message.hasOwnProperty("matchedFilters")) { + if (!Array.isArray(message.matchedFilters)) + return "matchedFilters: array expected"; + for (var i = 0; i < message.matchedFilters.length; ++i) + if (!$util.isInteger(message.matchedFilters[i])) + return "matchedFilters: integer[] expected"; + } + if (message.matchedBatchPositions != null && message.hasOwnProperty("matchedBatchPositions")) { + if (!Array.isArray(message.matchedBatchPositions)) + return "matchedBatchPositions: array expected"; + for (var i = 0; i < message.matchedBatchPositions.length; ++i) + if (!$util.isInteger(message.matchedBatchPositions[i])) + return "matchedBatchPositions: integer[] expected"; + } + return null; + }; + + /** + * Creates a StateTransitionMatch message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch} StateTransitionMatch + */ + StateTransitionMatch.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch) + return object; + var message = new $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch(); + if (object.blockHeight != null) + if ($util.Long) + (message.blockHeight = $util.Long.fromValue(object.blockHeight)).unsigned = true; + else if (typeof object.blockHeight === "string") + message.blockHeight = parseInt(object.blockHeight, 10); + else if (typeof object.blockHeight === "number") + message.blockHeight = object.blockHeight; + else if (typeof object.blockHeight === "object") + message.blockHeight = new $util.LongBits(object.blockHeight.low >>> 0, object.blockHeight.high >>> 0).toNumber(true); + if (object.blockTimeMs != null) + if ($util.Long) + (message.blockTimeMs = $util.Long.fromValue(object.blockTimeMs)).unsigned = true; + else if (typeof object.blockTimeMs === "string") + message.blockTimeMs = parseInt(object.blockTimeMs, 10); + else if (typeof object.blockTimeMs === "number") + message.blockTimeMs = object.blockTimeMs; + else if (typeof object.blockTimeMs === "object") + message.blockTimeMs = new $util.LongBits(object.blockTimeMs.low >>> 0, object.blockTimeMs.high >>> 0).toNumber(true); + if (object.protocolVersion != null) + message.protocolVersion = object.protocolVersion >>> 0; + 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.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; + if (object.matchedFilters) { + if (!Array.isArray(object.matchedFilters)) + throw TypeError(".org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch.matchedFilters: array expected"); + message.matchedFilters = []; + for (var i = 0; i < object.matchedFilters.length; ++i) + message.matchedFilters[i] = object.matchedFilters[i] >>> 0; + } + if (object.matchedBatchPositions) { + if (!Array.isArray(object.matchedBatchPositions)) + throw TypeError(".org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch.matchedBatchPositions: array expected"); + message.matchedBatchPositions = []; + for (var i = 0; i < object.matchedBatchPositions.length; ++i) + message.matchedBatchPositions[i] = object.matchedBatchPositions[i] >>> 0; + } + return message; + }; + + /** + * Creates a plain object from a StateTransitionMatch message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch + * @static + * @param {org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch} message StateTransitionMatch + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StateTransitionMatch.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.matchedFilters = []; + object.matchedBatchPositions = []; + } + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.blockHeight = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.blockHeight = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.blockTimeMs = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.blockTimeMs = options.longs === String ? "0" : 0; + object.protocolVersion = 0; + if (options.bytes === String) + object.stateTransitionHash = ""; + else { + object.stateTransitionHash = []; + if (options.bytes !== Array) + object.stateTransitionHash = $util.newBuffer(object.stateTransitionHash); + } + if (options.bytes === String) + object.stateTransition = ""; + else { + object.stateTransition = []; + if (options.bytes !== Array) + object.stateTransition = $util.newBuffer(object.stateTransition); + } + } + if (message.blockHeight != null && message.hasOwnProperty("blockHeight")) + if (typeof message.blockHeight === "number") + object.blockHeight = options.longs === String ? String(message.blockHeight) : message.blockHeight; + else + object.blockHeight = options.longs === String ? $util.Long.prototype.toString.call(message.blockHeight) : options.longs === Number ? new $util.LongBits(message.blockHeight.low >>> 0, message.blockHeight.high >>> 0).toNumber(true) : message.blockHeight; + if (message.blockTimeMs != null && message.hasOwnProperty("blockTimeMs")) + if (typeof message.blockTimeMs === "number") + object.blockTimeMs = options.longs === String ? String(message.blockTimeMs) : message.blockTimeMs; + else + object.blockTimeMs = options.longs === String ? $util.Long.prototype.toString.call(message.blockTimeMs) : options.longs === Number ? new $util.LongBits(message.blockTimeMs.low >>> 0, message.blockTimeMs.high >>> 0).toNumber(true) : message.blockTimeMs; + if (message.protocolVersion != null && message.hasOwnProperty("protocolVersion")) + object.protocolVersion = message.protocolVersion; + 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.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; + if (message.matchedFilters && message.matchedFilters.length) { + object.matchedFilters = []; + for (var j = 0; j < message.matchedFilters.length; ++j) + object.matchedFilters[j] = message.matchedFilters[j]; + } + if (message.matchedBatchPositions && message.matchedBatchPositions.length) { + object.matchedBatchPositions = []; + for (var j = 0; j < message.matchedBatchPositions.length; ++j) + object.matchedBatchPositions[j] = message.matchedBatchPositions[j]; + } + return object; + }; + + /** + * Converts this StateTransitionMatch to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch + * @instance + * @returns {Object.} JSON object + */ + StateTransitionMatch.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return StateTransitionMatch; + })(); + + SubscribeToStateTransitionsResponseV0.Checkpoint = (function() { + + /** + * Properties of a Checkpoint. + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0 + * @interface ICheckpoint + * @property {number|Long|null} [blockHeight] Checkpoint blockHeight + */ + + /** + * Constructs a new Checkpoint. + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0 + * @classdesc Represents a Checkpoint. + * @implements ICheckpoint + * @constructor + * @param {org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.ICheckpoint=} [properties] Properties to set + */ + function Checkpoint(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Checkpoint blockHeight. + * @member {number|Long} blockHeight + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.Checkpoint + * @instance + */ + Checkpoint.prototype.blockHeight = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new Checkpoint instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.Checkpoint + * @static + * @param {org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.ICheckpoint=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.Checkpoint} Checkpoint instance + */ + Checkpoint.create = function create(properties) { + return new Checkpoint(properties); + }; + + /** + * Encodes the specified Checkpoint message. Does not implicitly {@link org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.Checkpoint.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.Checkpoint + * @static + * @param {org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.ICheckpoint} message Checkpoint message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Checkpoint.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.blockHeight != null && Object.hasOwnProperty.call(message, "blockHeight")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.blockHeight); + return writer; + }; + + /** + * Encodes the specified Checkpoint message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.Checkpoint.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.Checkpoint + * @static + * @param {org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.ICheckpoint} message Checkpoint message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Checkpoint.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Checkpoint message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.Checkpoint + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.Checkpoint} Checkpoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Checkpoint.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.Checkpoint(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.blockHeight = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Checkpoint message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.Checkpoint + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.Checkpoint} Checkpoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Checkpoint.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Checkpoint message. + * @function verify + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.Checkpoint + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Checkpoint.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.blockHeight != null && message.hasOwnProperty("blockHeight")) + if (!$util.isInteger(message.blockHeight) && !(message.blockHeight && $util.isInteger(message.blockHeight.low) && $util.isInteger(message.blockHeight.high))) + return "blockHeight: integer|Long expected"; + return null; + }; + + /** + * Creates a Checkpoint message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.Checkpoint + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.Checkpoint} Checkpoint + */ + Checkpoint.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.Checkpoint) + return object; + var message = new $root.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.Checkpoint(); + if (object.blockHeight != null) + if ($util.Long) + (message.blockHeight = $util.Long.fromValue(object.blockHeight)).unsigned = true; + else if (typeof object.blockHeight === "string") + message.blockHeight = parseInt(object.blockHeight, 10); + else if (typeof object.blockHeight === "number") + message.blockHeight = object.blockHeight; + else if (typeof object.blockHeight === "object") + message.blockHeight = new $util.LongBits(object.blockHeight.low >>> 0, object.blockHeight.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from a Checkpoint message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.Checkpoint + * @static + * @param {org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.Checkpoint} message Checkpoint + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Checkpoint.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.blockHeight = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.blockHeight = options.longs === String ? "0" : 0; + if (message.blockHeight != null && message.hasOwnProperty("blockHeight")) + if (typeof message.blockHeight === "number") + object.blockHeight = options.longs === String ? String(message.blockHeight) : message.blockHeight; + else + object.blockHeight = options.longs === String ? $util.Long.prototype.toString.call(message.blockHeight) : options.longs === Number ? new $util.LongBits(message.blockHeight.low >>> 0, message.blockHeight.high >>> 0).toNumber(true) : message.blockHeight; + return object; + }; + + /** + * Converts this Checkpoint to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.Checkpoint + * @instance + * @returns {Object.} JSON object + */ + Checkpoint.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Checkpoint; + })(); + + return SubscribeToStateTransitionsResponseV0; + })(); + + return SubscribeToStateTransitionsResponse; + })(); + return v0; })(); 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 24d96987cdc..45ba767b102 100644 --- a/packages/dapi-grpc/clients/platform/v0/nodejs/platform_protoc.js +++ b/packages/dapi-grpc/clients/platform/v0/nodejs/platform_protoc.js @@ -758,6 +758,23 @@ goog.exportSymbol('proto.org.dash.platform.dapi.v0.SecurityLevelMap', null, { pr goog.exportSymbol('proto.org.dash.platform.dapi.v0.SecurityLevelMap.KeyKindRequestType', null, { proto }); goog.exportSymbol('proto.org.dash.platform.dapi.v0.SpecificKeys', null, { proto }); goog.exportSymbol('proto.org.dash.platform.dapi.v0.StateTransitionBroadcastError', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.AddressFilter', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.Action', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.PriceClause', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.Role', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter.FilterCase', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.VersionCase', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.Checkpoint', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.ResponsesCase', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.VersionCase', null, { proto }); goog.exportSymbol('proto.org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest', null, { proto }); goog.exportSymbol('proto.org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.VersionCase', null, { proto }); goog.exportSymbol('proto.org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0', null, { proto }); @@ -11140,6 +11157,237 @@ if (goog.DEBUG && !COMPILED) { */ proto.org.dash.platform.dapi.v0.GetShieldedNullifiersResponse.GetShieldedNullifiersResponseV0.NullifierStatuses.displayName = 'proto.org.dash.platform.dapi.v0.GetShieldedNullifiersResponse.GetShieldedNullifiersResponseV0.NullifierStatuses'; } +/** + * 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.SubscribeToStateTransitionsRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.oneofGroups_); +}; +goog.inherits(proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.displayName = 'proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest'; +} +/** + * 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.SubscribeToStateTransitionsRequest.DocumentFilter = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.repeatedFields_, null); +}; +goog.inherits(proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.displayName = 'proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter'; +} +/** + * 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.SubscribeToStateTransitionsRequest.DocumentFilter.PriceClause = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.PriceClause, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.PriceClause.displayName = 'proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.PriceClause'; +} +/** + * 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.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch.repeatedFields_, null); +}; +goog.inherits(proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch.displayName = 'proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch'; +} +/** + * 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.SubscribeToStateTransitionsRequest.AddressFilter = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.AddressFilter.repeatedFields_, null); +}; +goog.inherits(proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.AddressFilter, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.AddressFilter.displayName = 'proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.AddressFilter'; +} +/** + * 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.SubscribeToStateTransitionsRequest.StateTransitionFilter = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter.oneofGroups_); +}; +goog.inherits(proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter.displayName = 'proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter'; +} +/** + * 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.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0 = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0.repeatedFields_, null); +}; +goog.inherits(proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0.displayName = 'proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0'; +} +/** + * 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.SubscribeToStateTransitionsResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.oneofGroups_); +}; +goog.inherits(proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.displayName = 'proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse'; +} +/** + * 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.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0 = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.oneofGroups_); +}; +goog.inherits(proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.displayName = 'proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0'; +} +/** + * 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.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch.repeatedFields_, null); +}; +goog.inherits(proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch.displayName = 'proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch'; +} +/** + * 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.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.Checkpoint = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.Checkpoint, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.Checkpoint.displayName = 'proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.Checkpoint'; +} @@ -119936,6 +120184,2690 @@ proto.org.dash.platform.dapi.v0.GetShieldedNullifiersResponse.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.SubscribeToStateTransitionsRequest.oneofGroups_ = [[1]]; + +/** + * @enum {number} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.VersionCase = { + VERSION_NOT_SET: 0, + V0: 1 +}; + +/** + * @return {proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.VersionCase} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.prototype.getVersionCase = function() { + return /** @type {proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.VersionCase} */(jspb.Message.computeOneofCase(this, proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.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.SubscribeToStateTransitionsRequest.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.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.SubscribeToStateTransitionsRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.toObject = function(includeInstance, msg) { + var f, obj = { + v0: (f = msg.getV0()) && proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0.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.SubscribeToStateTransitionsRequest} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest; + return proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.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.SubscribeToStateTransitionsRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.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.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0.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.SubscribeToStateTransitionsRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.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.SubscribeToStateTransitionsRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getV0(); + if (f != null) { + writer.writeMessage( + 1, + f, + proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0.serializeBinaryToWriter + ); + } +}; + + +/** + * @enum {number} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.Role = { + ANY: 0, + SENDER: 1, + RECIPIENT: 2 +}; + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.repeatedFields_ = [3]; + + + +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.SubscribeToStateTransitionsRequest.DocumentFilter.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.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.SubscribeToStateTransitionsRequest.DocumentFilter} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.toObject = function(includeInstance, msg) { + var f, obj = { + dataContractId: msg.getDataContractId_asB64(), + documentTypeName: jspb.Message.getFieldWithDefault(msg, 2, ""), + actionsList: jspb.Message.toObjectList(msg.getActionsList(), + proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch.toObject, includeInstance), + batchOwnerId: msg.getBatchOwnerId_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.SubscribeToStateTransitionsRequest.DocumentFilter} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter; + return proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.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.SubscribeToStateTransitionsRequest.DocumentFilter} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.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.setDataContractId(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setDocumentTypeName(value); + break; + case 3: + var value = new proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch.deserializeBinaryFromReader); + msg.addActions(value); + break; + case 4: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setBatchOwnerId(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.SubscribeToStateTransitionsRequest.DocumentFilter.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.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.SubscribeToStateTransitionsRequest.DocumentFilter} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getDataContractId_asU8(); + if (f.length > 0) { + writer.writeBytes( + 1, + f + ); + } + f = /** @type {string} */ (jspb.Message.getField(message, 2)); + if (f != null) { + writer.writeString( + 2, + f + ); + } + f = message.getActionsList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 3, + f, + proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch.serializeBinaryToWriter + ); + } + f = /** @type {!(string|Uint8Array)} */ (jspb.Message.getField(message, 4)); + if (f != null) { + writer.writeBytes( + 4, + f + ); + } +}; + + +/** + * @enum {number} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.Action = { + CREATE: 0, + REPLACE: 1, + DELETE: 2, + TRANSFER: 3, + UPDATE_PRICE: 4, + PURCHASE: 5 +}; + + + + +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.SubscribeToStateTransitionsRequest.DocumentFilter.PriceClause.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.PriceClause.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.SubscribeToStateTransitionsRequest.DocumentFilter.PriceClause} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.PriceClause.toObject = function(includeInstance, msg) { + var f, obj = { + operator: jspb.Message.getFieldWithDefault(msg, 1, 0), + value: (f = msg.getValue()) && proto.org.dash.platform.dapi.v0.GetDocumentsRequest.DocumentFieldValue.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.SubscribeToStateTransitionsRequest.DocumentFilter.PriceClause} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.PriceClause.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.PriceClause; + return proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.PriceClause.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.SubscribeToStateTransitionsRequest.DocumentFilter.PriceClause} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.PriceClause} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.PriceClause.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!proto.org.dash.platform.dapi.v0.GetDocumentsRequest.WhereOperator} */ (reader.readEnum()); + msg.setOperator(value); + break; + case 2: + var value = new proto.org.dash.platform.dapi.v0.GetDocumentsRequest.DocumentFieldValue; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.GetDocumentsRequest.DocumentFieldValue.deserializeBinaryFromReader); + msg.setValue(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.SubscribeToStateTransitionsRequest.DocumentFilter.PriceClause.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.PriceClause.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.SubscribeToStateTransitionsRequest.DocumentFilter.PriceClause} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.PriceClause.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getOperator(); + if (f !== 0.0) { + writer.writeEnum( + 1, + f + ); + } + f = message.getValue(); + if (f != null) { + writer.writeMessage( + 2, + f, + proto.org.dash.platform.dapi.v0.GetDocumentsRequest.DocumentFieldValue.serializeBinaryToWriter + ); + } +}; + + +/** + * optional GetDocumentsRequest.WhereOperator operator = 1; + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsRequest.WhereOperator} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.PriceClause.prototype.getOperator = function() { + return /** @type {!proto.org.dash.platform.dapi.v0.GetDocumentsRequest.WhereOperator} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** + * @param {!proto.org.dash.platform.dapi.v0.GetDocumentsRequest.WhereOperator} value + * @return {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.PriceClause} returns this + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.PriceClause.prototype.setOperator = function(value) { + return jspb.Message.setProto3EnumField(this, 1, value); +}; + + +/** + * optional GetDocumentsRequest.DocumentFieldValue value = 2; + * @return {?proto.org.dash.platform.dapi.v0.GetDocumentsRequest.DocumentFieldValue} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.PriceClause.prototype.getValue = function() { + return /** @type{?proto.org.dash.platform.dapi.v0.GetDocumentsRequest.DocumentFieldValue} */ ( + jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.GetDocumentsRequest.DocumentFieldValue, 2)); +}; + + +/** + * @param {?proto.org.dash.platform.dapi.v0.GetDocumentsRequest.DocumentFieldValue|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.PriceClause} returns this +*/ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.PriceClause.prototype.setValue = function(value) { + return jspb.Message.setWrapperField(this, 2, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.PriceClause} returns this + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.PriceClause.prototype.clearValue = function() { + return this.setValue(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.PriceClause.prototype.hasValue = function() { + return jspb.Message.getField(this, 2) != null; +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch.repeatedFields_ = [2,3,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.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch.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.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch.toObject = function(includeInstance, msg) { + var f, obj = { + action: jspb.Message.getFieldWithDefault(msg, 1, 0), + newDocumentWhereList: jspb.Message.toObjectList(msg.getNewDocumentWhereList(), + proto.org.dash.platform.dapi.v0.GetDocumentsRequest.WhereClause.toObject, includeInstance), + originalDocumentWhereList: jspb.Message.toObjectList(msg.getOriginalDocumentWhereList(), + proto.org.dash.platform.dapi.v0.GetDocumentsRequest.WhereClause.toObject, includeInstance), + ownerIdsList: msg.getOwnerIdsList_asB64(), + price: (f = msg.getPrice()) && proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.PriceClause.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.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch; + return proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch.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.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.Action} */ (reader.readEnum()); + msg.setAction(value); + break; + case 2: + var value = new proto.org.dash.platform.dapi.v0.GetDocumentsRequest.WhereClause; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.GetDocumentsRequest.WhereClause.deserializeBinaryFromReader); + msg.addNewDocumentWhere(value); + break; + case 3: + var value = new proto.org.dash.platform.dapi.v0.GetDocumentsRequest.WhereClause; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.GetDocumentsRequest.WhereClause.deserializeBinaryFromReader); + msg.addOriginalDocumentWhere(value); + break; + case 4: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.addOwnerIds(value); + break; + case 5: + var value = new proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.PriceClause; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.PriceClause.deserializeBinaryFromReader); + msg.setPrice(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.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch.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.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = /** @type {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.Action} */ (jspb.Message.getField(message, 1)); + if (f != null) { + writer.writeEnum( + 1, + f + ); + } + f = message.getNewDocumentWhereList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 2, + f, + proto.org.dash.platform.dapi.v0.GetDocumentsRequest.WhereClause.serializeBinaryToWriter + ); + } + f = message.getOriginalDocumentWhereList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 3, + f, + proto.org.dash.platform.dapi.v0.GetDocumentsRequest.WhereClause.serializeBinaryToWriter + ); + } + f = message.getOwnerIdsList_asU8(); + if (f.length > 0) { + writer.writeRepeatedBytes( + 4, + f + ); + } + f = message.getPrice(); + if (f != null) { + writer.writeMessage( + 5, + f, + proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.PriceClause.serializeBinaryToWriter + ); + } +}; + + +/** + * optional Action action = 1; + * @return {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.Action} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch.prototype.getAction = function() { + return /** @type {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.Action} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** + * @param {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.Action} value + * @return {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch} returns this + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch.prototype.setAction = function(value) { + return jspb.Message.setField(this, 1, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch} returns this + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch.prototype.clearAction = function() { + return jspb.Message.setField(this, 1, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch.prototype.hasAction = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * repeated GetDocumentsRequest.WhereClause new_document_where = 2; + * @return {!Array} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch.prototype.getNewDocumentWhereList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.org.dash.platform.dapi.v0.GetDocumentsRequest.WhereClause, 2)); +}; + + +/** + * @param {!Array} value + * @return {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch} returns this +*/ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch.prototype.setNewDocumentWhereList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 2, value); +}; + + +/** + * @param {!proto.org.dash.platform.dapi.v0.GetDocumentsRequest.WhereClause=} opt_value + * @param {number=} opt_index + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsRequest.WhereClause} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch.prototype.addNewDocumentWhere = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 2, opt_value, proto.org.dash.platform.dapi.v0.GetDocumentsRequest.WhereClause, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch} returns this + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch.prototype.clearNewDocumentWhereList = function() { + return this.setNewDocumentWhereList([]); +}; + + +/** + * repeated GetDocumentsRequest.WhereClause original_document_where = 3; + * @return {!Array} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch.prototype.getOriginalDocumentWhereList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.org.dash.platform.dapi.v0.GetDocumentsRequest.WhereClause, 3)); +}; + + +/** + * @param {!Array} value + * @return {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch} returns this +*/ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch.prototype.setOriginalDocumentWhereList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 3, value); +}; + + +/** + * @param {!proto.org.dash.platform.dapi.v0.GetDocumentsRequest.WhereClause=} opt_value + * @param {number=} opt_index + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsRequest.WhereClause} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch.prototype.addOriginalDocumentWhere = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 3, opt_value, proto.org.dash.platform.dapi.v0.GetDocumentsRequest.WhereClause, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch} returns this + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch.prototype.clearOriginalDocumentWhereList = function() { + return this.setOriginalDocumentWhereList([]); +}; + + +/** + * repeated bytes owner_ids = 4; + * @return {!Array} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch.prototype.getOwnerIdsList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 4)); +}; + + +/** + * repeated bytes owner_ids = 4; + * This is a type-conversion wrapper around `getOwnerIdsList()` + * @return {!Array} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch.prototype.getOwnerIdsList_asB64 = function() { + return /** @type {!Array} */ (jspb.Message.bytesListAsB64( + this.getOwnerIdsList())); +}; + + +/** + * repeated bytes owner_ids = 4; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getOwnerIdsList()` + * @return {!Array} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch.prototype.getOwnerIdsList_asU8 = function() { + return /** @type {!Array} */ (jspb.Message.bytesListAsU8( + this.getOwnerIdsList())); +}; + + +/** + * @param {!(Array|Array)} value + * @return {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch} returns this + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch.prototype.setOwnerIdsList = function(value) { + return jspb.Message.setField(this, 4, value || []); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @param {number=} opt_index + * @return {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch} returns this + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch.prototype.addOwnerIds = 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.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch} returns this + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch.prototype.clearOwnerIdsList = function() { + return this.setOwnerIdsList([]); +}; + + +/** + * optional PriceClause price = 5; + * @return {?proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.PriceClause} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch.prototype.getPrice = function() { + return /** @type{?proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.PriceClause} */ ( + jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.PriceClause, 5)); +}; + + +/** + * @param {?proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.PriceClause|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch} returns this +*/ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch.prototype.setPrice = function(value) { + return jspb.Message.setWrapperField(this, 5, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch} returns this + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch.prototype.clearPrice = function() { + return this.setPrice(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch.prototype.hasPrice = function() { + return jspb.Message.getField(this, 5) != null; +}; + + +/** + * optional bytes data_contract_id = 1; + * @return {string} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.prototype.getDataContractId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * optional bytes data_contract_id = 1; + * This is a type-conversion wrapper around `getDataContractId()` + * @return {string} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.prototype.getDataContractId_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getDataContractId())); +}; + + +/** + * optional bytes data_contract_id = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getDataContractId()` + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.prototype.getDataContractId_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getDataContractId())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter} returns this + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.prototype.setDataContractId = function(value) { + return jspb.Message.setProto3BytesField(this, 1, value); +}; + + +/** + * optional string document_type_name = 2; + * @return {string} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.prototype.getDocumentTypeName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter} returns this + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.prototype.setDocumentTypeName = function(value) { + return jspb.Message.setField(this, 2, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter} returns this + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.prototype.clearDocumentTypeName = function() { + return jspb.Message.setField(this, 2, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.prototype.hasDocumentTypeName = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * repeated ActionMatch actions = 3; + * @return {!Array} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.prototype.getActionsList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch, 3)); +}; + + +/** + * @param {!Array} value + * @return {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter} returns this +*/ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.prototype.setActionsList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 3, value); +}; + + +/** + * @param {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch=} opt_value + * @param {number=} opt_index + * @return {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.prototype.addActions = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 3, opt_value, proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter} returns this + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.prototype.clearActionsList = function() { + return this.setActionsList([]); +}; + + +/** + * optional bytes batch_owner_id = 4; + * @return {string} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.prototype.getBatchOwnerId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")); +}; + + +/** + * optional bytes batch_owner_id = 4; + * This is a type-conversion wrapper around `getBatchOwnerId()` + * @return {string} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.prototype.getBatchOwnerId_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getBatchOwnerId())); +}; + + +/** + * optional bytes batch_owner_id = 4; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getBatchOwnerId()` + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.prototype.getBatchOwnerId_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getBatchOwnerId())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter} returns this + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.prototype.setBatchOwnerId = function(value) { + return jspb.Message.setField(this, 4, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter} returns this + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.prototype.clearBatchOwnerId = function() { + return jspb.Message.setField(this, 4, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.prototype.hasBatchOwnerId = function() { + return jspb.Message.getField(this, 4) != null; +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.AddressFilter.repeatedFields_ = [1]; + + + +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.SubscribeToStateTransitionsRequest.AddressFilter.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.AddressFilter.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.SubscribeToStateTransitionsRequest.AddressFilter} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.AddressFilter.toObject = function(includeInstance, msg) { + var f, obj = { + addressesList: msg.getAddressesList_asB64(), + role: 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.SubscribeToStateTransitionsRequest.AddressFilter} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.AddressFilter.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.AddressFilter; + return proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.AddressFilter.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.SubscribeToStateTransitionsRequest.AddressFilter} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.AddressFilter} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.AddressFilter.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.addAddresses(value); + break; + case 2: + var value = /** @type {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.Role} */ (reader.readEnum()); + msg.setRole(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.SubscribeToStateTransitionsRequest.AddressFilter.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.AddressFilter.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.SubscribeToStateTransitionsRequest.AddressFilter} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.AddressFilter.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getAddressesList_asU8(); + if (f.length > 0) { + writer.writeRepeatedBytes( + 1, + f + ); + } + f = message.getRole(); + if (f !== 0.0) { + writer.writeEnum( + 2, + f + ); + } +}; + + +/** + * repeated bytes addresses = 1; + * @return {!Array} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.AddressFilter.prototype.getAddressesList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 1)); +}; + + +/** + * repeated bytes addresses = 1; + * This is a type-conversion wrapper around `getAddressesList()` + * @return {!Array} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.AddressFilter.prototype.getAddressesList_asB64 = function() { + return /** @type {!Array} */ (jspb.Message.bytesListAsB64( + this.getAddressesList())); +}; + + +/** + * repeated bytes addresses = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getAddressesList()` + * @return {!Array} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.AddressFilter.prototype.getAddressesList_asU8 = function() { + return /** @type {!Array} */ (jspb.Message.bytesListAsU8( + this.getAddressesList())); +}; + + +/** + * @param {!(Array|Array)} value + * @return {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.AddressFilter} returns this + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.AddressFilter.prototype.setAddressesList = function(value) { + return jspb.Message.setField(this, 1, value || []); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @param {number=} opt_index + * @return {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.AddressFilter} returns this + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.AddressFilter.prototype.addAddresses = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 1, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.AddressFilter} returns this + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.AddressFilter.prototype.clearAddressesList = function() { + return this.setAddressesList([]); +}; + + +/** + * optional Role role = 2; + * @return {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.Role} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.AddressFilter.prototype.getRole = function() { + return /** @type {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.Role} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +}; + + +/** + * @param {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.Role} value + * @return {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.AddressFilter} returns this + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.AddressFilter.prototype.setRole = function(value) { + return jspb.Message.setProto3EnumField(this, 2, 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.SubscribeToStateTransitionsRequest.StateTransitionFilter.oneofGroups_ = [[1,2]]; + +/** + * @enum {number} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter.FilterCase = { + FILTER_NOT_SET: 0, + DOCUMENTS: 1, + ADDRESSES: 2 +}; + +/** + * @return {proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter.FilterCase} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter.prototype.getFilterCase = function() { + return /** @type {proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter.FilterCase} */(jspb.Message.computeOneofCase(this, proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter.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.SubscribeToStateTransitionsRequest.StateTransitionFilter.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter.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.SubscribeToStateTransitionsRequest.StateTransitionFilter} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter.toObject = function(includeInstance, msg) { + var f, obj = { + documents: (f = msg.getDocuments()) && proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.toObject(includeInstance, f), + addresses: (f = msg.getAddresses()) && proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.AddressFilter.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.SubscribeToStateTransitionsRequest.StateTransitionFilter} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter; + return proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter.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.SubscribeToStateTransitionsRequest.StateTransitionFilter} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter.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.SubscribeToStateTransitionsRequest.DocumentFilter; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.deserializeBinaryFromReader); + msg.setDocuments(value); + break; + case 2: + var value = new proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.AddressFilter; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.AddressFilter.deserializeBinaryFromReader); + msg.setAddresses(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.SubscribeToStateTransitionsRequest.StateTransitionFilter.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter.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.SubscribeToStateTransitionsRequest.StateTransitionFilter} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getDocuments(); + if (f != null) { + writer.writeMessage( + 1, + f, + proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.serializeBinaryToWriter + ); + } + f = message.getAddresses(); + if (f != null) { + writer.writeMessage( + 2, + f, + proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.AddressFilter.serializeBinaryToWriter + ); + } +}; + + +/** + * optional DocumentFilter documents = 1; + * @return {?proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter.prototype.getDocuments = function() { + return /** @type{?proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter} */ ( + jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter, 1)); +}; + + +/** + * @param {?proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter} returns this +*/ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter.prototype.setDocuments = function(value) { + return jspb.Message.setOneofWrapperField(this, 1, proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter} returns this + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter.prototype.clearDocuments = function() { + return this.setDocuments(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter.prototype.hasDocuments = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * optional AddressFilter addresses = 2; + * @return {?proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.AddressFilter} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter.prototype.getAddresses = function() { + return /** @type{?proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.AddressFilter} */ ( + jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.AddressFilter, 2)); +}; + + +/** + * @param {?proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.AddressFilter|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter} returns this +*/ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter.prototype.setAddresses = function(value) { + return jspb.Message.setOneofWrapperField(this, 2, proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter} returns this + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter.prototype.clearAddresses = function() { + return this.setAddresses(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter.prototype.hasAddresses = function() { + return jspb.Message.getField(this, 2) != null; +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0.repeatedFields_ = [1]; + + + +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.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0.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.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0.toObject = function(includeInstance, msg) { + var f, obj = { + filtersList: jspb.Message.toObjectList(msg.getFiltersList(), + proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter.toObject, includeInstance), + fromBlockHeight: 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.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0; + return proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0.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.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0.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.SubscribeToStateTransitionsRequest.StateTransitionFilter; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter.deserializeBinaryFromReader); + msg.addFilters(value); + break; + case 2: + var value = /** @type {string} */ (reader.readUint64String()); + msg.setFromBlockHeight(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.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0.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.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getFiltersList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 1, + f, + proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter.serializeBinaryToWriter + ); + } + f = /** @type {string} */ (jspb.Message.getField(message, 2)); + if (f != null) { + writer.writeUint64String( + 2, + f + ); + } +}; + + +/** + * repeated StateTransitionFilter filters = 1; + * @return {!Array} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0.prototype.getFiltersList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter, 1)); +}; + + +/** + * @param {!Array} value + * @return {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0} returns this +*/ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0.prototype.setFiltersList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 1, value); +}; + + +/** + * @param {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter=} opt_value + * @param {number=} opt_index + * @return {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0.prototype.addFilters = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0} returns this + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0.prototype.clearFiltersList = function() { + return this.setFiltersList([]); +}; + + +/** + * optional uint64 from_block_height = 2; + * @return {string} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0.prototype.getFromBlockHeight = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "0")); +}; + + +/** + * @param {string} value + * @return {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0} returns this + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0.prototype.setFromBlockHeight = function(value) { + return jspb.Message.setField(this, 2, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0} returns this + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0.prototype.clearFromBlockHeight = function() { + return jspb.Message.setField(this, 2, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0.prototype.hasFromBlockHeight = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * optional SubscribeToStateTransitionsRequestV0 v0 = 1; + * @return {?proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.prototype.getV0 = function() { + return /** @type{?proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0} */ ( + jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0, 1)); +}; + + +/** + * @param {?proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest} returns this +*/ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.prototype.setV0 = function(value) { + return jspb.Message.setOneofWrapperField(this, 1, proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest} returns this + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.prototype.clearV0 = function() { + return this.setV0(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.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.SubscribeToStateTransitionsResponse.oneofGroups_ = [[1]]; + +/** + * @enum {number} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.VersionCase = { + VERSION_NOT_SET: 0, + V0: 1 +}; + +/** + * @return {proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.VersionCase} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.prototype.getVersionCase = function() { + return /** @type {proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.VersionCase} */(jspb.Message.computeOneofCase(this, proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.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.SubscribeToStateTransitionsResponse.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.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.SubscribeToStateTransitionsResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.toObject = function(includeInstance, msg) { + var f, obj = { + v0: (f = msg.getV0()) && proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.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.SubscribeToStateTransitionsResponse} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse; + return proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.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.SubscribeToStateTransitionsResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.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.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.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.SubscribeToStateTransitionsResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.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.SubscribeToStateTransitionsResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getV0(); + if (f != null) { + writer.writeMessage( + 1, + f, + proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.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.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.oneofGroups_ = [[1,2]]; + +/** + * @enum {number} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.ResponsesCase = { + RESPONSES_NOT_SET: 0, + STATE_TRANSITION: 1, + CHECKPOINT: 2 +}; + +/** + * @return {proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.ResponsesCase} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.prototype.getResponsesCase = function() { + return /** @type {proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.ResponsesCase} */(jspb.Message.computeOneofCase(this, proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.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.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.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.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.toObject = function(includeInstance, msg) { + var f, obj = { + stateTransition: (f = msg.getStateTransition()) && proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch.toObject(includeInstance, f), + checkpoint: (f = msg.getCheckpoint()) && proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.Checkpoint.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.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0; + return proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.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.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.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.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch.deserializeBinaryFromReader); + msg.setStateTransition(value); + break; + case 2: + var value = new proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.Checkpoint; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.Checkpoint.deserializeBinaryFromReader); + msg.setCheckpoint(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.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.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.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getStateTransition(); + if (f != null) { + writer.writeMessage( + 1, + f, + proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch.serializeBinaryToWriter + ); + } + f = message.getCheckpoint(); + if (f != null) { + writer.writeMessage( + 2, + f, + proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.Checkpoint.serializeBinaryToWriter + ); + } +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch.repeatedFields_ = [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.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch.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.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch.toObject = function(includeInstance, msg) { + var f, obj = { + blockHeight: jspb.Message.getFieldWithDefault(msg, 1, "0"), + blockTimeMs: jspb.Message.getFieldWithDefault(msg, 2, "0"), + protocolVersion: jspb.Message.getFieldWithDefault(msg, 3, 0), + stateTransitionHash: msg.getStateTransitionHash_asB64(), + stateTransition: msg.getStateTransition_asB64(), + matchedFiltersList: (f = jspb.Message.getRepeatedField(msg, 6)) == null ? undefined : f, + matchedBatchPositionsList: (f = jspb.Message.getRepeatedField(msg, 7)) == null ? undefined : 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.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch; + return proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch.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.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readUint64String()); + msg.setBlockHeight(value); + break; + case 2: + var value = /** @type {string} */ (reader.readUint64String()); + msg.setBlockTimeMs(value); + break; + case 3: + var value = /** @type {number} */ (reader.readUint32()); + msg.setProtocolVersion(value); + break; + case 4: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setStateTransitionHash(value); + break; + case 5: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setStateTransition(value); + break; + case 6: + var values = /** @type {!Array} */ (reader.isDelimited() ? reader.readPackedUint32() : [reader.readUint32()]); + for (var i = 0; i < values.length; i++) { + msg.addMatchedFilters(values[i]); + } + break; + case 7: + var values = /** @type {!Array} */ (reader.isDelimited() ? reader.readPackedUint32() : [reader.readUint32()]); + for (var i = 0; i < values.length; i++) { + msg.addMatchedBatchPositions(values[i]); + } + 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.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch.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.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getBlockHeight(); + if (parseInt(f, 10) !== 0) { + writer.writeUint64String( + 1, + f + ); + } + f = message.getBlockTimeMs(); + if (parseInt(f, 10) !== 0) { + writer.writeUint64String( + 2, + f + ); + } + f = message.getProtocolVersion(); + if (f !== 0) { + writer.writeUint32( + 3, + f + ); + } + f = message.getStateTransitionHash_asU8(); + if (f.length > 0) { + writer.writeBytes( + 4, + f + ); + } + f = message.getStateTransition_asU8(); + if (f.length > 0) { + writer.writeBytes( + 5, + f + ); + } + f = message.getMatchedFiltersList(); + if (f.length > 0) { + writer.writePackedUint32( + 6, + f + ); + } + f = message.getMatchedBatchPositionsList(); + if (f.length > 0) { + writer.writePackedUint32( + 7, + f + ); + } +}; + + +/** + * optional uint64 block_height = 1; + * @return {string} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch.prototype.getBlockHeight = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "0")); +}; + + +/** + * @param {string} value + * @return {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch} returns this + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch.prototype.setBlockHeight = function(value) { + return jspb.Message.setProto3StringIntField(this, 1, value); +}; + + +/** + * optional uint64 block_time_ms = 2; + * @return {string} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch.prototype.getBlockTimeMs = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "0")); +}; + + +/** + * @param {string} value + * @return {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch} returns this + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch.prototype.setBlockTimeMs = function(value) { + return jspb.Message.setProto3StringIntField(this, 2, value); +}; + + +/** + * optional uint32 protocol_version = 3; + * @return {number} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch.prototype.getProtocolVersion = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch} returns this + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch.prototype.setProtocolVersion = function(value) { + return jspb.Message.setProto3IntField(this, 3, value); +}; + + +/** + * optional bytes state_transition_hash = 4; + * @return {string} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch.prototype.getStateTransitionHash = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")); +}; + + +/** + * optional bytes state_transition_hash = 4; + * This is a type-conversion wrapper around `getStateTransitionHash()` + * @return {string} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch.prototype.getStateTransitionHash_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getStateTransitionHash())); +}; + + +/** + * optional bytes state_transition_hash = 4; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getStateTransitionHash()` + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch.prototype.getStateTransitionHash_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getStateTransitionHash())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch} returns this + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch.prototype.setStateTransitionHash = function(value) { + return jspb.Message.setProto3BytesField(this, 4, value); +}; + + +/** + * optional bytes state_transition = 5; + * @return {string} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch.prototype.getStateTransition = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 5, "")); +}; + + +/** + * optional bytes state_transition = 5; + * This is a type-conversion wrapper around `getStateTransition()` + * @return {string} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch.prototype.getStateTransition_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getStateTransition())); +}; + + +/** + * optional bytes state_transition = 5; + * 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.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch.prototype.getStateTransition_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getStateTransition())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch} returns this + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch.prototype.setStateTransition = function(value) { + return jspb.Message.setProto3BytesField(this, 5, value); +}; + + +/** + * repeated uint32 matched_filters = 6; + * @return {!Array} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch.prototype.getMatchedFiltersList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 6)); +}; + + +/** + * @param {!Array} value + * @return {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch} returns this + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch.prototype.setMatchedFiltersList = function(value) { + return jspb.Message.setField(this, 6, value || []); +}; + + +/** + * @param {number} value + * @param {number=} opt_index + * @return {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch} returns this + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch.prototype.addMatchedFilters = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 6, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch} returns this + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch.prototype.clearMatchedFiltersList = function() { + return this.setMatchedFiltersList([]); +}; + + +/** + * repeated uint32 matched_batch_positions = 7; + * @return {!Array} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch.prototype.getMatchedBatchPositionsList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 7)); +}; + + +/** + * @param {!Array} value + * @return {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch} returns this + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch.prototype.setMatchedBatchPositionsList = function(value) { + return jspb.Message.setField(this, 7, value || []); +}; + + +/** + * @param {number} value + * @param {number=} opt_index + * @return {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch} returns this + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch.prototype.addMatchedBatchPositions = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 7, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch} returns this + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch.prototype.clearMatchedBatchPositionsList = function() { + return this.setMatchedBatchPositionsList([]); +}; + + + + + +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.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.Checkpoint.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.Checkpoint.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.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.Checkpoint} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.Checkpoint.toObject = function(includeInstance, msg) { + var f, obj = { + blockHeight: jspb.Message.getFieldWithDefault(msg, 1, "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.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.Checkpoint} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.Checkpoint.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.Checkpoint; + return proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.Checkpoint.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.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.Checkpoint} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.Checkpoint} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.Checkpoint.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readUint64String()); + msg.setBlockHeight(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.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.Checkpoint.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.Checkpoint.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.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.Checkpoint} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.Checkpoint.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getBlockHeight(); + if (parseInt(f, 10) !== 0) { + writer.writeUint64String( + 1, + f + ); + } +}; + + +/** + * optional uint64 block_height = 1; + * @return {string} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.Checkpoint.prototype.getBlockHeight = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "0")); +}; + + +/** + * @param {string} value + * @return {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.Checkpoint} returns this + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.Checkpoint.prototype.setBlockHeight = function(value) { + return jspb.Message.setProto3StringIntField(this, 1, value); +}; + + +/** + * optional StateTransitionMatch state_transition = 1; + * @return {?proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.prototype.getStateTransition = function() { + return /** @type{?proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch} */ ( + jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch, 1)); +}; + + +/** + * @param {?proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0} returns this +*/ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.prototype.setStateTransition = function(value) { + return jspb.Message.setOneofWrapperField(this, 1, proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0} returns this + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.prototype.clearStateTransition = function() { + return this.setStateTransition(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.prototype.hasStateTransition = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * optional Checkpoint checkpoint = 2; + * @return {?proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.Checkpoint} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.prototype.getCheckpoint = function() { + return /** @type{?proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.Checkpoint} */ ( + jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.Checkpoint, 2)); +}; + + +/** + * @param {?proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.Checkpoint|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0} returns this +*/ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.prototype.setCheckpoint = function(value) { + return jspb.Message.setOneofWrapperField(this, 2, proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0} returns this + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.prototype.clearCheckpoint = function() { + return this.setCheckpoint(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.prototype.hasCheckpoint = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * optional SubscribeToStateTransitionsResponseV0 v0 = 1; + * @return {?proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.prototype.getV0 = function() { + return /** @type{?proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0} */ ( + jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0, 1)); +}; + + +/** + * @param {?proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse} returns this +*/ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.prototype.setV0 = function(value) { + return jspb.Message.setOneofWrapperField(this, 1, proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse} returns this + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.prototype.clearV0 = function() { + return this.setV0(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.prototype.hasV0 = function() { + return jspb.Message.getField(this, 1) != null; +}; + + /** * @enum {number} */ 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 084c14c41f3..c587424be80 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 @@ -374,6 +374,15 @@ CF_EXTERN_C_BEGIN @class SecurityLevelMap; @class SpecificKeys; @class StateTransitionBroadcastError; +@class SubscribeToStateTransitionsRequest_AddressFilter; +@class SubscribeToStateTransitionsRequest_DocumentFilter; +@class SubscribeToStateTransitionsRequest_DocumentFilter_ActionMatch; +@class SubscribeToStateTransitionsRequest_DocumentFilter_PriceClause; +@class SubscribeToStateTransitionsRequest_StateTransitionFilter; +@class SubscribeToStateTransitionsRequest_SubscribeToStateTransitionsRequestV0; +@class SubscribeToStateTransitionsResponse_SubscribeToStateTransitionsResponseV0; +@class SubscribeToStateTransitionsResponse_SubscribeToStateTransitionsResponseV0_Checkpoint; +@class SubscribeToStateTransitionsResponse_SubscribeToStateTransitionsResponseV0_StateTransitionMatch; @class WaitForStateTransitionResultRequest_WaitForStateTransitionResultRequestV0; @class WaitForStateTransitionResultResponse_SuccessWithOwnerBalance; @class WaitForStateTransitionResultResponse_WaitForStateTransitionResultResponseV0; @@ -875,6 +884,61 @@ GPBEnumDescriptor *GetGroupActionSignersRequest_ActionStatus_EnumDescriptor(void **/ BOOL GetGroupActionSignersRequest_ActionStatus_IsValidValue(int32_t value); +#pragma mark - Enum SubscribeToStateTransitionsRequest_Role + +/** Which side of a transition a watched address must be on. */ +typedef GPB_ENUM(SubscribeToStateTransitionsRequest_Role) { + /** + * 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. + **/ + SubscribeToStateTransitionsRequest_Role_GPBUnrecognizedEnumeratorValue = kGPBUnrecognizedEnumeratorValue, + /** Either side. */ + SubscribeToStateTransitionsRequest_Role_Any = 0, + + /** An address input the transition spends from. */ + SubscribeToStateTransitionsRequest_Role_Sender = 1, + + /** An address the transition credits: an output or change output. */ + SubscribeToStateTransitionsRequest_Role_Recipient = 2, +}; + +GPBEnumDescriptor *SubscribeToStateTransitionsRequest_Role_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 SubscribeToStateTransitionsRequest_Role_IsValidValue(int32_t value); + +#pragma mark - Enum SubscribeToStateTransitionsRequest_DocumentFilter_Action + +typedef GPB_ENUM(SubscribeToStateTransitionsRequest_DocumentFilter_Action) { + /** + * 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. + **/ + SubscribeToStateTransitionsRequest_DocumentFilter_Action_GPBUnrecognizedEnumeratorValue = kGPBUnrecognizedEnumeratorValue, + SubscribeToStateTransitionsRequest_DocumentFilter_Action_Create = 0, + SubscribeToStateTransitionsRequest_DocumentFilter_Action_Replace = 1, + + /** Also matches the delete of an indexOnly document. */ + SubscribeToStateTransitionsRequest_DocumentFilter_Action_Delete = 2, + SubscribeToStateTransitionsRequest_DocumentFilter_Action_Transfer = 3, + SubscribeToStateTransitionsRequest_DocumentFilter_Action_UpdatePrice = 4, + SubscribeToStateTransitionsRequest_DocumentFilter_Action_Purchase = 5, +}; + +GPBEnumDescriptor *SubscribeToStateTransitionsRequest_DocumentFilter_Action_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 SubscribeToStateTransitionsRequest_DocumentFilter_Action_IsValidValue(int32_t value); + #pragma mark - PlatformRoot /** @@ -14179,6 +14243,385 @@ GPB_FINAL @interface GetShieldedNullifiersResponse_GetShieldedNullifiersResponse @end +#pragma mark - SubscribeToStateTransitionsRequest + +typedef GPB_ENUM(SubscribeToStateTransitionsRequest_FieldNumber) { + SubscribeToStateTransitionsRequest_FieldNumber_V0 = 1, +}; + +typedef GPB_ENUM(SubscribeToStateTransitionsRequest_Version_OneOfCase) { + SubscribeToStateTransitionsRequest_Version_OneOfCase_GPBUnsetOneOfCase = 0, + SubscribeToStateTransitionsRequest_Version_OneOfCase_V0 = 1, +}; + +/** + * Subscription to committed state transitions. + * + * A transition is delivered when it executed successfully and ANY of the + * filters matches it; within one filter every given constraint must hold. + * Matching reads only the transition itself: what it names, not state it + * changed. Nothing is known about a document before the transition changed it + * beyond its `$id`. + **/ +GPB_FINAL @interface SubscribeToStateTransitionsRequest : GPBMessage + +@property(nonatomic, readonly) SubscribeToStateTransitionsRequest_Version_OneOfCase versionOneOfCase; + +@property(nonatomic, readwrite, strong, null_resettable) SubscribeToStateTransitionsRequest_SubscribeToStateTransitionsRequestV0 *v0; + +@end + +/** + * Clears whatever value was set for the oneof 'version'. + **/ +void SubscribeToStateTransitionsRequest_ClearVersionOneOfCase(SubscribeToStateTransitionsRequest *message); + +#pragma mark - SubscribeToStateTransitionsRequest_DocumentFilter + +typedef GPB_ENUM(SubscribeToStateTransitionsRequest_DocumentFilter_FieldNumber) { + SubscribeToStateTransitionsRequest_DocumentFilter_FieldNumber_DataContractId = 1, + SubscribeToStateTransitionsRequest_DocumentFilter_FieldNumber_DocumentTypeName = 2, + SubscribeToStateTransitionsRequest_DocumentFilter_FieldNumber_ActionsArray = 3, + SubscribeToStateTransitionsRequest_DocumentFilter_FieldNumber_BatchOwnerId = 4, +}; + +/** + * Document transitions, in batch transitions, on one data contract. + **/ +GPB_FINAL @interface SubscribeToStateTransitionsRequest_DocumentFilter : GPBMessage + +@property(nonatomic, readwrite, copy, null_resettable) NSData *dataContractId; + +/** + * Unset: every document type of the contract; `actions` must then carry + * no clauses. + **/ +@property(nonatomic, readwrite, copy, null_resettable) NSString *documentTypeName; +/** Test to see if @c documentTypeName has been set. */ +@property(nonatomic, readwrite) BOOL hasDocumentTypeName; + +/** Empty: every action. */ +@property(nonatomic, readwrite, strong, null_resettable) NSMutableArray *actionsArray; +/** The number of items in @c actionsArray without causing the array to be created. */ +@property(nonatomic, readonly) NSUInteger actionsArray_Count; + +/** + * The identity that owns (signs) the batch: the document owner for every + * action but PURCHASE, where it is the buyer. + **/ +@property(nonatomic, readwrite, copy, null_resettable) NSData *batchOwnerId; +/** Test to see if @c batchOwnerId has been set. */ +@property(nonatomic, readwrite) BOOL hasBatchOwnerId; + +@end + +#pragma mark - SubscribeToStateTransitionsRequest_DocumentFilter_PriceClause + +typedef GPB_ENUM(SubscribeToStateTransitionsRequest_DocumentFilter_PriceClause_FieldNumber) { + SubscribeToStateTransitionsRequest_DocumentFilter_PriceClause_FieldNumber_Operator_p = 1, + SubscribeToStateTransitionsRequest_DocumentFilter_PriceClause_FieldNumber_Value = 2, +}; + +/** + * Constraint on the new price of an UPDATE_PRICE. + **/ +GPB_FINAL @interface SubscribeToStateTransitionsRequest_DocumentFilter_PriceClause : GPBMessage + +@property(nonatomic, readwrite) GetDocumentsRequest_WhereOperator operator_p; + +@property(nonatomic, readwrite, strong, null_resettable) GetDocumentsRequest_DocumentFieldValue *value; +/** Test to see if @c value has been set. */ +@property(nonatomic, readwrite) BOOL hasValue; + +@end + +/** + * Fetches the raw value of a @c SubscribeToStateTransitionsRequest_DocumentFilter_PriceClause's @c operator_p property, even + * if the value was not defined by the enum at the time the code was generated. + **/ +int32_t SubscribeToStateTransitionsRequest_DocumentFilter_PriceClause_Operator_p_RawValue(SubscribeToStateTransitionsRequest_DocumentFilter_PriceClause *message); +/** + * Sets the raw value of an @c SubscribeToStateTransitionsRequest_DocumentFilter_PriceClause's @c operator_p property, allowing + * it to be set to a value that was not defined by the enum at the time the code + * was generated. + **/ +void SetSubscribeToStateTransitionsRequest_DocumentFilter_PriceClause_Operator_p_RawValue(SubscribeToStateTransitionsRequest_DocumentFilter_PriceClause *message, int32_t value); + +#pragma mark - SubscribeToStateTransitionsRequest_DocumentFilter_ActionMatch + +typedef GPB_ENUM(SubscribeToStateTransitionsRequest_DocumentFilter_ActionMatch_FieldNumber) { + SubscribeToStateTransitionsRequest_DocumentFilter_ActionMatch_FieldNumber_Action = 1, + SubscribeToStateTransitionsRequest_DocumentFilter_ActionMatch_FieldNumber_NewDocumentWhereArray = 2, + SubscribeToStateTransitionsRequest_DocumentFilter_ActionMatch_FieldNumber_OriginalDocumentWhereArray = 3, + SubscribeToStateTransitionsRequest_DocumentFilter_ActionMatch_FieldNumber_OwnerIdsArray = 4, + SubscribeToStateTransitionsRequest_DocumentFilter_ActionMatch_FieldNumber_Price = 5, +}; + +/** + * One action, optionally narrowed by clauses (ANDed together). The clause + * values follow the getDocuments typing rules; the document type's schema + * decides each field's type. + **/ +GPB_FINAL @interface SubscribeToStateTransitionsRequest_DocumentFilter_ActionMatch : GPBMessage + +/** + * Required; `optional` so a missing action is rejected rather than read + * as CREATE. + **/ +@property(nonatomic, readwrite) SubscribeToStateTransitionsRequest_DocumentFilter_Action action; + +@property(nonatomic, readwrite) BOOL hasAction; +/** + * CREATE and REPLACE: clauses on the document data the transition + * carries. + **/ +@property(nonatomic, readwrite, strong, null_resettable) NSMutableArray *newDocumentWhereArray NS_RETURNS_NOT_RETAINED; +/** The number of items in @c newDocumentWhereArray without causing the array to be created. */ +@property(nonatomic, readonly) NSUInteger newDocumentWhereArray_Count; + +/** + * Clauses on the document as it was before the transition: only `$id`, + * except for DELETE on an indexOnly document type, whose delete carries + * the document's values. + **/ +@property(nonatomic, readwrite, strong, null_resettable) NSMutableArray *originalDocumentWhereArray; +/** The number of items in @c originalDocumentWhereArray without causing the array to be created. */ +@property(nonatomic, readonly) NSUInteger originalDocumentWhereArray_Count; + +/** + * TRANSFER: the recipient, PURCHASE: the buyer, must be one of these + * identities. + **/ +@property(nonatomic, readwrite, strong, null_resettable) NSMutableArray *ownerIdsArray; +/** The number of items in @c ownerIdsArray without causing the array to be created. */ +@property(nonatomic, readonly) NSUInteger ownerIdsArray_Count; + +/** UPDATE_PRICE only. */ +@property(nonatomic, readwrite, strong, null_resettable) SubscribeToStateTransitionsRequest_DocumentFilter_PriceClause *price; +/** Test to see if @c price has been set. */ +@property(nonatomic, readwrite) BOOL hasPrice; + +@end + +/** + * Fetches the raw value of a @c SubscribeToStateTransitionsRequest_DocumentFilter_ActionMatch's @c action property, even + * if the value was not defined by the enum at the time the code was generated. + **/ +int32_t SubscribeToStateTransitionsRequest_DocumentFilter_ActionMatch_Action_RawValue(SubscribeToStateTransitionsRequest_DocumentFilter_ActionMatch *message); +/** + * Sets the raw value of an @c SubscribeToStateTransitionsRequest_DocumentFilter_ActionMatch's @c action property, allowing + * it to be set to a value that was not defined by the enum at the time the code + * was generated. + **/ +void SetSubscribeToStateTransitionsRequest_DocumentFilter_ActionMatch_Action_RawValue(SubscribeToStateTransitionsRequest_DocumentFilter_ActionMatch *message, int32_t value); + +#pragma mark - SubscribeToStateTransitionsRequest_AddressFilter + +typedef GPB_ENUM(SubscribeToStateTransitionsRequest_AddressFilter_FieldNumber) { + SubscribeToStateTransitionsRequest_AddressFilter_FieldNumber_AddressesArray = 1, + SubscribeToStateTransitionsRequest_AddressFilter_FieldNumber_Role = 2, +}; + +/** + * Transitions that name one of these platform addresses. + **/ +GPB_FINAL @interface SubscribeToStateTransitionsRequest_AddressFilter : GPBMessage + +/** + * Platform addresses in their 21-byte form: a type byte (0 for P2PKH, 1 for + * P2SH) followed by the 20-byte hash. + **/ +@property(nonatomic, readwrite, strong, null_resettable) NSMutableArray *addressesArray; +/** The number of items in @c addressesArray without causing the array to be created. */ +@property(nonatomic, readonly) NSUInteger addressesArray_Count; + +@property(nonatomic, readwrite) SubscribeToStateTransitionsRequest_Role role; + +@end + +/** + * Fetches the raw value of a @c SubscribeToStateTransitionsRequest_AddressFilter's @c role property, even + * if the value was not defined by the enum at the time the code was generated. + **/ +int32_t SubscribeToStateTransitionsRequest_AddressFilter_Role_RawValue(SubscribeToStateTransitionsRequest_AddressFilter *message); +/** + * Sets the raw value of an @c SubscribeToStateTransitionsRequest_AddressFilter's @c role property, allowing + * it to be set to a value that was not defined by the enum at the time the code + * was generated. + **/ +void SetSubscribeToStateTransitionsRequest_AddressFilter_Role_RawValue(SubscribeToStateTransitionsRequest_AddressFilter *message, int32_t value); + +#pragma mark - SubscribeToStateTransitionsRequest_StateTransitionFilter + +typedef GPB_ENUM(SubscribeToStateTransitionsRequest_StateTransitionFilter_FieldNumber) { + SubscribeToStateTransitionsRequest_StateTransitionFilter_FieldNumber_Documents = 1, + SubscribeToStateTransitionsRequest_StateTransitionFilter_FieldNumber_Addresses = 2, +}; + +typedef GPB_ENUM(SubscribeToStateTransitionsRequest_StateTransitionFilter_Filter_OneOfCase) { + SubscribeToStateTransitionsRequest_StateTransitionFilter_Filter_OneOfCase_GPBUnsetOneOfCase = 0, + SubscribeToStateTransitionsRequest_StateTransitionFilter_Filter_OneOfCase_Documents = 1, + SubscribeToStateTransitionsRequest_StateTransitionFilter_Filter_OneOfCase_Addresses = 2, +}; + +GPB_FINAL @interface SubscribeToStateTransitionsRequest_StateTransitionFilter : GPBMessage + +@property(nonatomic, readonly) SubscribeToStateTransitionsRequest_StateTransitionFilter_Filter_OneOfCase filterOneOfCase; + +@property(nonatomic, readwrite, strong, null_resettable) SubscribeToStateTransitionsRequest_DocumentFilter *documents; + +@property(nonatomic, readwrite, strong, null_resettable) SubscribeToStateTransitionsRequest_AddressFilter *addresses; + +@end + +/** + * Clears whatever value was set for the oneof 'filter'. + **/ +void SubscribeToStateTransitionsRequest_StateTransitionFilter_ClearFilterOneOfCase(SubscribeToStateTransitionsRequest_StateTransitionFilter *message); + +#pragma mark - SubscribeToStateTransitionsRequest_SubscribeToStateTransitionsRequestV0 + +typedef GPB_ENUM(SubscribeToStateTransitionsRequest_SubscribeToStateTransitionsRequestV0_FieldNumber) { + SubscribeToStateTransitionsRequest_SubscribeToStateTransitionsRequestV0_FieldNumber_FiltersArray = 1, + SubscribeToStateTransitionsRequest_SubscribeToStateTransitionsRequestV0_FieldNumber_FromBlockHeight = 2, +}; + +GPB_FINAL @interface SubscribeToStateTransitionsRequest_SubscribeToStateTransitionsRequestV0 : GPBMessage + +@property(nonatomic, readwrite, strong, null_resettable) NSMutableArray *filtersArray; +/** The number of items in @c filtersArray without causing the array to be created. */ +@property(nonatomic, readonly) NSUInteger filtersArray_Count; + +/** First block height to scan. Unset: start after the current tip. */ +@property(nonatomic, readwrite) uint64_t fromBlockHeight; + +@property(nonatomic, readwrite) BOOL hasFromBlockHeight; +@end + +#pragma mark - SubscribeToStateTransitionsResponse + +typedef GPB_ENUM(SubscribeToStateTransitionsResponse_FieldNumber) { + SubscribeToStateTransitionsResponse_FieldNumber_V0 = 1, +}; + +typedef GPB_ENUM(SubscribeToStateTransitionsResponse_Version_OneOfCase) { + SubscribeToStateTransitionsResponse_Version_OneOfCase_GPBUnsetOneOfCase = 0, + SubscribeToStateTransitionsResponse_Version_OneOfCase_V0 = 1, +}; + +/** + * One message of a state transition subscription stream. + * + * The first message is a checkpoint at the height before the first scanned + * block. Blocks are then scanned in height order: each matching transition is + * sent in block order, and every block with a match ends with a checkpoint at + * its height. While no block matches, a checkpoint at the last scanned height + * is repeated every few seconds. A checkpoint at height `h` asserts that every + * match from the first scanned block through `h` has been sent: resume from + * `h + 1`. Any end of the stream, including one with status OK (for example + * at the gateway's 600-second limit), means the same: resume from the last + * checkpoint. + * + * The server asserts these; it does not prove them. A client can check a + * delivered transition (its hash, and that it matches the filters) but not + * that nothing was left out. + **/ +GPB_FINAL @interface SubscribeToStateTransitionsResponse : GPBMessage + +@property(nonatomic, readonly) SubscribeToStateTransitionsResponse_Version_OneOfCase versionOneOfCase; + +@property(nonatomic, readwrite, strong, null_resettable) SubscribeToStateTransitionsResponse_SubscribeToStateTransitionsResponseV0 *v0; + +@end + +/** + * Clears whatever value was set for the oneof 'version'. + **/ +void SubscribeToStateTransitionsResponse_ClearVersionOneOfCase(SubscribeToStateTransitionsResponse *message); + +#pragma mark - SubscribeToStateTransitionsResponse_SubscribeToStateTransitionsResponseV0 + +typedef GPB_ENUM(SubscribeToStateTransitionsResponse_SubscribeToStateTransitionsResponseV0_FieldNumber) { + SubscribeToStateTransitionsResponse_SubscribeToStateTransitionsResponseV0_FieldNumber_StateTransition = 1, + SubscribeToStateTransitionsResponse_SubscribeToStateTransitionsResponseV0_FieldNumber_Checkpoint = 2, +}; + +typedef GPB_ENUM(SubscribeToStateTransitionsResponse_SubscribeToStateTransitionsResponseV0_Responses_OneOfCase) { + SubscribeToStateTransitionsResponse_SubscribeToStateTransitionsResponseV0_Responses_OneOfCase_GPBUnsetOneOfCase = 0, + SubscribeToStateTransitionsResponse_SubscribeToStateTransitionsResponseV0_Responses_OneOfCase_StateTransition = 1, + SubscribeToStateTransitionsResponse_SubscribeToStateTransitionsResponseV0_Responses_OneOfCase_Checkpoint = 2, +}; + +GPB_FINAL @interface SubscribeToStateTransitionsResponse_SubscribeToStateTransitionsResponseV0 : GPBMessage + +@property(nonatomic, readonly) SubscribeToStateTransitionsResponse_SubscribeToStateTransitionsResponseV0_Responses_OneOfCase responsesOneOfCase; + +@property(nonatomic, readwrite, strong, null_resettable) SubscribeToStateTransitionsResponse_SubscribeToStateTransitionsResponseV0_StateTransitionMatch *stateTransition; + +@property(nonatomic, readwrite, strong, null_resettable) SubscribeToStateTransitionsResponse_SubscribeToStateTransitionsResponseV0_Checkpoint *checkpoint; + +@end + +/** + * Clears whatever value was set for the oneof 'responses'. + **/ +void SubscribeToStateTransitionsResponse_SubscribeToStateTransitionsResponseV0_ClearResponsesOneOfCase(SubscribeToStateTransitionsResponse_SubscribeToStateTransitionsResponseV0 *message); + +#pragma mark - SubscribeToStateTransitionsResponse_SubscribeToStateTransitionsResponseV0_StateTransitionMatch + +typedef GPB_ENUM(SubscribeToStateTransitionsResponse_SubscribeToStateTransitionsResponseV0_StateTransitionMatch_FieldNumber) { + SubscribeToStateTransitionsResponse_SubscribeToStateTransitionsResponseV0_StateTransitionMatch_FieldNumber_BlockHeight = 1, + SubscribeToStateTransitionsResponse_SubscribeToStateTransitionsResponseV0_StateTransitionMatch_FieldNumber_BlockTimeMs = 2, + SubscribeToStateTransitionsResponse_SubscribeToStateTransitionsResponseV0_StateTransitionMatch_FieldNumber_ProtocolVersion = 3, + SubscribeToStateTransitionsResponse_SubscribeToStateTransitionsResponseV0_StateTransitionMatch_FieldNumber_StateTransitionHash = 4, + SubscribeToStateTransitionsResponse_SubscribeToStateTransitionsResponseV0_StateTransitionMatch_FieldNumber_StateTransition = 5, + SubscribeToStateTransitionsResponse_SubscribeToStateTransitionsResponseV0_StateTransitionMatch_FieldNumber_MatchedFiltersArray = 6, + SubscribeToStateTransitionsResponse_SubscribeToStateTransitionsResponseV0_StateTransitionMatch_FieldNumber_MatchedBatchPositionsArray = 7, +}; + +GPB_FINAL @interface SubscribeToStateTransitionsResponse_SubscribeToStateTransitionsResponseV0_StateTransitionMatch : GPBMessage + +@property(nonatomic, readwrite) uint64_t blockHeight; + +/** Block time, in milliseconds since the Unix epoch. */ +@property(nonatomic, readwrite) uint64_t blockTimeMs; + +/** The protocol version the block executed under. */ +@property(nonatomic, readwrite) uint32_t protocolVersion; + +/** SHA-256 of `state_transition`, which is also its Tenderdash hash. */ +@property(nonatomic, readwrite, copy, null_resettable) NSData *stateTransitionHash; + +/** The serialized state transition, as included in the block. */ +@property(nonatomic, readwrite, copy, null_resettable) NSData *stateTransition; + +/** Indexes, in the request's `filters`, of the filters that matched. */ +@property(nonatomic, readwrite, strong, null_resettable) GPBUInt32Array *matchedFiltersArray; +/** The number of items in @c matchedFiltersArray without causing the array to be created. */ +@property(nonatomic, readonly) NSUInteger matchedFiltersArray_Count; + +/** + * For a batch transition: positions, in its transitions, of the + * document transitions that matched. + **/ +@property(nonatomic, readwrite, strong, null_resettable) GPBUInt32Array *matchedBatchPositionsArray; +/** The number of items in @c matchedBatchPositionsArray without causing the array to be created. */ +@property(nonatomic, readonly) NSUInteger matchedBatchPositionsArray_Count; + +@end + +#pragma mark - SubscribeToStateTransitionsResponse_SubscribeToStateTransitionsResponseV0_Checkpoint + +typedef GPB_ENUM(SubscribeToStateTransitionsResponse_SubscribeToStateTransitionsResponseV0_Checkpoint_FieldNumber) { + SubscribeToStateTransitionsResponse_SubscribeToStateTransitionsResponseV0_Checkpoint_FieldNumber_BlockHeight = 1, +}; + +GPB_FINAL @interface SubscribeToStateTransitionsResponse_SubscribeToStateTransitionsResponseV0_Checkpoint : GPBMessage + +@property(nonatomic, readwrite) uint64_t blockHeight; + +@end + NS_ASSUME_NONNULL_END CF_EXTERN_C_END 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 c25da50425b..15205d7e32e 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 @@ -514,6 +514,17 @@ GPBObjCClassDeclaration(SecurityLevelMap); GPBObjCClassDeclaration(SpecificKeys); GPBObjCClassDeclaration(StateTransitionBroadcastError); +GPBObjCClassDeclaration(SubscribeToStateTransitionsRequest); +GPBObjCClassDeclaration(SubscribeToStateTransitionsRequest_AddressFilter); +GPBObjCClassDeclaration(SubscribeToStateTransitionsRequest_DocumentFilter); +GPBObjCClassDeclaration(SubscribeToStateTransitionsRequest_DocumentFilter_ActionMatch); +GPBObjCClassDeclaration(SubscribeToStateTransitionsRequest_DocumentFilter_PriceClause); +GPBObjCClassDeclaration(SubscribeToStateTransitionsRequest_StateTransitionFilter); +GPBObjCClassDeclaration(SubscribeToStateTransitionsRequest_SubscribeToStateTransitionsRequestV0); +GPBObjCClassDeclaration(SubscribeToStateTransitionsResponse); +GPBObjCClassDeclaration(SubscribeToStateTransitionsResponse_SubscribeToStateTransitionsResponseV0); +GPBObjCClassDeclaration(SubscribeToStateTransitionsResponse_SubscribeToStateTransitionsResponseV0_Checkpoint); +GPBObjCClassDeclaration(SubscribeToStateTransitionsResponse_SubscribeToStateTransitionsResponseV0_StateTransitionMatch); GPBObjCClassDeclaration(WaitForStateTransitionResultRequest); GPBObjCClassDeclaration(WaitForStateTransitionResultRequest_WaitForStateTransitionResultRequestV0); GPBObjCClassDeclaration(WaitForStateTransitionResultResponse); @@ -33467,6 +33478,873 @@ + (GPBDescriptor *)descriptor { @end +#pragma mark - SubscribeToStateTransitionsRequest + +@implementation SubscribeToStateTransitionsRequest + +@dynamic versionOneOfCase; +@dynamic v0; + +typedef struct SubscribeToStateTransitionsRequest__storage_ { + uint32_t _has_storage_[2]; + SubscribeToStateTransitionsRequest_SubscribeToStateTransitionsRequestV0 *v0; +} SubscribeToStateTransitionsRequest__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(SubscribeToStateTransitionsRequest_SubscribeToStateTransitionsRequestV0), + .number = SubscribeToStateTransitionsRequest_FieldNumber_V0, + .hasIndex = -1, + .offset = (uint32_t)offsetof(SubscribeToStateTransitionsRequest__storage_, v0), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeMessage, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[SubscribeToStateTransitionsRequest class] + rootClass:[PlatformRoot class] + file:PlatformRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(SubscribeToStateTransitionsRequest__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 SubscribeToStateTransitionsRequest_ClearVersionOneOfCase(SubscribeToStateTransitionsRequest *message) { + GPBDescriptor *descriptor = [SubscribeToStateTransitionsRequest descriptor]; + GPBOneofDescriptor *oneof = [descriptor.oneofs objectAtIndex:0]; + GPBClearOneof(message, oneof); +} +#pragma mark - Enum SubscribeToStateTransitionsRequest_Role + +GPBEnumDescriptor *SubscribeToStateTransitionsRequest_Role_EnumDescriptor(void) { + static _Atomic(GPBEnumDescriptor*) descriptor = nil; + if (!descriptor) { + static const char *valueNames = + "Any\000Sender\000Recipient\000"; + static const int32_t values[] = { + SubscribeToStateTransitionsRequest_Role_Any, + SubscribeToStateTransitionsRequest_Role_Sender, + SubscribeToStateTransitionsRequest_Role_Recipient, + }; + GPBEnumDescriptor *worker = + [GPBEnumDescriptor allocDescriptorForName:GPBNSStringifySymbol(SubscribeToStateTransitionsRequest_Role) + valueNames:valueNames + values:values + count:(uint32_t)(sizeof(values) / sizeof(int32_t)) + enumVerifier:SubscribeToStateTransitionsRequest_Role_IsValidValue]; + GPBEnumDescriptor *expected = nil; + if (!atomic_compare_exchange_strong(&descriptor, &expected, worker)) { + [worker release]; + } + } + return descriptor; +} + +BOOL SubscribeToStateTransitionsRequest_Role_IsValidValue(int32_t value__) { + switch (value__) { + case SubscribeToStateTransitionsRequest_Role_Any: + case SubscribeToStateTransitionsRequest_Role_Sender: + case SubscribeToStateTransitionsRequest_Role_Recipient: + return YES; + default: + return NO; + } +} + +#pragma mark - SubscribeToStateTransitionsRequest_DocumentFilter + +@implementation SubscribeToStateTransitionsRequest_DocumentFilter + +@dynamic dataContractId; +@dynamic hasDocumentTypeName, documentTypeName; +@dynamic actionsArray, actionsArray_Count; +@dynamic hasBatchOwnerId, batchOwnerId; + +typedef struct SubscribeToStateTransitionsRequest_DocumentFilter__storage_ { + uint32_t _has_storage_[1]; + NSData *dataContractId; + NSString *documentTypeName; + NSMutableArray *actionsArray; + NSData *batchOwnerId; +} SubscribeToStateTransitionsRequest_DocumentFilter__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 = "dataContractId", + .dataTypeSpecific.clazz = Nil, + .number = SubscribeToStateTransitionsRequest_DocumentFilter_FieldNumber_DataContractId, + .hasIndex = 0, + .offset = (uint32_t)offsetof(SubscribeToStateTransitionsRequest_DocumentFilter__storage_, dataContractId), + .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), + .dataType = GPBDataTypeBytes, + }, + { + .name = "documentTypeName", + .dataTypeSpecific.clazz = Nil, + .number = SubscribeToStateTransitionsRequest_DocumentFilter_FieldNumber_DocumentTypeName, + .hasIndex = 1, + .offset = (uint32_t)offsetof(SubscribeToStateTransitionsRequest_DocumentFilter__storage_, documentTypeName), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeString, + }, + { + .name = "actionsArray", + .dataTypeSpecific.clazz = GPBObjCClass(SubscribeToStateTransitionsRequest_DocumentFilter_ActionMatch), + .number = SubscribeToStateTransitionsRequest_DocumentFilter_FieldNumber_ActionsArray, + .hasIndex = GPBNoHasBit, + .offset = (uint32_t)offsetof(SubscribeToStateTransitionsRequest_DocumentFilter__storage_, actionsArray), + .flags = GPBFieldRepeated, + .dataType = GPBDataTypeMessage, + }, + { + .name = "batchOwnerId", + .dataTypeSpecific.clazz = Nil, + .number = SubscribeToStateTransitionsRequest_DocumentFilter_FieldNumber_BatchOwnerId, + .hasIndex = 2, + .offset = (uint32_t)offsetof(SubscribeToStateTransitionsRequest_DocumentFilter__storage_, batchOwnerId), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeBytes, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[SubscribeToStateTransitionsRequest_DocumentFilter class] + rootClass:[PlatformRoot class] + file:PlatformRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(SubscribeToStateTransitionsRequest_DocumentFilter__storage_) + flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown)]; + [localDescriptor setupContainingMessageClass:GPBObjCClass(SubscribeToStateTransitionsRequest)]; + #if defined(DEBUG) && DEBUG + NSAssert(descriptor == nil, @"Startup recursed!"); + #endif // DEBUG + descriptor = localDescriptor; + } + return descriptor; +} + +@end + +#pragma mark - Enum SubscribeToStateTransitionsRequest_DocumentFilter_Action + +GPBEnumDescriptor *SubscribeToStateTransitionsRequest_DocumentFilter_Action_EnumDescriptor(void) { + static _Atomic(GPBEnumDescriptor*) descriptor = nil; + if (!descriptor) { + static const char *valueNames = + "Create\000Replace\000Delete\000Transfer\000UpdatePri" + "ce\000Purchase\000"; + static const int32_t values[] = { + SubscribeToStateTransitionsRequest_DocumentFilter_Action_Create, + SubscribeToStateTransitionsRequest_DocumentFilter_Action_Replace, + SubscribeToStateTransitionsRequest_DocumentFilter_Action_Delete, + SubscribeToStateTransitionsRequest_DocumentFilter_Action_Transfer, + SubscribeToStateTransitionsRequest_DocumentFilter_Action_UpdatePrice, + SubscribeToStateTransitionsRequest_DocumentFilter_Action_Purchase, + }; + GPBEnumDescriptor *worker = + [GPBEnumDescriptor allocDescriptorForName:GPBNSStringifySymbol(SubscribeToStateTransitionsRequest_DocumentFilter_Action) + valueNames:valueNames + values:values + count:(uint32_t)(sizeof(values) / sizeof(int32_t)) + enumVerifier:SubscribeToStateTransitionsRequest_DocumentFilter_Action_IsValidValue]; + GPBEnumDescriptor *expected = nil; + if (!atomic_compare_exchange_strong(&descriptor, &expected, worker)) { + [worker release]; + } + } + return descriptor; +} + +BOOL SubscribeToStateTransitionsRequest_DocumentFilter_Action_IsValidValue(int32_t value__) { + switch (value__) { + case SubscribeToStateTransitionsRequest_DocumentFilter_Action_Create: + case SubscribeToStateTransitionsRequest_DocumentFilter_Action_Replace: + case SubscribeToStateTransitionsRequest_DocumentFilter_Action_Delete: + case SubscribeToStateTransitionsRequest_DocumentFilter_Action_Transfer: + case SubscribeToStateTransitionsRequest_DocumentFilter_Action_UpdatePrice: + case SubscribeToStateTransitionsRequest_DocumentFilter_Action_Purchase: + return YES; + default: + return NO; + } +} + +#pragma mark - SubscribeToStateTransitionsRequest_DocumentFilter_PriceClause + +@implementation SubscribeToStateTransitionsRequest_DocumentFilter_PriceClause + +@dynamic operator_p; +@dynamic hasValue, value; + +typedef struct SubscribeToStateTransitionsRequest_DocumentFilter_PriceClause__storage_ { + uint32_t _has_storage_[1]; + GetDocumentsRequest_WhereOperator operator_p; + GetDocumentsRequest_DocumentFieldValue *value; +} SubscribeToStateTransitionsRequest_DocumentFilter_PriceClause__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 = "operator_p", + .dataTypeSpecific.enumDescFunc = GetDocumentsRequest_WhereOperator_EnumDescriptor, + .number = SubscribeToStateTransitionsRequest_DocumentFilter_PriceClause_FieldNumber_Operator_p, + .hasIndex = 0, + .offset = (uint32_t)offsetof(SubscribeToStateTransitionsRequest_DocumentFilter_PriceClause__storage_, operator_p), + .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldHasEnumDescriptor | GPBFieldClearHasIvarOnZero), + .dataType = GPBDataTypeEnum, + }, + { + .name = "value", + .dataTypeSpecific.clazz = GPBObjCClass(GetDocumentsRequest_DocumentFieldValue), + .number = SubscribeToStateTransitionsRequest_DocumentFilter_PriceClause_FieldNumber_Value, + .hasIndex = 1, + .offset = (uint32_t)offsetof(SubscribeToStateTransitionsRequest_DocumentFilter_PriceClause__storage_, value), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeMessage, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[SubscribeToStateTransitionsRequest_DocumentFilter_PriceClause class] + rootClass:[PlatformRoot class] + file:PlatformRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(SubscribeToStateTransitionsRequest_DocumentFilter_PriceClause__storage_) + flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown)]; + [localDescriptor setupContainingMessageClass:GPBObjCClass(SubscribeToStateTransitionsRequest_DocumentFilter)]; + #if defined(DEBUG) && DEBUG + NSAssert(descriptor == nil, @"Startup recursed!"); + #endif // DEBUG + descriptor = localDescriptor; + } + return descriptor; +} + +@end + +int32_t SubscribeToStateTransitionsRequest_DocumentFilter_PriceClause_Operator_p_RawValue(SubscribeToStateTransitionsRequest_DocumentFilter_PriceClause *message) { + GPBDescriptor *descriptor = [SubscribeToStateTransitionsRequest_DocumentFilter_PriceClause descriptor]; + GPBFieldDescriptor *field = [descriptor fieldWithNumber:SubscribeToStateTransitionsRequest_DocumentFilter_PriceClause_FieldNumber_Operator_p]; + return GPBGetMessageRawEnumField(message, field); +} + +void SetSubscribeToStateTransitionsRequest_DocumentFilter_PriceClause_Operator_p_RawValue(SubscribeToStateTransitionsRequest_DocumentFilter_PriceClause *message, int32_t value) { + GPBDescriptor *descriptor = [SubscribeToStateTransitionsRequest_DocumentFilter_PriceClause descriptor]; + GPBFieldDescriptor *field = [descriptor fieldWithNumber:SubscribeToStateTransitionsRequest_DocumentFilter_PriceClause_FieldNumber_Operator_p]; + GPBSetMessageRawEnumField(message, field, value); +} + +#pragma mark - SubscribeToStateTransitionsRequest_DocumentFilter_ActionMatch + +@implementation SubscribeToStateTransitionsRequest_DocumentFilter_ActionMatch + +@dynamic hasAction, action; +@dynamic newDocumentWhereArray, newDocumentWhereArray_Count; +@dynamic originalDocumentWhereArray, originalDocumentWhereArray_Count; +@dynamic ownerIdsArray, ownerIdsArray_Count; +@dynamic hasPrice, price; + +typedef struct SubscribeToStateTransitionsRequest_DocumentFilter_ActionMatch__storage_ { + uint32_t _has_storage_[1]; + SubscribeToStateTransitionsRequest_DocumentFilter_Action action; + NSMutableArray *newDocumentWhereArray; + NSMutableArray *originalDocumentWhereArray; + NSMutableArray *ownerIdsArray; + SubscribeToStateTransitionsRequest_DocumentFilter_PriceClause *price; +} SubscribeToStateTransitionsRequest_DocumentFilter_ActionMatch__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 = "action", + .dataTypeSpecific.enumDescFunc = SubscribeToStateTransitionsRequest_DocumentFilter_Action_EnumDescriptor, + .number = SubscribeToStateTransitionsRequest_DocumentFilter_ActionMatch_FieldNumber_Action, + .hasIndex = 0, + .offset = (uint32_t)offsetof(SubscribeToStateTransitionsRequest_DocumentFilter_ActionMatch__storage_, action), + .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldHasEnumDescriptor), + .dataType = GPBDataTypeEnum, + }, + { + .name = "newDocumentWhereArray", + .dataTypeSpecific.clazz = GPBObjCClass(GetDocumentsRequest_WhereClause), + .number = SubscribeToStateTransitionsRequest_DocumentFilter_ActionMatch_FieldNumber_NewDocumentWhereArray, + .hasIndex = GPBNoHasBit, + .offset = (uint32_t)offsetof(SubscribeToStateTransitionsRequest_DocumentFilter_ActionMatch__storage_, newDocumentWhereArray), + .flags = GPBFieldRepeated, + .dataType = GPBDataTypeMessage, + }, + { + .name = "originalDocumentWhereArray", + .dataTypeSpecific.clazz = GPBObjCClass(GetDocumentsRequest_WhereClause), + .number = SubscribeToStateTransitionsRequest_DocumentFilter_ActionMatch_FieldNumber_OriginalDocumentWhereArray, + .hasIndex = GPBNoHasBit, + .offset = (uint32_t)offsetof(SubscribeToStateTransitionsRequest_DocumentFilter_ActionMatch__storage_, originalDocumentWhereArray), + .flags = GPBFieldRepeated, + .dataType = GPBDataTypeMessage, + }, + { + .name = "ownerIdsArray", + .dataTypeSpecific.clazz = Nil, + .number = SubscribeToStateTransitionsRequest_DocumentFilter_ActionMatch_FieldNumber_OwnerIdsArray, + .hasIndex = GPBNoHasBit, + .offset = (uint32_t)offsetof(SubscribeToStateTransitionsRequest_DocumentFilter_ActionMatch__storage_, ownerIdsArray), + .flags = GPBFieldRepeated, + .dataType = GPBDataTypeBytes, + }, + { + .name = "price", + .dataTypeSpecific.clazz = GPBObjCClass(SubscribeToStateTransitionsRequest_DocumentFilter_PriceClause), + .number = SubscribeToStateTransitionsRequest_DocumentFilter_ActionMatch_FieldNumber_Price, + .hasIndex = 1, + .offset = (uint32_t)offsetof(SubscribeToStateTransitionsRequest_DocumentFilter_ActionMatch__storage_, price), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeMessage, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[SubscribeToStateTransitionsRequest_DocumentFilter_ActionMatch class] + rootClass:[PlatformRoot class] + file:PlatformRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(SubscribeToStateTransitionsRequest_DocumentFilter_ActionMatch__storage_) + flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown)]; + [localDescriptor setupContainingMessageClass:GPBObjCClass(SubscribeToStateTransitionsRequest_DocumentFilter)]; + #if defined(DEBUG) && DEBUG + NSAssert(descriptor == nil, @"Startup recursed!"); + #endif // DEBUG + descriptor = localDescriptor; + } + return descriptor; +} + +@end + +int32_t SubscribeToStateTransitionsRequest_DocumentFilter_ActionMatch_Action_RawValue(SubscribeToStateTransitionsRequest_DocumentFilter_ActionMatch *message) { + GPBDescriptor *descriptor = [SubscribeToStateTransitionsRequest_DocumentFilter_ActionMatch descriptor]; + GPBFieldDescriptor *field = [descriptor fieldWithNumber:SubscribeToStateTransitionsRequest_DocumentFilter_ActionMatch_FieldNumber_Action]; + return GPBGetMessageRawEnumField(message, field); +} + +void SetSubscribeToStateTransitionsRequest_DocumentFilter_ActionMatch_Action_RawValue(SubscribeToStateTransitionsRequest_DocumentFilter_ActionMatch *message, int32_t value) { + GPBDescriptor *descriptor = [SubscribeToStateTransitionsRequest_DocumentFilter_ActionMatch descriptor]; + GPBFieldDescriptor *field = [descriptor fieldWithNumber:SubscribeToStateTransitionsRequest_DocumentFilter_ActionMatch_FieldNumber_Action]; + GPBSetMessageRawEnumField(message, field, value); +} + +#pragma mark - SubscribeToStateTransitionsRequest_AddressFilter + +@implementation SubscribeToStateTransitionsRequest_AddressFilter + +@dynamic addressesArray, addressesArray_Count; +@dynamic role; + +typedef struct SubscribeToStateTransitionsRequest_AddressFilter__storage_ { + uint32_t _has_storage_[1]; + SubscribeToStateTransitionsRequest_Role role; + NSMutableArray *addressesArray; +} SubscribeToStateTransitionsRequest_AddressFilter__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 = "addressesArray", + .dataTypeSpecific.clazz = Nil, + .number = SubscribeToStateTransitionsRequest_AddressFilter_FieldNumber_AddressesArray, + .hasIndex = GPBNoHasBit, + .offset = (uint32_t)offsetof(SubscribeToStateTransitionsRequest_AddressFilter__storage_, addressesArray), + .flags = GPBFieldRepeated, + .dataType = GPBDataTypeBytes, + }, + { + .name = "role", + .dataTypeSpecific.enumDescFunc = SubscribeToStateTransitionsRequest_Role_EnumDescriptor, + .number = SubscribeToStateTransitionsRequest_AddressFilter_FieldNumber_Role, + .hasIndex = 0, + .offset = (uint32_t)offsetof(SubscribeToStateTransitionsRequest_AddressFilter__storage_, role), + .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldHasEnumDescriptor | GPBFieldClearHasIvarOnZero), + .dataType = GPBDataTypeEnum, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[SubscribeToStateTransitionsRequest_AddressFilter class] + rootClass:[PlatformRoot class] + file:PlatformRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(SubscribeToStateTransitionsRequest_AddressFilter__storage_) + flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown)]; + [localDescriptor setupContainingMessageClass:GPBObjCClass(SubscribeToStateTransitionsRequest)]; + #if defined(DEBUG) && DEBUG + NSAssert(descriptor == nil, @"Startup recursed!"); + #endif // DEBUG + descriptor = localDescriptor; + } + return descriptor; +} + +@end + +int32_t SubscribeToStateTransitionsRequest_AddressFilter_Role_RawValue(SubscribeToStateTransitionsRequest_AddressFilter *message) { + GPBDescriptor *descriptor = [SubscribeToStateTransitionsRequest_AddressFilter descriptor]; + GPBFieldDescriptor *field = [descriptor fieldWithNumber:SubscribeToStateTransitionsRequest_AddressFilter_FieldNumber_Role]; + return GPBGetMessageRawEnumField(message, field); +} + +void SetSubscribeToStateTransitionsRequest_AddressFilter_Role_RawValue(SubscribeToStateTransitionsRequest_AddressFilter *message, int32_t value) { + GPBDescriptor *descriptor = [SubscribeToStateTransitionsRequest_AddressFilter descriptor]; + GPBFieldDescriptor *field = [descriptor fieldWithNumber:SubscribeToStateTransitionsRequest_AddressFilter_FieldNumber_Role]; + GPBSetMessageRawEnumField(message, field, value); +} + +#pragma mark - SubscribeToStateTransitionsRequest_StateTransitionFilter + +@implementation SubscribeToStateTransitionsRequest_StateTransitionFilter + +@dynamic filterOneOfCase; +@dynamic documents; +@dynamic addresses; + +typedef struct SubscribeToStateTransitionsRequest_StateTransitionFilter__storage_ { + uint32_t _has_storage_[2]; + SubscribeToStateTransitionsRequest_DocumentFilter *documents; + SubscribeToStateTransitionsRequest_AddressFilter *addresses; +} SubscribeToStateTransitionsRequest_StateTransitionFilter__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 = "documents", + .dataTypeSpecific.clazz = GPBObjCClass(SubscribeToStateTransitionsRequest_DocumentFilter), + .number = SubscribeToStateTransitionsRequest_StateTransitionFilter_FieldNumber_Documents, + .hasIndex = -1, + .offset = (uint32_t)offsetof(SubscribeToStateTransitionsRequest_StateTransitionFilter__storage_, documents), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeMessage, + }, + { + .name = "addresses", + .dataTypeSpecific.clazz = GPBObjCClass(SubscribeToStateTransitionsRequest_AddressFilter), + .number = SubscribeToStateTransitionsRequest_StateTransitionFilter_FieldNumber_Addresses, + .hasIndex = -1, + .offset = (uint32_t)offsetof(SubscribeToStateTransitionsRequest_StateTransitionFilter__storage_, addresses), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeMessage, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[SubscribeToStateTransitionsRequest_StateTransitionFilter class] + rootClass:[PlatformRoot class] + file:PlatformRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(SubscribeToStateTransitionsRequest_StateTransitionFilter__storage_) + flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown)]; + static const char *oneofs[] = { + "filter", + }; + [localDescriptor setupOneofs:oneofs + count:(uint32_t)(sizeof(oneofs) / sizeof(char*)) + firstHasIndex:-1]; + [localDescriptor setupContainingMessageClass:GPBObjCClass(SubscribeToStateTransitionsRequest)]; + #if defined(DEBUG) && DEBUG + NSAssert(descriptor == nil, @"Startup recursed!"); + #endif // DEBUG + descriptor = localDescriptor; + } + return descriptor; +} + +@end + +void SubscribeToStateTransitionsRequest_StateTransitionFilter_ClearFilterOneOfCase(SubscribeToStateTransitionsRequest_StateTransitionFilter *message) { + GPBDescriptor *descriptor = [SubscribeToStateTransitionsRequest_StateTransitionFilter descriptor]; + GPBOneofDescriptor *oneof = [descriptor.oneofs objectAtIndex:0]; + GPBClearOneof(message, oneof); +} +#pragma mark - SubscribeToStateTransitionsRequest_SubscribeToStateTransitionsRequestV0 + +@implementation SubscribeToStateTransitionsRequest_SubscribeToStateTransitionsRequestV0 + +@dynamic filtersArray, filtersArray_Count; +@dynamic hasFromBlockHeight, fromBlockHeight; + +typedef struct SubscribeToStateTransitionsRequest_SubscribeToStateTransitionsRequestV0__storage_ { + uint32_t _has_storage_[1]; + NSMutableArray *filtersArray; + uint64_t fromBlockHeight; +} SubscribeToStateTransitionsRequest_SubscribeToStateTransitionsRequestV0__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 = "filtersArray", + .dataTypeSpecific.clazz = GPBObjCClass(SubscribeToStateTransitionsRequest_StateTransitionFilter), + .number = SubscribeToStateTransitionsRequest_SubscribeToStateTransitionsRequestV0_FieldNumber_FiltersArray, + .hasIndex = GPBNoHasBit, + .offset = (uint32_t)offsetof(SubscribeToStateTransitionsRequest_SubscribeToStateTransitionsRequestV0__storage_, filtersArray), + .flags = GPBFieldRepeated, + .dataType = GPBDataTypeMessage, + }, + { + .name = "fromBlockHeight", + .dataTypeSpecific.clazz = Nil, + .number = SubscribeToStateTransitionsRequest_SubscribeToStateTransitionsRequestV0_FieldNumber_FromBlockHeight, + .hasIndex = 0, + .offset = (uint32_t)offsetof(SubscribeToStateTransitionsRequest_SubscribeToStateTransitionsRequestV0__storage_, fromBlockHeight), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeUInt64, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[SubscribeToStateTransitionsRequest_SubscribeToStateTransitionsRequestV0 class] + rootClass:[PlatformRoot class] + file:PlatformRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(SubscribeToStateTransitionsRequest_SubscribeToStateTransitionsRequestV0__storage_) + flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown)]; + [localDescriptor setupContainingMessageClass:GPBObjCClass(SubscribeToStateTransitionsRequest)]; + #if defined(DEBUG) && DEBUG + NSAssert(descriptor == nil, @"Startup recursed!"); + #endif // DEBUG + descriptor = localDescriptor; + } + return descriptor; +} + +@end + +#pragma mark - SubscribeToStateTransitionsResponse + +@implementation SubscribeToStateTransitionsResponse + +@dynamic versionOneOfCase; +@dynamic v0; + +typedef struct SubscribeToStateTransitionsResponse__storage_ { + uint32_t _has_storage_[2]; + SubscribeToStateTransitionsResponse_SubscribeToStateTransitionsResponseV0 *v0; +} SubscribeToStateTransitionsResponse__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(SubscribeToStateTransitionsResponse_SubscribeToStateTransitionsResponseV0), + .number = SubscribeToStateTransitionsResponse_FieldNumber_V0, + .hasIndex = -1, + .offset = (uint32_t)offsetof(SubscribeToStateTransitionsResponse__storage_, v0), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeMessage, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[SubscribeToStateTransitionsResponse class] + rootClass:[PlatformRoot class] + file:PlatformRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(SubscribeToStateTransitionsResponse__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 SubscribeToStateTransitionsResponse_ClearVersionOneOfCase(SubscribeToStateTransitionsResponse *message) { + GPBDescriptor *descriptor = [SubscribeToStateTransitionsResponse descriptor]; + GPBOneofDescriptor *oneof = [descriptor.oneofs objectAtIndex:0]; + GPBClearOneof(message, oneof); +} +#pragma mark - SubscribeToStateTransitionsResponse_SubscribeToStateTransitionsResponseV0 + +@implementation SubscribeToStateTransitionsResponse_SubscribeToStateTransitionsResponseV0 + +@dynamic responsesOneOfCase; +@dynamic stateTransition; +@dynamic checkpoint; + +typedef struct SubscribeToStateTransitionsResponse_SubscribeToStateTransitionsResponseV0__storage_ { + uint32_t _has_storage_[2]; + SubscribeToStateTransitionsResponse_SubscribeToStateTransitionsResponseV0_StateTransitionMatch *stateTransition; + SubscribeToStateTransitionsResponse_SubscribeToStateTransitionsResponseV0_Checkpoint *checkpoint; +} SubscribeToStateTransitionsResponse_SubscribeToStateTransitionsResponseV0__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 = "stateTransition", + .dataTypeSpecific.clazz = GPBObjCClass(SubscribeToStateTransitionsResponse_SubscribeToStateTransitionsResponseV0_StateTransitionMatch), + .number = SubscribeToStateTransitionsResponse_SubscribeToStateTransitionsResponseV0_FieldNumber_StateTransition, + .hasIndex = -1, + .offset = (uint32_t)offsetof(SubscribeToStateTransitionsResponse_SubscribeToStateTransitionsResponseV0__storage_, stateTransition), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeMessage, + }, + { + .name = "checkpoint", + .dataTypeSpecific.clazz = GPBObjCClass(SubscribeToStateTransitionsResponse_SubscribeToStateTransitionsResponseV0_Checkpoint), + .number = SubscribeToStateTransitionsResponse_SubscribeToStateTransitionsResponseV0_FieldNumber_Checkpoint, + .hasIndex = -1, + .offset = (uint32_t)offsetof(SubscribeToStateTransitionsResponse_SubscribeToStateTransitionsResponseV0__storage_, checkpoint), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeMessage, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[SubscribeToStateTransitionsResponse_SubscribeToStateTransitionsResponseV0 class] + rootClass:[PlatformRoot class] + file:PlatformRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(SubscribeToStateTransitionsResponse_SubscribeToStateTransitionsResponseV0__storage_) + flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown)]; + static const char *oneofs[] = { + "responses", + }; + [localDescriptor setupOneofs:oneofs + count:(uint32_t)(sizeof(oneofs) / sizeof(char*)) + firstHasIndex:-1]; + [localDescriptor setupContainingMessageClass:GPBObjCClass(SubscribeToStateTransitionsResponse)]; + #if defined(DEBUG) && DEBUG + NSAssert(descriptor == nil, @"Startup recursed!"); + #endif // DEBUG + descriptor = localDescriptor; + } + return descriptor; +} + +@end + +void SubscribeToStateTransitionsResponse_SubscribeToStateTransitionsResponseV0_ClearResponsesOneOfCase(SubscribeToStateTransitionsResponse_SubscribeToStateTransitionsResponseV0 *message) { + GPBDescriptor *descriptor = [SubscribeToStateTransitionsResponse_SubscribeToStateTransitionsResponseV0 descriptor]; + GPBOneofDescriptor *oneof = [descriptor.oneofs objectAtIndex:0]; + GPBClearOneof(message, oneof); +} +#pragma mark - SubscribeToStateTransitionsResponse_SubscribeToStateTransitionsResponseV0_StateTransitionMatch + +@implementation SubscribeToStateTransitionsResponse_SubscribeToStateTransitionsResponseV0_StateTransitionMatch + +@dynamic blockHeight; +@dynamic blockTimeMs; +@dynamic protocolVersion; +@dynamic stateTransitionHash; +@dynamic stateTransition; +@dynamic matchedFiltersArray, matchedFiltersArray_Count; +@dynamic matchedBatchPositionsArray, matchedBatchPositionsArray_Count; + +typedef struct SubscribeToStateTransitionsResponse_SubscribeToStateTransitionsResponseV0_StateTransitionMatch__storage_ { + uint32_t _has_storage_[1]; + uint32_t protocolVersion; + NSData *stateTransitionHash; + NSData *stateTransition; + GPBUInt32Array *matchedFiltersArray; + GPBUInt32Array *matchedBatchPositionsArray; + uint64_t blockHeight; + uint64_t blockTimeMs; +} SubscribeToStateTransitionsResponse_SubscribeToStateTransitionsResponseV0_StateTransitionMatch__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 = "blockHeight", + .dataTypeSpecific.clazz = Nil, + .number = SubscribeToStateTransitionsResponse_SubscribeToStateTransitionsResponseV0_StateTransitionMatch_FieldNumber_BlockHeight, + .hasIndex = 0, + .offset = (uint32_t)offsetof(SubscribeToStateTransitionsResponse_SubscribeToStateTransitionsResponseV0_StateTransitionMatch__storage_, blockHeight), + .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), + .dataType = GPBDataTypeUInt64, + }, + { + .name = "blockTimeMs", + .dataTypeSpecific.clazz = Nil, + .number = SubscribeToStateTransitionsResponse_SubscribeToStateTransitionsResponseV0_StateTransitionMatch_FieldNumber_BlockTimeMs, + .hasIndex = 1, + .offset = (uint32_t)offsetof(SubscribeToStateTransitionsResponse_SubscribeToStateTransitionsResponseV0_StateTransitionMatch__storage_, blockTimeMs), + .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), + .dataType = GPBDataTypeUInt64, + }, + { + .name = "protocolVersion", + .dataTypeSpecific.clazz = Nil, + .number = SubscribeToStateTransitionsResponse_SubscribeToStateTransitionsResponseV0_StateTransitionMatch_FieldNumber_ProtocolVersion, + .hasIndex = 2, + .offset = (uint32_t)offsetof(SubscribeToStateTransitionsResponse_SubscribeToStateTransitionsResponseV0_StateTransitionMatch__storage_, protocolVersion), + .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), + .dataType = GPBDataTypeUInt32, + }, + { + .name = "stateTransitionHash", + .dataTypeSpecific.clazz = Nil, + .number = SubscribeToStateTransitionsResponse_SubscribeToStateTransitionsResponseV0_StateTransitionMatch_FieldNumber_StateTransitionHash, + .hasIndex = 3, + .offset = (uint32_t)offsetof(SubscribeToStateTransitionsResponse_SubscribeToStateTransitionsResponseV0_StateTransitionMatch__storage_, stateTransitionHash), + .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), + .dataType = GPBDataTypeBytes, + }, + { + .name = "stateTransition", + .dataTypeSpecific.clazz = Nil, + .number = SubscribeToStateTransitionsResponse_SubscribeToStateTransitionsResponseV0_StateTransitionMatch_FieldNumber_StateTransition, + .hasIndex = 4, + .offset = (uint32_t)offsetof(SubscribeToStateTransitionsResponse_SubscribeToStateTransitionsResponseV0_StateTransitionMatch__storage_, stateTransition), + .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), + .dataType = GPBDataTypeBytes, + }, + { + .name = "matchedFiltersArray", + .dataTypeSpecific.clazz = Nil, + .number = SubscribeToStateTransitionsResponse_SubscribeToStateTransitionsResponseV0_StateTransitionMatch_FieldNumber_MatchedFiltersArray, + .hasIndex = GPBNoHasBit, + .offset = (uint32_t)offsetof(SubscribeToStateTransitionsResponse_SubscribeToStateTransitionsResponseV0_StateTransitionMatch__storage_, matchedFiltersArray), + .flags = (GPBFieldFlags)(GPBFieldRepeated | GPBFieldPacked), + .dataType = GPBDataTypeUInt32, + }, + { + .name = "matchedBatchPositionsArray", + .dataTypeSpecific.clazz = Nil, + .number = SubscribeToStateTransitionsResponse_SubscribeToStateTransitionsResponseV0_StateTransitionMatch_FieldNumber_MatchedBatchPositionsArray, + .hasIndex = GPBNoHasBit, + .offset = (uint32_t)offsetof(SubscribeToStateTransitionsResponse_SubscribeToStateTransitionsResponseV0_StateTransitionMatch__storage_, matchedBatchPositionsArray), + .flags = (GPBFieldFlags)(GPBFieldRepeated | GPBFieldPacked), + .dataType = GPBDataTypeUInt32, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[SubscribeToStateTransitionsResponse_SubscribeToStateTransitionsResponseV0_StateTransitionMatch class] + rootClass:[PlatformRoot class] + file:PlatformRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(SubscribeToStateTransitionsResponse_SubscribeToStateTransitionsResponseV0_StateTransitionMatch__storage_) + flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown)]; + [localDescriptor setupContainingMessageClass:GPBObjCClass(SubscribeToStateTransitionsResponse_SubscribeToStateTransitionsResponseV0)]; + #if defined(DEBUG) && DEBUG + NSAssert(descriptor == nil, @"Startup recursed!"); + #endif // DEBUG + descriptor = localDescriptor; + } + return descriptor; +} + +@end + +#pragma mark - SubscribeToStateTransitionsResponse_SubscribeToStateTransitionsResponseV0_Checkpoint + +@implementation SubscribeToStateTransitionsResponse_SubscribeToStateTransitionsResponseV0_Checkpoint + +@dynamic blockHeight; + +typedef struct SubscribeToStateTransitionsResponse_SubscribeToStateTransitionsResponseV0_Checkpoint__storage_ { + uint32_t _has_storage_[1]; + uint64_t blockHeight; +} SubscribeToStateTransitionsResponse_SubscribeToStateTransitionsResponseV0_Checkpoint__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 = "blockHeight", + .dataTypeSpecific.clazz = Nil, + .number = SubscribeToStateTransitionsResponse_SubscribeToStateTransitionsResponseV0_Checkpoint_FieldNumber_BlockHeight, + .hasIndex = 0, + .offset = (uint32_t)offsetof(SubscribeToStateTransitionsResponse_SubscribeToStateTransitionsResponseV0_Checkpoint__storage_, blockHeight), + .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), + .dataType = GPBDataTypeUInt64, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[SubscribeToStateTransitionsResponse_SubscribeToStateTransitionsResponseV0_Checkpoint class] + rootClass:[PlatformRoot class] + file:PlatformRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(SubscribeToStateTransitionsResponse_SubscribeToStateTransitionsResponseV0_Checkpoint__storage_) + flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown)]; + [localDescriptor setupContainingMessageClass:GPBObjCClass(SubscribeToStateTransitionsResponse_SubscribeToStateTransitionsResponseV0)]; + #if defined(DEBUG) && DEBUG + NSAssert(descriptor == nil, @"Startup recursed!"); + #endif // DEBUG + descriptor = localDescriptor; + } + return descriptor; +} + +@end + #pragma clang diagnostic pop 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 6fb482d72b0..b0ae359535a 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 @@ -156,6 +156,8 @@ @class GetTotalCreditsInPlatformResponse; @class GetVotePollsByEndDateRequest; @class GetVotePollsByEndDateResponse; +@class SubscribeToStateTransitionsRequest; +@class SubscribeToStateTransitionsResponse; @class WaitForStateTransitionResultRequest; @class WaitForStateTransitionResultResponse; @@ -501,6 +503,16 @@ NS_ASSUME_NONNULL_BEGIN - (GRPCUnaryProtoCall *)getShieldedNullifiersWithMessage:(GetShieldedNullifiersRequest *)message responseHandler:(id)handler callOptions:(GRPCCallOptions *_Nullable)callOptions; +#pragma mark subscribeToStateTransitions(SubscribeToStateTransitionsRequest) returns (stream SubscribeToStateTransitionsResponse) + +/** + * Streams every committed, successfully executed state transition that matches + * one of the request's filters, block by block, from a chosen height onward. + * Served by DAPI from the Tenderdash block store; see + * `SubscribeToStateTransitionsResponse` for the stream contract. + */ +- (GRPCUnaryProtoCall *)subscribeToStateTransitionsWithMessage:(SubscribeToStateTransitionsRequest *)message responseHandler:(id)handler callOptions:(GRPCCallOptions *_Nullable)callOptions; + @end /** @@ -1090,6 +1102,29 @@ NS_ASSUME_NONNULL_BEGIN - (GRPCProtoCall *)RPCTogetShieldedNullifiersWithRequest:(GetShieldedNullifiersRequest *)request handler:(void(^)(GetShieldedNullifiersResponse *_Nullable response, NSError *_Nullable error))handler; +#pragma mark subscribeToStateTransitions(SubscribeToStateTransitionsRequest) returns (stream SubscribeToStateTransitionsResponse) + +/** + * Streams every committed, successfully executed state transition that matches + * one of the request's filters, block by block, from a chosen height onward. + * Served by DAPI from the Tenderdash block store; see + * `SubscribeToStateTransitionsResponse` for the stream contract. + * + * This method belongs to a set of APIs that have been deprecated. Using the v2 API is recommended. + */ +- (void)subscribeToStateTransitionsWithRequest:(SubscribeToStateTransitionsRequest *)request eventHandler:(void(^)(BOOL done, SubscribeToStateTransitionsResponse *_Nullable response, NSError *_Nullable error))eventHandler; + +/** + * Streams every committed, successfully executed state transition that matches + * one of the request's filters, block by block, from a chosen height onward. + * Served by DAPI from the Tenderdash block store; see + * `SubscribeToStateTransitionsResponse` for the stream contract. + * + * This method belongs to a set of APIs that have been deprecated. Using the v2 API is recommended. + */ +- (GRPCProtoCall *)RPCTosubscribeToStateTransitionsWithRequest:(SubscribeToStateTransitionsRequest *)request eventHandler:(void(^)(BOOL done, SubscribeToStateTransitionsResponse *_Nullable response, NSError *_Nullable error))eventHandler; + + @end 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 5a3f5a74b09..e9207e18a3e 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 @@ -1621,5 +1621,47 @@ - (GRPCUnaryProtoCall *)getShieldedNullifiersWithMessage:(GetShieldedNullifiersR responseClass:[GetShieldedNullifiersResponse class]]; } +#pragma mark subscribeToStateTransitions(SubscribeToStateTransitionsRequest) returns (stream SubscribeToStateTransitionsResponse) + +/** + * Streams every committed, successfully executed state transition that matches + * one of the request's filters, block by block, from a chosen height onward. + * Served by DAPI from the Tenderdash block store; see + * `SubscribeToStateTransitionsResponse` for the stream contract. + * + * This method belongs to a set of APIs that have been deprecated. Using the v2 API is recommended. + */ +- (void)subscribeToStateTransitionsWithRequest:(SubscribeToStateTransitionsRequest *)request eventHandler:(void(^)(BOOL done, SubscribeToStateTransitionsResponse *_Nullable response, NSError *_Nullable error))eventHandler{ + [[self RPCTosubscribeToStateTransitionsWithRequest:request eventHandler:eventHandler] start]; +} +// Returns a not-yet-started RPC object. +/** + * Streams every committed, successfully executed state transition that matches + * one of the request's filters, block by block, from a chosen height onward. + * Served by DAPI from the Tenderdash block store; see + * `SubscribeToStateTransitionsResponse` for the stream contract. + * + * This method belongs to a set of APIs that have been deprecated. Using the v2 API is recommended. + */ +- (GRPCProtoCall *)RPCTosubscribeToStateTransitionsWithRequest:(SubscribeToStateTransitionsRequest *)request eventHandler:(void(^)(BOOL done, SubscribeToStateTransitionsResponse *_Nullable response, NSError *_Nullable error))eventHandler{ + return [self RPCToMethod:@"subscribeToStateTransitions" + requestsWriter:[GRXWriter writerWithValue:request] + responseClass:[SubscribeToStateTransitionsResponse class] + responsesWriteable:[GRXWriteable writeableWithEventHandler:eventHandler]]; +} +/** + * Streams every committed, successfully executed state transition that matches + * one of the request's filters, block by block, from a chosen height onward. + * Served by DAPI from the Tenderdash block store; see + * `SubscribeToStateTransitionsResponse` for the stream contract. + */ +- (GRPCUnaryProtoCall *)subscribeToStateTransitionsWithMessage:(SubscribeToStateTransitionsRequest *)message responseHandler:(id)handler callOptions:(GRPCCallOptions *_Nullable)callOptions { + return [self RPCToMethod:@"subscribeToStateTransitions" + message:message + responseHandler:handler + callOptions:callOptions + responseClass:[SubscribeToStateTransitionsResponse class]]; +} + @end #endif 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 cb47950300c..423ac822acc 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\"\x8e\x02\n&GetIdentityKeysRemainingBudgetsRequest\x12x\n\x02v0\x18\x01 \x01(\x0b\x32j.org.dash.platform.dapi.v0.GetIdentityKeysRemainingBudgetsRequest.GetIdentityKeysRemainingBudgetsRequestV0H\x00\x1a_\n(GetIdentityKeysRemainingBudgetsRequestV0\x12\x13\n\x0bidentity_id\x18\x01 \x01(\x0c\x12\x0f\n\x07key_ids\x18\x02 \x03(\r\x12\r\n\x05prove\x18\x03 \x01(\x08\x42\t\n\x07version\"\x96\x06\n\'GetIdentityKeysRemainingBudgetsResponse\x12z\n\x02v0\x18\x01 \x01(\x0b\x32l.org.dash.platform.dapi.v0.GetIdentityKeysRemainingBudgetsResponse.GetIdentityKeysRemainingBudgetsResponseV0H\x00\x1a\xe3\x04\n)GetIdentityKeysRemainingBudgetsResponseV0\x12\xa4\x01\n\x16keys_remaining_budgets\x18\x01 \x01(\x0b\x32\x81\x01.org.dash.platform.dapi.v0.GetIdentityKeysRemainingBudgetsResponse.GetIdentityKeysRemainingBudgetsResponseV0.KeysRemainingBudgetsH\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\x61\n\x17KeyRemainingBudgetEntry\x12\x0e\n\x06key_id\x18\x01 \x01(\r\x12!\n\x10remaining_budget\x18\x02 \x01(\x04\x42\x02\x30\x01H\x00\x88\x01\x01\x42\x13\n\x11_remaining_budget\x1a\xaf\x01\n\x14KeysRemainingBudgets\x12\x96\x01\n\x07\x65ntries\x18\x01 \x03(\x0b\x32\x84\x01.org.dash.platform.dapi.v0.GetIdentityKeysRemainingBudgetsResponse.GetIdentityKeysRemainingBudgetsResponseV0.KeyRemainingBudgetEntryB\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\"\x8c\x02\n%GetDataContractsLatestVersionsRequest\x12v\n\x02v0\x18\x01 \x01(\x0b\x32h.org.dash.platform.dapi.v0.GetDataContractsLatestVersionsRequest.GetDataContractsLatestVersionsRequestV0H\x00\x1a`\n\'GetDataContractsLatestVersionsRequestV0\x12\x0b\n\x03ids\x18\x01 \x03(\x0c\x12\x19\n\x11include_contracts\x18\x02 \x01(\x08\x12\r\n\x05prove\x18\x03 \x01(\x08\x42\t\n\x07version\"\xfa\x05\n&GetDataContractsLatestVersionsResponse\x12x\n\x02v0\x18\x01 \x01(\x0b\x32j.org.dash.platform.dapi.v0.GetDataContractsLatestVersionsResponse.GetDataContractsLatestVersionsResponseV0H\x00\x1a\x84\x01\n\x1e\x44\x61taContractLatestVersionEntry\x12\x12\n\nidentifier\x18\x01 \x01(\x0c\x12\x14\n\x07version\x18\x02 \x01(\rH\x00\x88\x01\x01\x12\x1a\n\rdata_contract\x18\x03 \x01(\x0cH\x01\x88\x01\x01\x42\n\n\x08_versionB\x10\n\x0e_data_contract\x1a\x90\x01\n\x1b\x44\x61taContractsLatestVersions\x12q\n\x07\x65ntries\x18\x01 \x03(\x0b\x32`.org.dash.platform.dapi.v0.GetDataContractsLatestVersionsResponse.DataContractLatestVersionEntry\x1a\xb0\x02\n(GetDataContractsLatestVersionsResponseV0\x12\x87\x01\n\x1e\x64\x61ta_contracts_latest_versions\x18\x01 \x01(\x0b\x32].org.dash.platform.dapi.v0.GetDataContractsLatestVersionsResponse.DataContractsLatestVersionsH\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\"R\n\x1f\x43ontractGroupDocumentTypeMember\x12\x13\n\x0b\x63ontract_id\x18\x01 \x01(\x0c\x12\x1a\n\x12\x64ocument_type_name\x18\x02 \x01(\t\"G\n\x18\x43ontractGroupTokenMember\x12\x13\n\x0b\x63ontract_id\x18\x01 \x01(\x0c\x12\x16\n\x0etoken_position\x18\x02 \x01(\r\"\xd7\x01\n\x1bGetContractGroupInfoRequest\x12\x62\n\x02v0\x18\x01 \x01(\x0b\x32T.org.dash.platform.dapi.v0.GetContractGroupInfoRequest.GetContractGroupInfoRequestV0H\x00\x1aI\n\x1dGetContractGroupInfoRequestV0\x12\x19\n\x11\x63ontract_group_id\x18\x01 \x01(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\x98\x04\n\x1cGetContractGroupInfoResponse\x12\x64\n\x02v0\x18\x01 \x01(\x0b\x32V.org.dash.platform.dapi.v0.GetContractGroupInfoResponse.GetContractGroupInfoResponseV0H\x00\x1a~\n\x11\x43ontractGroupInfo\x12\x10\n\x08owner_id\x18\x01 \x01(\x0c\x12\x11\n\tadmin_ids\x18\x02 \x03(\x0c\x12\x11\n\x04name\x18\x03 \x01(\tH\x00\x88\x01\x01\x12\x18\n\x0b\x64\x65scription\x18\x04 \x01(\tH\x01\x88\x01\x01\x42\x07\n\x05_nameB\x0e\n\x0c_description\x1a\x86\x02\n\x1eGetContractGroupInfoResponseV0\x12h\n\x13\x63ontract_group_info\x18\x01 \x01(\x0b\x32I.org.dash.platform.dapi.v0.GetContractGroupInfoResponse.ContractGroupInfoH\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\"\xf8\x06\n\x1eGetContractGroupMembersRequest\x12h\n\x02v0\x18\x01 \x01(\x0b\x32Z.org.dash.platform.dapi.v0.GetContractGroupMembersRequest.GetContractGroupMembersRequestV0H\x00\x1a@\n\x14\x43ontractMembersQuery\x12\x18\n\x0bstart_after\x18\x01 \x01(\x0cH\x00\x88\x01\x01\x42\x0e\n\x0c_start_after\x1a\x80\x01\n\x18\x44ocumentTypeMembersQuery\x12T\n\x0bstart_after\x18\x01 \x01(\x0b\x32:.org.dash.platform.dapi.v0.ContractGroupDocumentTypeMemberH\x00\x88\x01\x01\x42\x0e\n\x0c_start_after\x1ar\n\x11TokenMembersQuery\x12M\n\x0bstart_after\x18\x01 \x01(\x0b\x32\x33.org.dash.platform.dapi.v0.ContractGroupTokenMemberH\x00\x88\x01\x01\x42\x0e\n\x0c_start_after\x1a\xa7\x03\n GetContractGroupMembersRequestV0\x12\x19\n\x11\x63ontract_group_id\x18\x01 \x01(\x0c\x12\x63\n\tcontracts\x18\x02 \x01(\x0b\x32N.org.dash.platform.dapi.v0.GetContractGroupMembersRequest.ContractMembersQueryH\x00\x12l\n\x0e\x64ocument_types\x18\x03 \x01(\x0b\x32R.org.dash.platform.dapi.v0.GetContractGroupMembersRequest.DocumentTypeMembersQueryH\x00\x12]\n\x06tokens\x18\x04 \x01(\x0b\x32K.org.dash.platform.dapi.v0.GetContractGroupMembersRequest.TokenMembersQueryH\x00\x12\x12\n\x05limit\x18\x05 \x01(\rH\x01\x88\x01\x01\x12\r\n\x05prove\x18\x06 \x01(\x08\x42\t\n\x07membersB\x08\n\x06_limitB\t\n\x07version\"\xc9\x06\n\x1fGetContractGroupMembersResponse\x12j\n\x02v0\x18\x01 \x01(\x0b\x32\\.org.dash.platform.dapi.v0.GetContractGroupMembersResponse.GetContractGroupMembersResponseV0H\x00\x1a\'\n\x0f\x43ontractMembers\x12\x14\n\x0c\x63ontract_ids\x18\x01 \x03(\x0c\x1ai\n\x13\x44ocumentTypeMembers\x12R\n\x0e\x64ocument_types\x18\x01 \x03(\x0b\x32:.org.dash.platform.dapi.v0.ContractGroupDocumentTypeMember\x1aS\n\x0cTokenMembers\x12\x43\n\x06tokens\x18\x01 \x03(\x0b\x32\x33.org.dash.platform.dapi.v0.ContractGroupTokenMember\x1a\xc5\x03\n!GetContractGroupMembersResponseV0\x12_\n\tcontracts\x18\x01 \x01(\x0b\x32J.org.dash.platform.dapi.v0.GetContractGroupMembersResponse.ContractMembersH\x00\x12h\n\x0e\x64ocument_types\x18\x02 \x01(\x0b\x32N.org.dash.platform.dapi.v0.GetContractGroupMembersResponse.DocumentTypeMembersH\x00\x12Y\n\x06tokens\x18\x03 \x01(\x0b\x32G.org.dash.platform.dapi.v0.GetContractGroupMembersResponse.TokenMembersH\x00\x12\x31\n\x05proof\x18\x04 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x05 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadataB\x08\n\x06resultB\t\n\x07version\"M\n\x1a\x43ontractModerationDocument\x12\x1a\n\x12\x64ocument_type_name\x18\x01 \x01(\t\x12\x13\n\x0b\x64ocument_id\x18\x02 \x01(\x0c\"\xc6\x01\n\x18\x43ontractModerationReason\x12\x11\n\x04\x63ode\x18\x01 \x01(\rH\x00\x88\x01\x01\x12\x0c\n\x04text\x18\x02 \x01(\t\x12H\n\tdocuments\x18\x03 \x03(\x0b\x32\x35.org.dash.platform.dapi.v0.ContractModerationDocument\x12\x1f\n\x12reason_document_id\x18\x04 \x01(\x0cH\x01\x88\x01\x01\x42\x07\n\x05_codeB\x15\n\x13_reason_document_id\"i\n\x0f\x43ontractWarning\x12\x11\n\twarned_at\x18\x01 \x01(\x04\x12\x43\n\x06reason\x18\x02 \x01(\x0b\x32\x33.org.dash.platform.dapi.v0.ContractModerationReason\"\xc5\x02\n\"GetContractModerationStatusRequest\x12p\n\x02v0\x18\x01 \x01(\x0b\x32\x62.org.dash.platform.dapi.v0.GetContractModerationStatusRequest.GetContractModerationStatusRequestV0H\x00\x1a\xa1\x01\n$GetContractModerationStatusRequestV0\x12\x13\n\x0b\x63ontract_id\x18\x01 \x01(\x0c\x12\x13\n\x0bidentity_id\x18\x02 \x01(\x0c\x12@\n\x05lists\x18\x03 \x03(\x0e\x32\x31.org.dash.platform.dapi.v0.ContractModerationList\x12\r\n\x05prove\x18\x04 \x01(\x08\x42\t\n\x07version\"\xec\x06\n#GetContractModerationStatusResponse\x12r\n\x02v0\x18\x01 \x01(\x0b\x32\x64.org.dash.platform.dapi.v0.GetContractModerationStatusResponse.GetContractModerationStatusResponseV0H\x00\x1a\xb4\x03\n\x18\x43ontractModerationStatus\x12\x13\n\x06\x62\x61nned\x18\x01 \x01(\x08H\x00\x88\x01\x01\x12\x1c\n\x0fsuspended_until\x18\x02 \x01(\x04H\x01\x88\x01\x01\x12@\n\x05lists\x18\x03 \x03(\x0e\x32\x31.org.dash.platform.dapi.v0.ContractModerationList\x12L\n\nban_reason\x18\x04 \x01(\x0b\x32\x33.org.dash.platform.dapi.v0.ContractModerationReasonH\x02\x88\x01\x01\x12S\n\x11suspension_reason\x18\x05 \x01(\x0b\x32\x33.org.dash.platform.dapi.v0.ContractModerationReasonH\x03\x88\x01\x01\x12<\n\x08warnings\x18\x06 \x03(\x0b\x32*.org.dash.platform.dapi.v0.ContractWarningB\t\n\x07_bannedB\x12\n\x10_suspended_untilB\r\n\x0b_ban_reasonB\x14\n\x12_suspension_reason\x1a\x8e\x02\n%GetContractModerationStatusResponseV0\x12i\n\x06status\x18\x01 \x01(\x0b\x32W.org.dash.platform.dapi.v0.GetContractModerationStatusResponse.ContractModerationStatusH\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\x02\n#GetContractModerationEntriesRequest\x12r\n\x02v0\x18\x01 \x01(\x0b\x32\x64.org.dash.platform.dapi.v0.GetContractModerationEntriesRequest.GetContractModerationEntriesRequestV0H\x00\x1a\xd4\x01\n%GetContractModerationEntriesRequestV0\x12\x13\n\x0b\x63ontract_id\x18\x01 \x01(\x0c\x12?\n\x04list\x18\x02 \x01(\x0e\x32\x31.org.dash.platform.dapi.v0.ContractModerationList\x12\x18\n\x0bstart_after\x18\x03 \x01(\x0cH\x00\x88\x01\x01\x12\x12\n\x05limit\x18\x04 \x01(\rH\x01\x88\x01\x01\x12\r\n\x05prove\x18\x05 \x01(\x08\x42\x0e\n\x0c_start_afterB\x08\n\x06_limitB\t\n\x07version\"\x96\x06\n$GetContractModerationEntriesResponse\x12t\n\x02v0\x18\x01 \x01(\x0b\x32\x66.org.dash.platform.dapi.v0.GetContractModerationEntriesResponse.GetContractModerationEntriesResponseV0H\x00\x1a\xcf\x01\n\x17\x43ontractModerationEntry\x12\x13\n\x0bidentity_id\x18\x01 \x01(\x0c\x12\x12\n\x05until\x18\x02 \x01(\x04H\x00\x88\x01\x01\x12\x43\n\x06reason\x18\x03 \x01(\x0b\x32\x33.org.dash.platform.dapi.v0.ContractModerationReason\x12<\n\x08warnings\x18\x04 \x03(\x0b\x32*.org.dash.platform.dapi.v0.ContractWarningB\x08\n\x06_until\x1a\x85\x01\n\x19\x43ontractModerationEntries\x12h\n\x07\x65ntries\x18\x01 \x03(\x0b\x32W.org.dash.platform.dapi.v0.GetContractModerationEntriesResponse.ContractModerationEntry\x1a\x92\x02\n&GetContractModerationEntriesResponseV0\x12l\n\x07\x65ntries\x18\x01 \x01(\x0b\x32Y.org.dash.platform.dapi.v0.GetContractModerationEntriesResponse.ContractModerationEntriesH\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\"\xc3\x04\n\"GetContractDocumentRemovalsRequest\x12p\n\x02v0\x18\x01 \x01(\x0b\x32\x62.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0H\x00\x1a#\n\x0b\x44ocumentIds\x12\x14\n\x0c\x64ocument_ids\x18\x01 \x03(\x0c\x1aN\n\x04Page\x12\x18\n\x0bstart_after\x18\x01 \x01(\x0cH\x00\x88\x01\x01\x12\x12\n\x05limit\x18\x02 \x01(\rH\x01\x88\x01\x01\x42\x0e\n\x0c_start_afterB\x08\n\x06_limit\x1a\xaa\x02\n$GetContractDocumentRemovalsRequestV0\x12\x13\n\x0b\x63ontract_id\x18\x01 \x01(\x0c\x12\x1a\n\x12\x64ocument_type_name\x18\x02 \x01(\t\x12\x61\n\x0c\x64ocument_ids\x18\x03 \x01(\x0b\x32I.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.DocumentIdsH\x00\x12R\n\x04page\x18\x04 \x01(\x0b\x32\x42.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.PageH\x00\x12\r\n\x05prove\x18\x05 \x01(\x08\x42\x0b\n\tselectionB\t\n\x07version\"\xe0\x07\n#GetContractDocumentRemovalsResponse\x12r\n\x02v0\x18\x01 \x01(\x0b\x32\x64.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0H\x00\x1aH\n\x1b\x43ontractDocumentRestoration\x12\x14\n\x0cmoderator_id\x18\x01 \x01(\x0c\x12\x13\n\x0brestored_at\x18\x02 \x01(\x04\x1a\xd5\x02\n\x17\x43ontractDocumentRemoval\x12\x13\n\x0b\x64ocument_id\x18\x01 \x01(\x0c\x12\x19\n\x11\x64ocument_owner_id\x18\x02 \x01(\x0c\x12\x14\n\x0cmoderator_id\x18\x03 \x01(\x0c\x12\x12\n\nremoved_at\x18\x04 \x01(\x04\x12\x43\n\x06reason\x18\x05 \x01(\x0b\x32\x33.org.dash.platform.dapi.v0.ContractModerationReason\x12\x15\n\rdocument_hash\x18\x06 \x01(\x0c\x12o\n\x0brestoration\x18\x07 \x01(\x0b\x32Z.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRestoration\x12\x13\n\x0bkept_fields\x18\x08 \x01(\x0c\x1a\x84\x01\n\x18\x43ontractDocumentRemovals\x12h\n\x08removals\x18\x01 \x03(\x0b\x32V.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval\x1a\x90\x02\n%GetContractDocumentRemovalsResponseV0\x12k\n\x08removals\x18\x01 \x01(\x0b\x32W.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemovalsH\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\"\xc7\x04\n\x1dGetContractTeamActionsRequest\x12\x66\n\x02v0\x18\x01 \x01(\x0b\x32X.org.dash.platform.dapi.v0.GetContractTeamActionsRequest.GetContractTeamActionsRequestV0H\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\xbc\x02\n\x1fGetContractTeamActionsRequestV0\x12\x13\n\x0b\x63ontract_id\x18\x01 \x01(\x0c\x12U\n\x06status\x18\x02 \x01(\x0e\x32\x45.org.dash.platform.dapi.v0.GetContractTeamActionsRequest.ActionStatus\x12i\n\x12start_at_action_id\x18\x03 \x01(\x0b\x32H.org.dash.platform.dapi.v0.GetContractTeamActionsRequest.StartAtActionIdH\x00\x88\x01\x01\x12\x12\n\x05\x63ount\x18\x04 \x01(\rH\x01\x88\x01\x01\x12\r\n\x05prove\x18\x05 \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\"\xe0\x07\n\x1eGetContractTeamActionsResponse\x12h\n\x02v0\x18\x01 \x01(\x0b\x32Z.org.dash.platform.dapi.v0.GetContractTeamActionsResponse.GetContractTeamActionsResponseV0H\x00\x1a\xe6\x01\n\x15\x44\x65leteSettledDocument\x12\x1a\n\x12\x64ocument_type_name\x18\x01 \x01(\t\x12\x13\n\x0b\x64ocument_id\x18\x02 \x01(\x0c\x12!\n\x19\x64ocument_last_modified_at\x18\x03 \x01(\x04\x12\x1e\n\x11\x64ocument_revision\x18\x04 \x01(\x04H\x00\x88\x01\x01\x12\x43\n\x06reason\x18\x05 \x01(\x0b\x32\x33.org.dash.platform.dapi.v0.ContractModerationReasonB\x14\n\x12_document_revision\x1a\xe6\x01\n\x12\x43ontractTeamAction\x12\x11\n\taction_id\x18\x01 \x01(\x0c\x12\x13\n\x0bproposer_id\x18\x02 \x01(\x0c\x12\x13\n\x0bproposed_at\x18\x03 \x01(\x04\x12r\n\x17\x64\x65lete_settled_document\x18\x04 \x01(\x0b\x32O.org.dash.platform.dapi.v0.GetContractTeamActionsResponse.DeleteSettledDocumentH\x00\x12\x16\n\x0e\x61pproval_count\x18\x05 \x01(\rB\x07\n\x05\x65vent\x1at\n\x13\x43ontractTeamActions\x12]\n\x07\x61\x63tions\x18\x01 \x03(\x0b\x32L.org.dash.platform.dapi.v0.GetContractTeamActionsResponse.ContractTeamAction\x1a\x80\x02\n GetContractTeamActionsResponseV0\x12`\n\x07\x61\x63tions\x18\x01 \x01(\x0b\x32M.org.dash.platform.dapi.v0.GetContractTeamActionsResponse.ContractTeamActionsH\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\"\x8a\x03\n#GetContractTeamActionSignersRequest\x12r\n\x02v0\x18\x01 \x01(\x0b\x32\x64.org.dash.platform.dapi.v0.GetContractTeamActionSignersRequest.GetContractTeamActionSignersRequestV0H\x00\x1a\xbb\x01\n%GetContractTeamActionSignersRequestV0\x12\x13\n\x0b\x63ontract_id\x18\x01 \x01(\x0c\x12[\n\x06status\x18\x02 \x01(\x0e\x32K.org.dash.platform.dapi.v0.GetContractTeamActionSignersRequest.ActionStatus\x12\x11\n\taction_id\x18\x03 \x01(\x0c\x12\r\n\x05prove\x18\x04 \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\"\xed\x03\n$GetContractTeamActionSignersResponse\x12t\n\x02v0\x18\x01 \x01(\x0b\x32\x66.org.dash.platform.dapi.v0.GetContractTeamActionSignersResponse.GetContractTeamActionSignersResponseV0H\x00\x1a/\n\x19\x43ontractTeamActionSigners\x12\x12\n\nsigner_ids\x18\x01 \x03(\x0c\x1a\x92\x02\n&GetContractTeamActionSignersResponseV0\x12l\n\x07signers\x18\x01 \x01(\x0b\x32Y.org.dash.platform.dapi.v0.GetContractTeamActionSignersResponse.ContractTeamActionSignersH\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\"\x85\x02\n(GetContractModerationActionCountsRequest\x12|\n\x02v0\x18\x01 \x01(\x0b\x32n.org.dash.platform.dapi.v0.GetContractModerationActionCountsRequest.GetContractModerationActionCountsRequestV0H\x00\x1aP\n*GetContractModerationActionCountsRequestV0\x12\x13\n\x0b\x63ontract_id\x18\x01 \x01(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\xb5\x05\n)GetContractModerationActionCountsResponse\x12~\n\x02v0\x18\x01 \x01(\x0b\x32p.org.dash.platform.dapi.v0.GetContractModerationActionCountsResponse.GetContractModerationActionCountsResponseV0H\x00\x1a\x43\n\x1d\x43ontractModerationActionCount\x12\x13\n\x0bidentity_id\x18\x01 \x01(\x0c\x12\r\n\x05\x63ount\x18\x02 \x01(\r\x1a\x94\x01\n\x1e\x43ontractModerationActionCounts\x12r\n\x06\x63ounts\x18\x01 \x03(\x0b\x32\x62.org.dash.platform.dapi.v0.GetContractModerationActionCountsResponse.ContractModerationActionCount\x1a\xa0\x02\n+GetContractModerationActionCountsResponseV0\x12u\n\x06\x63ounts\x18\x01 \x01(\x0b\x32\x63.org.dash.platform.dapi.v0.GetContractModerationActionCountsResponse.ContractModerationActionCountsH\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\"\xc9\x01\n\x19GetContractFeePotsRequest\x12^\n\x02v0\x18\x01 \x01(\x0b\x32P.org.dash.platform.dapi.v0.GetContractFeePotsRequest.GetContractFeePotsRequestV0H\x00\x1a\x41\n\x1bGetContractFeePotsRequestV0\x12\x13\n\x0b\x63ontract_id\x18\x01 \x01(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\x9f\x06\n\x1aGetContractFeePotsResponse\x12`\n\x02v0\x18\x01 \x01(\x0b\x32R.org.dash.platform.dapi.v0.GetContractFeePotsResponse.GetContractFeePotsResponseV0H\x00\x1aR\n\x17\x43ontractFeePotLastClaim\x12\r\n\x05\x65poch\x18\x01 \x01(\r\x12\x13\n\x07time_ms\x18\x02 \x01(\x04\x42\x02\x30\x01\x12\x13\n\x0b\x63laimant_id\x18\x03 \x01(\x0c\x1a\x88\x01\n\x0e\x43ontractFeePot\x12\x13\n\x07\x63redits\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\x61\n\nlast_claim\x18\x02 \x01(\x0b\x32M.org.dash.platform.dapi.v0.GetContractFeePotsResponse.ContractFeePotLastClaim\x1a\xc0\x01\n\x0f\x43ontractFeePots\x12S\n\x05owner\x18\x01 \x01(\x0b\x32\x44.org.dash.platform.dapi.v0.GetContractFeePotsResponse.ContractFeePot\x12X\n\nmoderators\x18\x02 \x01(\x0b\x32\x44.org.dash.platform.dapi.v0.GetContractFeePotsResponse.ContractFeePot\x1a\xf1\x01\n\x1cGetContractFeePotsResponseV0\x12U\n\x04pots\x18\x01 \x01(\x0b\x32\x45.org.dash.platform.dapi.v0.GetContractFeePotsResponse.ContractFeePotsH\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\"\xf1\x01\n#GetContractGroupsForContractRequest\x12r\n\x02v0\x18\x01 \x01(\x0b\x32\x64.org.dash.platform.dapi.v0.GetContractGroupsForContractRequest.GetContractGroupsForContractRequestV0H\x00\x1aK\n%GetContractGroupsForContractRequestV0\x12\x13\n\x0b\x63ontract_id\x18\x01 \x01(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\xf5\x06\n$GetContractGroupsForContractResponse\x12t\n\x02v0\x18\x01 \x01(\x0b\x32\x66.org.dash.platform.dapi.v0.GetContractGroupsForContractResponse.GetContractGroupsForContractResponseV0H\x00\x1aQ\n\x17\x44ocumentTypeMemberships\x12\x1a\n\x12\x64ocument_type_name\x18\x01 \x01(\t\x12\x1a\n\x12\x63ontract_group_ids\x18\x02 \x03(\x0c\x1a\x46\n\x10TokenMemberships\x12\x16\n\x0etoken_position\x18\x01 \x01(\r\x12\x1a\n\x12\x63ontract_group_ids\x18\x02 \x03(\x0c\x1a\x89\x02\n\x18\x43ontractGroupMemberships\x12\x1a\n\x12\x63ontract_group_ids\x18\x01 \x03(\x0c\x12o\n\x0e\x64ocument_types\x18\x02 \x03(\x0b\x32W.org.dash.platform.dapi.v0.GetContractGroupsForContractResponse.DocumentTypeMemberships\x12`\n\x06tokens\x18\x03 \x03(\x0b\x32P.org.dash.platform.dapi.v0.GetContractGroupsForContractResponse.TokenMemberships\x1a\xa4\x02\n&GetContractGroupsForContractResponseV0\x12~\n\x1a\x63ontract_group_memberships\x18\x01 \x01(\x0b\x32X.org.dash.platform.dapi.v0.GetContractGroupsForContractResponse.ContractGroupMembershipsH\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\"\xad\x02\n\x1eGetDataContractsByRangeRequest\x12h\n\x02v0\x18\x01 \x01(\x0b\x32Z.org.dash.platform.dapi.v0.GetDataContractsByRangeRequest.GetDataContractsByRangeRequestV0H\x00\x1a\x95\x01\n GetDataContractsByRangeRequestV0\x12\x12\n\x05limit\x18\x01 \x01(\rH\x01\x88\x01\x01\x12\x15\n\x0bstart_after\x18\x02 \x01(\x0cH\x00\x12\x12\n\x08start_at\x18\x03 \x01(\x0cH\x00\x12\x10\n\x08ids_only\x18\x04 \x01(\x08\x12\r\n\x05prove\x18\x05 \x01(\x08\x42\x07\n\x05startB\x08\n\x06_limitB\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\"\xf8\"\n\x13GetDocumentsRequest\x12R\n\x02v0\x18\x01 \x01(\x0b\x32\x44.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0H\x00\x12R\n\x02v1\x18\x02 \x01(\x0b\x32\x44.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1H\x00\x1a\xfe\x02\n\x12\x44ocumentFieldValue\x12\x14\n\nbool_value\x18\x01 \x01(\x08H\x00\x12\x19\n\x0bint64_value\x18\x02 \x01(\x12\x42\x02\x30\x01H\x00\x12\x1a\n\x0cuint64_value\x18\x03 \x01(\x04\x42\x02\x30\x01H\x00\x12\x16\n\x0c\x64ouble_value\x18\x04 \x01(\x01H\x00\x12\x0e\n\x04text\x18\x05 \x01(\tH\x00\x12\x15\n\x0b\x62ytes_value\x18\x06 \x01(\x0cH\x00\x12[\n\x04list\x18\x07 \x01(\x0b\x32K.org.dash.platform.dapi.v0.GetDocumentsRequest.DocumentFieldValue.ValueListH\x00\x12\x14\n\nnull_value\x18\x08 \x01(\x08H\x00\x1a^\n\tValueList\x12Q\n\x06values\x18\x01 \x03(\x0b\x32\x41.org.dash.platform.dapi.v0.GetDocumentsRequest.DocumentFieldValueB\t\n\x07variant\x1a\xe2\x02\n\x12TimeRangeSelection\x12\\\n\x08selector\x18\x01 \x01(\x0e\x32J.org.dash.platform.dapi.v0.GetDocumentsRequest.TimeRangeSelection.Selector\x12\x19\n\x08start_ms\x18\x02 \x01(\x04\x42\x02\x30\x01H\x00\x88\x01\x01\x12T\n\x04grid\x18\x03 \x01(\x0b\x32\x46.org.dash.platform.dapi.v0.GetDocumentsRequest.TimeRangeSelection.Grid\x1a>\n\x04Grid\x12\x11\n\x05range\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\x10\n\x04step\x18\x02 \x01(\x04\x42\x02\x30\x01\x12\x11\n\x05phase\x18\x03 \x01(\x04\x42\x02\x30\x01\"0\n\x08Selector\x12\n\n\x06NEWEST\x10\x00\x12\n\n\x06OLDEST\x10\x01\x12\x0c\n\x08\x42Y_START\x10\x02\x42\x0b\n\t_start_ms\x1a\x82\x02\n\x15IntegerRangeSelection\x12P\n\x05start\x18\x01 \x01(\x0b\x32\x41.org.dash.platform.dapi.v0.GetDocumentsRequest.DocumentFieldValue\x12W\n\x04grid\x18\x02 \x01(\x0b\x32I.org.dash.platform.dapi.v0.GetDocumentsRequest.IntegerRangeSelection.Grid\x1a>\n\x04Grid\x12\x11\n\x05range\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\x10\n\x04step\x18\x02 \x01(\x04\x42\x02\x30\x01\x12\x11\n\x05phase\x18\x03 \x01(\x04\x42\x02\x30\x01\x1a\xf2\x02\n\x0bWhereClause\x12\r\n\x05\x66ield\x18\x01 \x01(\t\x12N\n\x08operator\x18\x02 \x01(\x0e\x32<.org.dash.platform.dapi.v0.GetDocumentsRequest.WhereOperator\x12P\n\x05value\x18\x03 \x01(\x0b\x32\x41.org.dash.platform.dapi.v0.GetDocumentsRequest.DocumentFieldValue\x12U\n\ntime_range\x18\x04 \x01(\x0b\x32\x41.org.dash.platform.dapi.v0.GetDocumentsRequest.TimeRangeSelection\x12[\n\rinteger_range\x18\x05 \x01(\x0b\x32\x44.org.dash.platform.dapi.v0.GetDocumentsRequest.IntegerRangeSelection\x1a\xa4\x01\n\x0fHavingAggregate\x12Y\n\x08\x66unction\x18\x01 \x01(\x0e\x32G.org.dash.platform.dapi.v0.GetDocumentsRequest.HavingAggregate.Function\x12\r\n\x05\x66ield\x18\x02 \x01(\t\"\'\n\x08\x46unction\x12\t\n\x05\x43OUNT\x10\x00\x12\x07\n\x03SUM\x10\x01\x12\x07\n\x03\x41VG\x10\x02\x1a\xf9\x03\n\x0cHavingClause\x12Q\n\taggregate\x18\x01 \x01(\x0b\x32>.org.dash.platform.dapi.v0.GetDocumentsRequest.HavingAggregate\x12V\n\x08operator\x18\x02 \x01(\x0e\x32\x44.org.dash.platform.dapi.v0.GetDocumentsRequest.HavingClause.Operator\x12R\n\x05value\x18\x03 \x01(\x0b\x32\x41.org.dash.platform.dapi.v0.GetDocumentsRequest.DocumentFieldValueH\x00\"\xe0\x01\n\x08Operator\x12\t\n\x05\x45QUAL\x10\x00\x12\r\n\tNOT_EQUAL\x10\x01\x12\x10\n\x0cGREATER_THAN\x10\x02\x12\x1a\n\x16GREATER_THAN_OR_EQUALS\x10\x03\x12\r\n\tLESS_THAN\x10\x04\x12\x17\n\x13LESS_THAN_OR_EQUALS\x10\x05\x12\x0b\n\x07\x42\x45TWEEN\x10\x06\x12\x1a\n\x16\x42\x45TWEEN_EXCLUDE_BOUNDS\x10\x07\x12\x18\n\x14\x42\x45TWEEN_EXCLUDE_LEFT\x10\x08\x12\x19\n\x15\x42\x45TWEEN_EXCLUDE_RIGHT\x10\t\x12\x06\n\x02IN\x10\nB\x07\n\x05right\x1a\x90\x01\n\x0bOrderClause\x12\x0f\n\x05\x66ield\x18\x01 \x01(\tH\x00\x12S\n\taggregate\x18\x03 \x01(\x0b\x32>.org.dash.platform.dapi.v0.GetDocumentsRequest.HavingAggregateH\x00\x12\x11\n\tascending\x18\x02 \x01(\x08\x42\x08\n\x06target\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\x05start\x1a\xa6\x0c\n\x15GetDocumentsRequestV1\x12\x18\n\x10\x64\x61ta_contract_id\x18\x01 \x01(\x0c\x12\x15\n\rdocument_type\x18\x02 \x01(\t\x12Q\n\rwhere_clauses\x18\x03 \x03(\x0b\x32:.org.dash.platform.dapi.v0.GetDocumentsRequest.WhereClause\x12L\n\x08order_by\x18\x04 \x03(\x0b\x32:.org.dash.platform.dapi.v0.GetDocumentsRequest.OrderClause\x12\x12\n\x05limit\x18\x05 \x01(\rH\x01\x88\x01\x01\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\x12\\\n\x07selects\x18\t \x03(\x0b\x32K.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.Select\x12\x10\n\x08group_by\x18\n \x03(\t\x12K\n\x06having\x18\x0b \x03(\x0b\x32;.org.dash.platform.dapi.v0.GetDocumentsRequest.HavingClause\x12\x13\n\x06offset\x18\x0c \x01(\rH\x02\x88\x01\x01\x12\x61\n\x07\x63hained\x18\r \x01(\x0b\x32P.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.ChainedJoin\x12\x62\n\x0bsub_queries\x18\x0e \x03(\x0b\x32M.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.SubQuery\x1a\xc9\x01\n\x06Select\x12\x66\n\x08\x66unction\x18\x01 \x01(\x0e\x32T.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.Select.Function\x12\r\n\x05\x66ield\x18\x02 \x01(\t\"H\n\x08\x46unction\x12\r\n\tDOCUMENTS\x10\x00\x12\t\n\x05\x43OUNT\x10\x01\x12\x07\n\x03SUM\x10\x02\x12\x07\n\x03\x41VG\x10\x03\x12\x07\n\x03MIN\x10\x04\x12\x07\n\x03MAX\x10\x05\x1a\x41\n\x0b\x43hainedJoin\x12\x15\n\rjoin_property\x18\x01 \x01(\t\x12\x1b\n\x13outer_document_type\x18\x02 \x01(\t\x1a\xa6\x04\n\x08SubQuery\x12\x18\n\x10\x64\x61ta_contract_id\x18\x01 \x01(\x0c\x12\x15\n\rdocument_type\x18\x02 \x01(\t\x12Q\n\rwhere_clauses\x18\x03 \x03(\x0b\x32:.org.dash.platform.dapi.v0.GetDocumentsRequest.WhereClause\x12L\n\x08order_by\x18\x04 \x03(\x0b\x32:.org.dash.platform.dapi.v0.GetDocumentsRequest.OrderClause\x12\x12\n\x05limit\x18\x05 \x01(\rH\x00\x88\x01\x01\x12`\n\x04kind\x18\x06 \x01(\x0e\x32R.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.SubQuery.Kind\x12\x63\n\x04\x62ind\x18\x07 \x01(\x0b\x32U.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.SubQuery.Binding\x1a\x41\n\x07\x42inding\x12\x0e\n\x06source\x18\x01 \x01(\r\x12\x17\n\x0fsource_property\x18\x02 \x01(\t\x12\r\n\x05\x66ield\x18\x03 \x01(\t\" \n\x04Kind\x12\r\n\tDOCUMENTS\x10\x00\x12\t\n\x05\x43OUNT\x10\x01\x42\x08\n\x06_limitB\x07\n\x05startB\x08\n\x06_limitB\t\n\x07_offset\"\xb0\x02\n\rWhereOperator\x12\t\n\x05\x45QUAL\x10\x00\x12\x10\n\x0cGREATER_THAN\x10\x01\x12\x1a\n\x16GREATER_THAN_OR_EQUALS\x10\x02\x12\r\n\tLESS_THAN\x10\x03\x12\x17\n\x13LESS_THAN_OR_EQUALS\x10\x04\x12\x0b\n\x07\x42\x45TWEEN\x10\x05\x12\x1a\n\x16\x42\x45TWEEN_EXCLUDE_BOUNDS\x10\x06\x12\x18\n\x14\x42\x45TWEEN_EXCLUDE_LEFT\x10\x07\x12\x19\n\x15\x42\x45TWEEN_EXCLUDE_RIGHT\x10\x08\x12\x06\n\x02IN\x10\t\x12\x0f\n\x0bSTARTS_WITH\x10\n\x12\x11\n\rIN_TIME_RANGE\x10\x0b\x12\x14\n\x10IN_INTEGER_RANGE\x10\x0c\x12\x0c\n\x08\x43ONTAINS\x10\r\x12\x10\n\x0c\x43ONTAINS_ANY\x10\x0e\x42\t\n\x07version\"\xd5\x1d\n\x14GetDocumentsResponse\x12T\n\x02v0\x18\x01 \x01(\x0b\x32\x46.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0H\x00\x12T\n\x02v1\x18\x02 \x01(\x0b\x32\x46.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1H\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\x06result\x1a\xe7\x19\n\x16GetDocumentsResponseV1\x12\x61\n\x04\x64\x61ta\x18\x01 \x01(\x0b\x32Q.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultDataH\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\x1aL\n\nCountEntry\x12\x13\n\x06in_key\x18\x01 \x01(\x0cH\x00\x88\x01\x01\x12\x0b\n\x03key\x18\x02 \x01(\x0c\x12\x11\n\x05\x63ount\x18\x03 \x01(\x04\x42\x02\x30\x01\x42\t\n\x07_in_key\x1ar\n\x0c\x43ountEntries\x12\x62\n\x07\x65ntries\x18\x01 \x03(\x0b\x32Q.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry\x1a\xa0\x01\n\x0c\x43ountResults\x12\x1d\n\x0f\x61ggregate_count\x18\x01 \x01(\x04\x42\x02\x30\x01H\x00\x12\x66\n\x07\x65ntries\x18\x02 \x01(\x0b\x32S.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntriesH\x00\x42\t\n\x07variant\x1aH\n\x08SumEntry\x12\x13\n\x06in_key\x18\x01 \x01(\x0cH\x00\x88\x01\x01\x12\x0b\n\x03key\x18\x02 \x01(\x0c\x12\x0f\n\x03sum\x18\x03 \x01(\x12\x42\x02\x30\x01\x42\t\n\x07_in_key\x1an\n\nSumEntries\x12`\n\x07\x65ntries\x18\x01 \x03(\x0b\x32O.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.SumEntry\x1a\x9a\x01\n\nSumResults\x12\x1b\n\raggregate_sum\x18\x01 \x01(\x12\x42\x02\x30\x01H\x00\x12\x64\n\x07\x65ntries\x18\x02 \x01(\x0b\x32Q.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.SumEntriesH\x00\x42\t\n\x07variant\x1a_\n\x0c\x41verageEntry\x12\x13\n\x06in_key\x18\x01 \x01(\x0cH\x00\x88\x01\x01\x12\x0b\n\x03key\x18\x02 \x01(\x0c\x12\x11\n\x05\x63ount\x18\x03 \x01(\x04\x42\x02\x30\x01\x12\x0f\n\x03sum\x18\x04 \x01(\x12\x42\x02\x30\x01\x42\t\n\x07_in_key\x1av\n\x0e\x41verageEntries\x12\x64\n\x07\x65ntries\x18\x01 \x03(\x0b\x32S.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.AverageEntry\x1a\x36\n\x10\x41verageAggregate\x12\x11\n\x05\x63ount\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\x0f\n\x03sum\x18\x02 \x01(\x12\x42\x02\x30\x01\x1a\xfb\x01\n\x0e\x41verageResults\x12t\n\x11\x61ggregate_average\x18\x01 \x01(\x0b\x32W.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.AverageAggregateH\x00\x12h\n\x07\x65ntries\x18\x02 \x01(\x0b\x32U.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.AverageEntriesH\x00\x42\t\n\x07variant\x1az\n\x0bRankedEntry\x12\x0b\n\x03key\x18\x01 \x01(\x0c\x12\x13\n\x05\x63ount\x18\x02 \x01(\x04\x42\x02\x30\x01H\x00\x12\x11\n\x03sum\x18\x03 \x01(\x12\x42\x02\x30\x01H\x00\x12\r\n\x03\x61vg\x18\x04 \x01(\x01H\x00\x12\x13\n\x06in_key\x18\x05 \x01(\x0cH\x01\x88\x01\x01\x42\x07\n\x05valueB\t\n\x07_in_key\x1a\x9a\x01\n\rRankedEntries\x12\x63\n\x07\x65ntries\x18\x01 \x03(\x0b\x32R.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.RankedEntry\x12\x18\n\x07skipped\x18\x02 \x01(\x04\x42\x02\x30\x01H\x00\x88\x01\x01\x42\n\n\x08_skipped\x1a\xf7\x05\n\nResultData\x12\x65\n\tdocuments\x18\x01 \x01(\x0b\x32P.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.DocumentsH\x00\x12\x65\n\x06\x63ounts\x18\x02 \x01(\x0b\x32S.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResultsH\x00\x12\x61\n\x04sums\x18\x03 \x01(\x0b\x32Q.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.SumResultsH\x00\x12i\n\x08\x61verages\x18\x04 \x01(\x0b\x32U.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.AverageResultsH\x00\x12\x66\n\x06ranked\x18\x05 \x01(\x0b\x32T.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.RankedEntriesH\x00\x12j\n\x07\x63hained\x18\x06 \x01(\x0b\x32W.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ChainedDocumentsH\x00\x12n\n\tcomposite\x18\x07 \x01(\x0b\x32Y.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CompositeDocumentsH\x00\x42\t\n\x07variant\x1a\xd8\x01\n\x10\x43hainedDocuments\x12\x17\n\x0finner_documents\x18\x01 \x03(\x0c\x12\x17\n\x0fouter_documents\x18\x02 \x03(\x0c\x12\x19\n\x11missing_outer_ids\x18\x03 \x03(\x0c\x12w\n\x17removed_outer_documents\x18\x04 \x03(\x0b\x32V.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval\x1a\x94\x04\n\x12\x43ompositeDocuments\x12\x16\n\x0epage_documents\x18\x01 \x03(\x0c\x12}\n\x0bsub_results\x18\x02 \x03(\x0b\x32h.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CompositeDocuments.SubQueryResult\x1a\xe6\x02\n\x0eSubQueryResult\x12\x65\n\tdocuments\x18\x01 \x01(\x0b\x32P.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.DocumentsH\x00\x12\x65\n\x06\x63ounts\x18\x02 \x01(\x0b\x32S.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntriesH\x00\x12\x13\n\x0bmissing_ids\x18\x03 \x03(\x0c\x12g\n\x07removed\x18\x04 \x03(\x0b\x32V.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemovalB\x08\n\x06resultB\x08\n\x06resultB\t\n\x07version\"\xf4\x02\n\x19GetDocumentHistoryRequest\x12^\n\x02v0\x18\x01 \x01(\x0b\x32P.org.dash.platform.dapi.v0.GetDocumentHistoryRequest.GetDocumentHistoryRequestV0H\x00\x1a\xeb\x01\n\x1bGetDocumentHistoryRequestV0\x12\x18\n\x10\x64\x61ta_contract_id\x18\x01 \x01(\x0c\x12\x1a\n\x12\x64ocument_type_name\x18\x02 \x01(\t\x12\x13\n\x0b\x64ocument_id\x18\x03 \x01(\x0c\x12+\n\x05limit\x18\x04 \x01(\x0b\x32\x1c.google.protobuf.UInt32Value\x12,\n\x06offset\x18\x05 \x01(\x0b\x32\x1c.google.protobuf.UInt32Value\x12\x17\n\x0bstart_at_ms\x18\x06 \x01(\x04\x42\x02\x30\x01\x12\r\n\x05prove\x18\x07 \x01(\x08\x42\t\n\x07version\"\xf7\x04\n\x1aGetDocumentHistoryResponse\x12`\n\x02v0\x18\x01 \x01(\x0b\x32R.org.dash.platform.dapi.v0.GetDocumentHistoryResponse.GetDocumentHistoryResponseV0H\x00\x1a\xeb\x03\n\x1cGetDocumentHistoryResponseV0\x12~\n\x10\x64ocument_history\x18\x01 \x01(\x0b\x32\x62.org.dash.platform.dapi.v0.GetDocumentHistoryResponse.GetDocumentHistoryResponseV0.DocumentHistoryH\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\x37\n\x14\x44ocumentHistoryEntry\x12\x10\n\x04\x64\x61te\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\r\n\x05value\x18\x02 \x01(\x0c\x1a\x95\x01\n\x0f\x44ocumentHistory\x12\x81\x01\n\x10\x64ocument_entries\x18\x01 \x03(\x0b\x32g.org.dash.platform.dapi.v0.GetDocumentHistoryResponse.GetDocumentHistoryResponseV0.DocumentHistoryEntryB\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\"\xbd\x02\n*GetIdentityByNonUniquePublicKeyHashRequest\x12\x80\x01\n\x02v0\x18\x01 \x01(\x0b\x32r.org.dash.platform.dapi.v0.GetIdentityByNonUniquePublicKeyHashRequest.GetIdentityByNonUniquePublicKeyHashRequestV0H\x00\x1a\x80\x01\n,GetIdentityByNonUniquePublicKeyHashRequestV0\x12\x17\n\x0fpublic_key_hash\x18\x01 \x01(\x0c\x12\x18\n\x0bstart_after\x18\x02 \x01(\x0cH\x00\x88\x01\x01\x12\r\n\x05prove\x18\x03 \x01(\x08\x42\x0e\n\x0c_start_afterB\t\n\x07version\"\xc6\x04\n+GetIdentityByNonUniquePublicKeyHashResponse\x12\x82\x01\n\x02v0\x18\x01 \x01(\x0b\x32t.org.dash.platform.dapi.v0.GetIdentityByNonUniquePublicKeyHashResponse.GetIdentityByNonUniquePublicKeyHashResponseV0H\x00\x1a\x86\x03\n-GetIdentityByNonUniquePublicKeyHashResponseV0\x12\x9a\x01\n\x08identity\x18\x01 \x01(\x0b\x32\x85\x01.org.dash.platform.dapi.v0.GetIdentityByNonUniquePublicKeyHashResponse.GetIdentityByNonUniquePublicKeyHashResponseV0.IdentityResponseH\x00\x12\x31\n\x05proof\x18\x04 \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\x36\n\x10IdentityResponse\x12\x15\n\x08identity\x18\x01 \x01(\x0cH\x00\x88\x01\x01\x42\x0b\n\t_identityB\x08\n\x06resultJ\x04\x08\x02\x10\x03\x42\t\n\x07version\"\x99\x02\n#WaitForStateTransitionResultRequest\x12r\n\x02v0\x18\x01 \x01(\x0b\x32\x64.org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0H\x00\x1as\n%WaitForStateTransitionResultRequestV0\x12\x1d\n\x15state_transition_hash\x18\x01 \x01(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\x12\x1c\n\x14request_user_balance\x18\x03 \x01(\x08\x42\t\n\x07version\"\xce\x04\n$WaitForStateTransitionResultResponse\x12t\n\x02v0\x18\x01 \x01(\x0b\x32\x66.org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0H\x00\x1a\x34\n\x17SuccessWithOwnerBalance\x12\x19\n\rowner_balance\x18\x01 \x01(\x04\x42\x02\x30\x01\x1a\xee\x02\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\x1asuccess_with_owner_balance\x18\x04 \x01(\x0b\x32W.org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.SuccessWithOwnerBalanceH\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\"\xbf\x02\n\x1dGetFinalizedEpochInfosRequest\x12\x66\n\x02v0\x18\x01 \x01(\x0b\x32X.org.dash.platform.dapi.v0.GetFinalizedEpochInfosRequest.GetFinalizedEpochInfosRequestV0H\x00\x1a\xaa\x01\n\x1fGetFinalizedEpochInfosRequestV0\x12\x19\n\x11start_epoch_index\x18\x01 \x01(\r\x12\"\n\x1astart_epoch_index_included\x18\x02 \x01(\x08\x12\x17\n\x0f\x65nd_epoch_index\x18\x03 \x01(\r\x12 \n\x18\x65nd_epoch_index_included\x18\x04 \x01(\x08\x12\r\n\x05prove\x18\x05 \x01(\x08\x42\t\n\x07version\"\xbd\t\n\x1eGetFinalizedEpochInfosResponse\x12h\n\x02v0\x18\x01 \x01(\x0b\x32Z.org.dash.platform.dapi.v0.GetFinalizedEpochInfosResponse.GetFinalizedEpochInfosResponseV0H\x00\x1a\xa5\x08\n GetFinalizedEpochInfosResponseV0\x12\x80\x01\n\x06\x65pochs\x18\x01 \x01(\x0b\x32n.org.dash.platform.dapi.v0.GetFinalizedEpochInfosResponse.GetFinalizedEpochInfosResponseV0.FinalizedEpochInfosH\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\xa4\x01\n\x13\x46inalizedEpochInfos\x12\x8c\x01\n\x15\x66inalized_epoch_infos\x18\x01 \x03(\x0b\x32m.org.dash.platform.dapi.v0.GetFinalizedEpochInfosResponse.GetFinalizedEpochInfosResponseV0.FinalizedEpochInfo\x1a\x9f\x04\n\x12\x46inalizedEpochInfo\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\x1c\n\x10\x66irst_block_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(\r\x12!\n\x15total_blocks_in_epoch\x18\x07 \x01(\x04\x42\x02\x30\x01\x12*\n\"next_epoch_start_core_block_height\x18\x08 \x01(\r\x12!\n\x15total_processing_fees\x18\t \x01(\x04\x42\x02\x30\x01\x12*\n\x1etotal_distributed_storage_fees\x18\n \x01(\x04\x42\x02\x30\x01\x12&\n\x1atotal_created_storage_fees\x18\x0b \x01(\x04\x42\x02\x30\x01\x12\x1e\n\x12\x63ore_block_rewards\x18\x0c \x01(\x04\x42\x02\x30\x01\x12\x81\x01\n\x0f\x62lock_proposers\x18\r \x03(\x0b\x32h.org.dash.platform.dapi.v0.GetFinalizedEpochInfosResponse.GetFinalizedEpochInfosResponseV0.BlockProposer\x1a\x39\n\rBlockProposer\x12\x13\n\x0bproposer_id\x18\x01 \x01(\x0c\x12\x13\n\x0b\x62lock_count\x18\x02 \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\"\xe4\x10\n\x11GetStatusResponse\x12N\n\x02v0\x18\x01 \x01(\x0b\x32@.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0H\x00\x1a\xf3\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\x82\x05\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\xcc\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\x12\x12\n\nnext_epoch\x18\x05 \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\x01\n#GetTokenDirectPurchasePricesRequest\x12r\n\x02v0\x18\x01 \x01(\x0b\x32\x64.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0H\x00\x1aI\n%GetTokenDirectPurchasePricesRequestV0\x12\x11\n\ttoken_ids\x18\x01 \x03(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\x8b\t\n$GetTokenDirectPurchasePricesResponse\x12t\n\x02v0\x18\x01 \x01(\x0b\x32\x66.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0H\x00\x1a\xe1\x07\n&GetTokenDirectPurchasePricesResponseV0\x12\xa9\x01\n\x1ctoken_direct_purchase_prices\x18\x01 \x01(\x0b\x32\x80\x01.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePricesH\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\x33\n\x10PriceForQuantity\x12\x10\n\x08quantity\x18\x01 \x01(\x04\x12\r\n\x05price\x18\x02 \x01(\x04\x1a\xa7\x01\n\x0fPricingSchedule\x12\x93\x01\n\x12price_for_quantity\x18\x01 \x03(\x0b\x32w.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity\x1a\xe4\x01\n\x1dTokenDirectPurchasePriceEntry\x12\x10\n\x08token_id\x18\x01 \x01(\x0c\x12\x15\n\x0b\x66ixed_price\x18\x02 \x01(\x04H\x00\x12\x90\x01\n\x0evariable_price\x18\x03 \x01(\x0b\x32v.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingScheduleH\x00\x42\x07\n\x05price\x1a\xc8\x01\n\x19TokenDirectPurchasePrices\x12\xaa\x01\n\x1btoken_direct_purchase_price\x18\x01 \x03(\x0b\x32\x84\x01.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntryB\x08\n\x06resultB\t\n\x07version\"\xce\x01\n\x1bGetTokenContractInfoRequest\x12\x62\n\x02v0\x18\x01 \x01(\x0b\x32T.org.dash.platform.dapi.v0.GetTokenContractInfoRequest.GetTokenContractInfoRequestV0H\x00\x1a@\n\x1dGetTokenContractInfoRequestV0\x12\x10\n\x08token_id\x18\x01 \x01(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\xfb\x03\n\x1cGetTokenContractInfoResponse\x12\x64\n\x02v0\x18\x01 \x01(\x0b\x32V.org.dash.platform.dapi.v0.GetTokenContractInfoResponse.GetTokenContractInfoResponseV0H\x00\x1a\xe9\x02\n\x1eGetTokenContractInfoResponseV0\x12|\n\x04\x64\x61ta\x18\x01 \x01(\x0b\x32l.org.dash.platform.dapi.v0.GetTokenContractInfoResponse.GetTokenContractInfoResponseV0.TokenContractInfoDataH\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\x1aM\n\x15TokenContractInfoData\x12\x13\n\x0b\x63ontract_id\x18\x01 \x01(\x0c\x12\x1f\n\x17token_contract_position\x18\x02 \x01(\rB\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\"\x82\x04\n-GetTokenPerpetualDistributionLastClaimRequest\x12\x86\x01\n\x02v0\x18\x01 \x01(\x0b\x32x.org.dash.platform.dapi.v0.GetTokenPerpetualDistributionLastClaimRequest.GetTokenPerpetualDistributionLastClaimRequestV0H\x00\x1aI\n\x11\x43ontractTokenInfo\x12\x13\n\x0b\x63ontract_id\x18\x01 \x01(\x0c\x12\x1f\n\x17token_contract_position\x18\x02 \x01(\r\x1a\xf1\x01\n/GetTokenPerpetualDistributionLastClaimRequestV0\x12\x10\n\x08token_id\x18\x01 \x01(\x0c\x12v\n\rcontract_info\x18\x02 \x01(\x0b\x32Z.org.dash.platform.dapi.v0.GetTokenPerpetualDistributionLastClaimRequest.ContractTokenInfoH\x00\x88\x01\x01\x12\x13\n\x0bidentity_id\x18\x04 \x01(\x0c\x12\r\n\x05prove\x18\x05 \x01(\x08\x42\x10\n\x0e_contract_infoB\t\n\x07version\"\x93\x05\n.GetTokenPerpetualDistributionLastClaimResponse\x12\x88\x01\n\x02v0\x18\x01 \x01(\x0b\x32z.org.dash.platform.dapi.v0.GetTokenPerpetualDistributionLastClaimResponse.GetTokenPerpetualDistributionLastClaimResponseV0H\x00\x1a\xca\x03\n0GetTokenPerpetualDistributionLastClaimResponseV0\x12\x9f\x01\n\nlast_claim\x18\x01 \x01(\x0b\x32\x88\x01.org.dash.platform.dapi.v0.GetTokenPerpetualDistributionLastClaimResponse.GetTokenPerpetualDistributionLastClaimResponseV0.LastClaimInfoH\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\rLastClaimInfo\x12\x1a\n\x0ctimestamp_ms\x18\x01 \x01(\x04\x42\x02\x30\x01H\x00\x12\x1a\n\x0c\x62lock_height\x18\x02 \x01(\x04\x42\x02\x30\x01H\x00\x12\x0f\n\x05\x65poch\x18\x03 \x01(\rH\x00\x12\x13\n\traw_bytes\x18\x04 \x01(\x0cH\x00\x42\t\n\x07paid_atB\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\"\x92\"\n\x17GetGroupActionsResponse\x12Z\n\x02v0\x18\x01 \x01(\x0b\x32L.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0H\x00\x1a\x8f!\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[\n\tBurnEvent\x12\x0e\n\x06\x61mount\x18\x01 \x01(\x04\x12\x14\n\x0c\x62urn_from_id\x18\x02 \x01(\x0c\x12\x18\n\x0bpublic_note\x18\x03 \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\xe6\x03\n\x1eUpdateDirectPurchasePriceEvent\x12\x15\n\x0b\x66ixed_price\x18\x01 \x01(\x04H\x00\x12\x95\x01\n\x0evariable_price\x18\x02 \x01(\x0b\x32{.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingScheduleH\x00\x12\x18\n\x0bpublic_note\x18\x03 \x01(\tH\x01\x88\x01\x01\x1a\x33\n\x10PriceForQuantity\x12\x10\n\x08quantity\x18\x01 \x01(\x04\x12\r\n\x05price\x18\x02 \x01(\x04\x1a\xac\x01\n\x0fPricingSchedule\x12\x98\x01\n\x12price_for_quantity\x18\x01 \x03(\x0b\x32|.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantityB\x07\n\x05priceB\x0e\n\x0c_public_note\x1a\x63\n\x0fMintToPoolEvent\x12\x0e\n\x06\x61mount\x18\x01 \x01(\x04\x12\x16\n\x0e\x61\x63tions_digest\x18\x02 \x01(\x0c\x12\x18\n\x0bpublic_note\x18\x03 \x01(\tH\x00\x88\x01\x01\x42\x0e\n\x0c_public_note\x1a\x65\n\x11\x42urnFromPoolEvent\x12\x0e\n\x06\x61mount\x18\x01 \x01(\x04\x12\x16\n\x0e\x61\x63tions_digest\x18\x02 \x01(\x0c\x12\x18\n\x0bpublic_note\x18\x03 \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\xc1\t\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\x12\x83\x01\n\x0cupdate_price\x18\x08 \x01(\x0b\x32k.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEventH\x00\x12t\n\x0cmint_to_pool\x18\t \x01(\x0b\x32\\.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintToPoolEventH\x00\x12x\n\x0e\x62urn_from_pool\x18\n \x01(\x0b\x32^.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnFromPoolEventH\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\"\xb5\x01\n\x15GetAddressInfoRequest\x12V\n\x02v0\x18\x01 \x01(\x0b\x32H.org.dash.platform.dapi.v0.GetAddressInfoRequest.GetAddressInfoRequestV0H\x00\x1a\x39\n\x17GetAddressInfoRequestV0\x12\x0f\n\x07\x61\x64\x64ress\x18\x01 \x01(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\x85\x01\n\x10\x41\x64\x64ressInfoEntry\x12\x0f\n\x07\x61\x64\x64ress\x18\x01 \x01(\x0c\x12J\n\x11\x62\x61lance_and_nonce\x18\x02 \x01(\x0b\x32*.org.dash.platform.dapi.v0.BalanceAndNonceH\x00\x88\x01\x01\x42\x14\n\x12_balance_and_nonce\"1\n\x0f\x42\x61lanceAndNonce\x12\x0f\n\x07\x62\x61lance\x18\x01 \x01(\x04\x12\r\n\x05nonce\x18\x02 \x01(\r\"_\n\x12\x41\x64\x64ressInfoEntries\x12I\n\x14\x61\x64\x64ress_info_entries\x18\x01 \x03(\x0b\x32+.org.dash.platform.dapi.v0.AddressInfoEntry\"m\n\x14\x41\x64\x64ressBalanceChange\x12\x0f\n\x07\x61\x64\x64ress\x18\x01 \x01(\x0c\x12\x19\n\x0bset_balance\x18\x02 \x01(\x04\x42\x02\x30\x01H\x00\x12\x1c\n\x0e\x61\x64\x64_to_balance\x18\x03 \x01(\x04\x42\x02\x30\x01H\x00\x42\x0b\n\toperation\"x\n\x1a\x42lockAddressBalanceChanges\x12\x18\n\x0c\x62lock_height\x18\x01 \x01(\x04\x42\x02\x30\x01\x12@\n\x07\x63hanges\x18\x02 \x03(\x0b\x32/.org.dash.platform.dapi.v0.AddressBalanceChange\"k\n\x1b\x41\x64\x64ressBalanceUpdateEntries\x12L\n\rblock_changes\x18\x01 \x03(\x0b\x32\x35.org.dash.platform.dapi.v0.BlockAddressBalanceChanges\"\xe1\x02\n\x16GetAddressInfoResponse\x12X\n\x02v0\x18\x01 \x01(\x0b\x32J.org.dash.platform.dapi.v0.GetAddressInfoResponse.GetAddressInfoResponseV0H\x00\x1a\xe1\x01\n\x18GetAddressInfoResponseV0\x12I\n\x12\x61\x64\x64ress_info_entry\x18\x01 \x01(\x0b\x32+.org.dash.platform.dapi.v0.AddressInfoEntryH\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\"\xc3\x01\n\x18GetAddressesInfosRequest\x12\\\n\x02v0\x18\x01 \x01(\x0b\x32N.org.dash.platform.dapi.v0.GetAddressesInfosRequest.GetAddressesInfosRequestV0H\x00\x1a>\n\x1aGetAddressesInfosRequestV0\x12\x11\n\taddresses\x18\x01 \x03(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\xf1\x02\n\x19GetAddressesInfosResponse\x12^\n\x02v0\x18\x01 \x01(\x0b\x32P.org.dash.platform.dapi.v0.GetAddressesInfosResponse.GetAddressesInfosResponseV0H\x00\x1a\xe8\x01\n\x1bGetAddressesInfosResponseV0\x12M\n\x14\x61\x64\x64ress_info_entries\x18\x01 \x01(\x0b\x32-.org.dash.platform.dapi.v0.AddressInfoEntriesH\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\"\xb5\x01\n\x1dGetAddressesTrunkStateRequest\x12\x66\n\x02v0\x18\x01 \x01(\x0b\x32X.org.dash.platform.dapi.v0.GetAddressesTrunkStateRequest.GetAddressesTrunkStateRequestV0H\x00\x1a!\n\x1fGetAddressesTrunkStateRequestV0B\t\n\x07version\"\xaa\x02\n\x1eGetAddressesTrunkStateResponse\x12h\n\x02v0\x18\x01 \x01(\x0b\x32Z.org.dash.platform.dapi.v0.GetAddressesTrunkStateResponse.GetAddressesTrunkStateResponseV0H\x00\x1a\x92\x01\n GetAddressesTrunkStateResponseV0\x12/\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.Proof\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadataB\t\n\x07version\"\xf0\x01\n\x1eGetAddressesBranchStateRequest\x12h\n\x02v0\x18\x01 \x01(\x0b\x32Z.org.dash.platform.dapi.v0.GetAddressesBranchStateRequest.GetAddressesBranchStateRequestV0H\x00\x1aY\n GetAddressesBranchStateRequestV0\x12\x0b\n\x03key\x18\x01 \x01(\x0c\x12\r\n\x05\x64\x65pth\x18\x02 \x01(\r\x12\x19\n\x11\x63heckpoint_height\x18\x03 \x01(\x04\x42\t\n\x07version\"\xd1\x01\n\x1fGetAddressesBranchStateResponse\x12j\n\x02v0\x18\x01 \x01(\x0b\x32\\.org.dash.platform.dapi.v0.GetAddressesBranchStateResponse.GetAddressesBranchStateResponseV0H\x00\x1a\x37\n!GetAddressesBranchStateResponseV0\x12\x12\n\nmerk_proof\x18\x02 \x01(\x0c\x42\t\n\x07version\"\x9e\x02\n%GetRecentAddressBalanceChangesRequest\x12v\n\x02v0\x18\x01 \x01(\x0b\x32h.org.dash.platform.dapi.v0.GetRecentAddressBalanceChangesRequest.GetRecentAddressBalanceChangesRequestV0H\x00\x1ar\n\'GetRecentAddressBalanceChangesRequestV0\x12\x18\n\x0cstart_height\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\r\n\x05prove\x18\x02 \x01(\x08\x12\x1e\n\x16start_height_exclusive\x18\x03 \x01(\x08\x42\t\n\x07version\"\xb8\x03\n&GetRecentAddressBalanceChangesResponse\x12x\n\x02v0\x18\x01 \x01(\x0b\x32j.org.dash.platform.dapi.v0.GetRecentAddressBalanceChangesResponse.GetRecentAddressBalanceChangesResponseV0H\x00\x1a\x88\x02\n(GetRecentAddressBalanceChangesResponseV0\x12`\n\x1e\x61\x64\x64ress_balance_update_entries\x18\x01 \x01(\x0b\x32\x36.org.dash.platform.dapi.v0.AddressBalanceUpdateEntriesH\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\"G\n\x16\x42lockHeightCreditEntry\x12\x18\n\x0c\x62lock_height\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\x13\n\x07\x63redits\x18\x02 \x01(\x04\x42\x02\x30\x01\"\xb0\x01\n\x1d\x43ompactedAddressBalanceChange\x12\x0f\n\x07\x61\x64\x64ress\x18\x01 \x01(\x0c\x12\x19\n\x0bset_credits\x18\x02 \x01(\x04\x42\x02\x30\x01H\x00\x12V\n\x19\x61\x64\x64_to_credits_operations\x18\x03 \x01(\x0b\x32\x31.org.dash.platform.dapi.v0.AddToCreditsOperationsH\x00\x42\x0b\n\toperation\"\\\n\x16\x41\x64\x64ToCreditsOperations\x12\x42\n\x07\x65ntries\x18\x01 \x03(\x0b\x32\x31.org.dash.platform.dapi.v0.BlockHeightCreditEntry\"\xae\x01\n#CompactedBlockAddressBalanceChanges\x12\x1e\n\x12start_block_height\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\x1c\n\x10\x65nd_block_height\x18\x02 \x01(\x04\x42\x02\x30\x01\x12I\n\x07\x63hanges\x18\x03 \x03(\x0b\x32\x38.org.dash.platform.dapi.v0.CompactedAddressBalanceChange\"\x87\x01\n$CompactedAddressBalanceUpdateEntries\x12_\n\x17\x63ompacted_block_changes\x18\x01 \x03(\x0b\x32>.org.dash.platform.dapi.v0.CompactedBlockAddressBalanceChanges\"\xa9\x02\n.GetRecentCompactedAddressBalanceChangesRequest\x12\x88\x01\n\x02v0\x18\x01 \x01(\x0b\x32z.org.dash.platform.dapi.v0.GetRecentCompactedAddressBalanceChangesRequest.GetRecentCompactedAddressBalanceChangesRequestV0H\x00\x1a\x61\n0GetRecentCompactedAddressBalanceChangesRequestV0\x12\x1e\n\x12start_block_height\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\xf0\x03\n/GetRecentCompactedAddressBalanceChangesResponse\x12\x8a\x01\n\x02v0\x18\x01 \x01(\x0b\x32|.org.dash.platform.dapi.v0.GetRecentCompactedAddressBalanceChangesResponse.GetRecentCompactedAddressBalanceChangesResponseV0H\x00\x1a\xa4\x02\n1GetRecentCompactedAddressBalanceChangesResponseV0\x12s\n(compacted_address_balance_update_entries\x18\x01 \x01(\x0b\x32?.org.dash.platform.dapi.v0.CompactedAddressBalanceUpdateEntriesH\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\"\x98\x02\n GetShieldedEncryptedNotesRequest\x12l\n\x02v0\x18\x01 \x01(\x0b\x32^.org.dash.platform.dapi.v0.GetShieldedEncryptedNotesRequest.GetShieldedEncryptedNotesRequestV0H\x00\x1a{\n\"GetShieldedEncryptedNotesRequestV0\x12\x13\n\x0bstart_index\x18\x01 \x01(\x04\x12\r\n\x05\x63ount\x18\x02 \x01(\r\x12\r\n\x05prove\x18\x03 \x01(\x08\x12\x15\n\x08token_id\x18\x04 \x01(\x0cH\x00\x88\x01\x01\x42\x0b\n\t_token_idB\t\n\x07version\"\xbc\x05\n!GetShieldedEncryptedNotesResponse\x12n\n\x02v0\x18\x01 \x01(\x0b\x32`.org.dash.platform.dapi.v0.GetShieldedEncryptedNotesResponse.GetShieldedEncryptedNotesResponseV0H\x00\x1a\x9b\x04\n#GetShieldedEncryptedNotesResponseV0\x12\x8a\x01\n\x0f\x65ncrypted_notes\x18\x01 \x01(\x0b\x32o.org.dash.platform.dapi.v0.GetShieldedEncryptedNotesResponse.GetShieldedEncryptedNotesResponseV0.EncryptedNotesH\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\x1aW\n\rEncryptedNote\x12\x11\n\tnullifier\x18\x01 \x01(\x0c\x12\x0b\n\x03\x63mx\x18\x02 \x01(\x0c\x12\x16\n\x0e\x65ncrypted_note\x18\x03 \x01(\x0c\x12\x0e\n\x06\x63v_net\x18\x04 \x01(\x0c\x1a\x91\x01\n\x0e\x45ncryptedNotes\x12\x7f\n\x07\x65ntries\x18\x01 \x03(\x0b\x32n.org.dash.platform.dapi.v0.GetShieldedEncryptedNotesResponse.GetShieldedEncryptedNotesResponseV0.EncryptedNoteB\x08\n\x06resultB\t\n\x07version\"\xd8\x01\n\x19GetShieldedAnchorsRequest\x12^\n\x02v0\x18\x01 \x01(\x0b\x32P.org.dash.platform.dapi.v0.GetShieldedAnchorsRequest.GetShieldedAnchorsRequestV0H\x00\x1aP\n\x1bGetShieldedAnchorsRequestV0\x12\r\n\x05prove\x18\x01 \x01(\x08\x12\x15\n\x08token_id\x18\x02 \x01(\x0cH\x00\x88\x01\x01\x42\x0b\n\t_token_idB\t\n\x07version\"\xb1\x03\n\x1aGetShieldedAnchorsResponse\x12`\n\x02v0\x18\x01 \x01(\x0b\x32R.org.dash.platform.dapi.v0.GetShieldedAnchorsResponse.GetShieldedAnchorsResponseV0H\x00\x1a\xa5\x02\n\x1cGetShieldedAnchorsResponseV0\x12m\n\x07\x61nchors\x18\x01 \x01(\x0b\x32Z.org.dash.platform.dapi.v0.GetShieldedAnchorsResponse.GetShieldedAnchorsResponseV0.AnchorsH\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\x07\x41nchors\x12\x0f\n\x07\x61nchors\x18\x01 \x03(\x0c\x42\x08\n\x06resultB\t\n\x07version\"\xfc\x01\n\"GetMostRecentShieldedAnchorRequest\x12p\n\x02v0\x18\x01 \x01(\x0b\x32\x62.org.dash.platform.dapi.v0.GetMostRecentShieldedAnchorRequest.GetMostRecentShieldedAnchorRequestV0H\x00\x1aY\n$GetMostRecentShieldedAnchorRequestV0\x12\r\n\x05prove\x18\x01 \x01(\x08\x12\x15\n\x08token_id\x18\x02 \x01(\x0cH\x00\x88\x01\x01\x42\x0b\n\t_token_idB\t\n\x07version\"\xdc\x02\n#GetMostRecentShieldedAnchorResponse\x12r\n\x02v0\x18\x01 \x01(\x0b\x32\x64.org.dash.platform.dapi.v0.GetMostRecentShieldedAnchorResponse.GetMostRecentShieldedAnchorResponseV0H\x00\x1a\xb5\x01\n%GetMostRecentShieldedAnchorResponseV0\x12\x10\n\x06\x61nchor\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\"\xe0\x01\n\x1bGetShieldedPoolStateRequest\x12\x62\n\x02v0\x18\x01 \x01(\x0b\x32T.org.dash.platform.dapi.v0.GetShieldedPoolStateRequest.GetShieldedPoolStateRequestV0H\x00\x1aR\n\x1dGetShieldedPoolStateRequestV0\x12\r\n\x05prove\x18\x01 \x01(\x08\x12\x15\n\x08token_id\x18\x02 \x01(\x0cH\x00\x88\x01\x01\x42\x0b\n\t_token_idB\t\n\x07version\"\xcb\x02\n\x1cGetShieldedPoolStateResponse\x12\x64\n\x02v0\x18\x01 \x01(\x0b\x32V.org.dash.platform.dapi.v0.GetShieldedPoolStateResponse.GetShieldedPoolStateResponseV0H\x00\x1a\xb9\x01\n\x1eGetShieldedPoolStateResponseV0\x12\x1b\n\rtotal_balance\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\"\xe4\x01\n\x1cGetShieldedNotesCountRequest\x12\x64\n\x02v0\x18\x01 \x01(\x0b\x32V.org.dash.platform.dapi.v0.GetShieldedNotesCountRequest.GetShieldedNotesCountRequestV0H\x00\x1aS\n\x1eGetShieldedNotesCountRequestV0\x12\r\n\x05prove\x18\x01 \x01(\x08\x12\x15\n\x08token_id\x18\x02 \x01(\x0cH\x00\x88\x01\x01\x42\x0b\n\t_token_idB\t\n\x07version\"\xd3\x02\n\x1dGetShieldedNotesCountResponse\x12\x66\n\x02v0\x18\x01 \x01(\x0b\x32X.org.dash.platform.dapi.v0.GetShieldedNotesCountResponse.GetShieldedNotesCountResponseV0H\x00\x1a\xbe\x01\n\x1fGetShieldedNotesCountResponseV0\x12\x1f\n\x11total_notes_count\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\"\xf8\x01\n\x1cGetShieldedNullifiersRequest\x12\x64\n\x02v0\x18\x01 \x01(\x0b\x32V.org.dash.platform.dapi.v0.GetShieldedNullifiersRequest.GetShieldedNullifiersRequestV0H\x00\x1ag\n\x1eGetShieldedNullifiersRequestV0\x12\x12\n\nnullifiers\x18\x01 \x03(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\x12\x15\n\x08token_id\x18\x03 \x01(\x0cH\x00\x88\x01\x01\x42\x0b\n\t_token_idB\t\n\x07version\"\x86\x05\n\x1dGetShieldedNullifiersResponse\x12\x66\n\x02v0\x18\x01 \x01(\x0b\x32X.org.dash.platform.dapi.v0.GetShieldedNullifiersResponse.GetShieldedNullifiersResponseV0H\x00\x1a\xf1\x03\n\x1fGetShieldedNullifiersResponseV0\x12\x88\x01\n\x12nullifier_statuses\x18\x01 \x01(\x0b\x32j.org.dash.platform.dapi.v0.GetShieldedNullifiersResponse.GetShieldedNullifiersResponseV0.NullifierStatusesH\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\x36\n\x0fNullifierStatus\x12\x11\n\tnullifier\x18\x01 \x01(\x0c\x12\x10\n\x08is_spent\x18\x02 \x01(\x08\x1a\x8e\x01\n\x11NullifierStatuses\x12y\n\x07\x65ntries\x18\x01 \x03(\x0b\x32h.org.dash.platform.dapi.v0.GetShieldedNullifiersResponse.GetShieldedNullifiersResponseV0.NullifierStatusB\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*\xb9\x01\n\x16\x43ontractModerationList\x12(\n$CONTRACT_MODERATION_LIST_UNSPECIFIED\x10\x00\x12$\n CONTRACT_MODERATION_LIST_BANLIST\x10\x01\x12(\n$CONTRACT_MODERATION_LIST_SUSPENSIONS\x10\x02\x12%\n!CONTRACT_MODERATION_LIST_WARNINGS\x10\x03\x32\xb3T\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\xa8\x01\n\x1fgetIdentityKeysRemainingBudgets\x12\x41.org.dash.platform.dapi.v0.GetIdentityKeysRemainingBudgetsRequest\x1a\x42.org.dash.platform.dapi.v0.GetIdentityKeysRemainingBudgetsResponse\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\xa5\x01\n\x1egetDataContractsLatestVersions\x12@.org.dash.platform.dapi.v0.GetDataContractsLatestVersionsRequest\x1a\x41.org.dash.platform.dapi.v0.GetDataContractsLatestVersionsResponse\x12{\n\x10getDataContracts\x12\x32.org.dash.platform.dapi.v0.GetDataContractsRequest\x1a\x33.org.dash.platform.dapi.v0.GetDataContractsResponse\x12\x89\x01\n\x17getDataContractsByRange\x12\x39.org.dash.platform.dapi.v0.GetDataContractsByRangeRequest\x1a\x33.org.dash.platform.dapi.v0.GetDataContractsResponse\x12\x87\x01\n\x14getContractGroupInfo\x12\x36.org.dash.platform.dapi.v0.GetContractGroupInfoRequest\x1a\x37.org.dash.platform.dapi.v0.GetContractGroupInfoResponse\x12\x90\x01\n\x17getContractGroupMembers\x12\x39.org.dash.platform.dapi.v0.GetContractGroupMembersRequest\x1a:.org.dash.platform.dapi.v0.GetContractGroupMembersResponse\x12\x9f\x01\n\x1cgetContractGroupsForContract\x12>.org.dash.platform.dapi.v0.GetContractGroupsForContractRequest\x1a?.org.dash.platform.dapi.v0.GetContractGroupsForContractResponse\x12\x9c\x01\n\x1bgetContractModerationStatus\x12=.org.dash.platform.dapi.v0.GetContractModerationStatusRequest\x1a>.org.dash.platform.dapi.v0.GetContractModerationStatusResponse\x12\x9f\x01\n\x1cgetContractModerationEntries\x12>.org.dash.platform.dapi.v0.GetContractModerationEntriesRequest\x1a?.org.dash.platform.dapi.v0.GetContractModerationEntriesResponse\x12\x9c\x01\n\x1bgetContractDocumentRemovals\x12=.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest\x1a>.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse\x12\x8d\x01\n\x16getContractTeamActions\x12\x38.org.dash.platform.dapi.v0.GetContractTeamActionsRequest\x1a\x39.org.dash.platform.dapi.v0.GetContractTeamActionsResponse\x12\x9f\x01\n\x1cgetContractTeamActionSigners\x12>.org.dash.platform.dapi.v0.GetContractTeamActionSignersRequest\x1a?.org.dash.platform.dapi.v0.GetContractTeamActionSignersResponse\x12\xae\x01\n!getContractModerationActionCounts\x12\x43.org.dash.platform.dapi.v0.GetContractModerationActionCountsRequest\x1a\x44.org.dash.platform.dapi.v0.GetContractModerationActionCountsResponse\x12\x81\x01\n\x12getContractFeePots\x12\x34.org.dash.platform.dapi.v0.GetContractFeePotsRequest\x1a\x35.org.dash.platform.dapi.v0.GetContractFeePotsResponse\x12\x81\x01\n\x12getDocumentHistory\x12\x34.org.dash.platform.dapi.v0.GetDocumentHistoryRequest\x1a\x35.org.dash.platform.dapi.v0.GetDocumentHistoryResponse\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\xb4\x01\n#getIdentityByNonUniquePublicKeyHash\x12\x45.org.dash.platform.dapi.v0.GetIdentityByNonUniquePublicKeyHashRequest\x1a\x46.org.dash.platform.dapi.v0.GetIdentityByNonUniquePublicKeyHashResponse\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\x8d\x01\n\x16getFinalizedEpochInfos\x12\x38.org.dash.platform.dapi.v0.GetFinalizedEpochInfosRequest\x1a\x39.org.dash.platform.dapi.v0.GetFinalizedEpochInfosResponse\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\x9f\x01\n\x1cgetTokenDirectPurchasePrices\x12>.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest\x1a?.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse\x12\x87\x01\n\x14getTokenContractInfo\x12\x36.org.dash.platform.dapi.v0.GetTokenContractInfoRequest\x1a\x37.org.dash.platform.dapi.v0.GetTokenContractInfoResponse\x12\xb1\x01\n\"getTokenPreProgrammedDistributions\x12\x44.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest\x1a\x45.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse\x12\xbd\x01\n&getTokenPerpetualDistributionLastClaim\x12H.org.dash.platform.dapi.v0.GetTokenPerpetualDistributionLastClaimRequest\x1aI.org.dash.platform.dapi.v0.GetTokenPerpetualDistributionLastClaimResponse\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.GetGroupActionSignersResponse\x12u\n\x0egetAddressInfo\x12\x30.org.dash.platform.dapi.v0.GetAddressInfoRequest\x1a\x31.org.dash.platform.dapi.v0.GetAddressInfoResponse\x12~\n\x11getAddressesInfos\x12\x33.org.dash.platform.dapi.v0.GetAddressesInfosRequest\x1a\x34.org.dash.platform.dapi.v0.GetAddressesInfosResponse\x12\x8d\x01\n\x16getAddressesTrunkState\x12\x38.org.dash.platform.dapi.v0.GetAddressesTrunkStateRequest\x1a\x39.org.dash.platform.dapi.v0.GetAddressesTrunkStateResponse\x12\x90\x01\n\x17getAddressesBranchState\x12\x39.org.dash.platform.dapi.v0.GetAddressesBranchStateRequest\x1a:.org.dash.platform.dapi.v0.GetAddressesBranchStateResponse\x12\xa5\x01\n\x1egetRecentAddressBalanceChanges\x12@.org.dash.platform.dapi.v0.GetRecentAddressBalanceChangesRequest\x1a\x41.org.dash.platform.dapi.v0.GetRecentAddressBalanceChangesResponse\x12\xc0\x01\n\'getRecentCompactedAddressBalanceChanges\x12I.org.dash.platform.dapi.v0.GetRecentCompactedAddressBalanceChangesRequest\x1aJ.org.dash.platform.dapi.v0.GetRecentCompactedAddressBalanceChangesResponse\x12\x96\x01\n\x19getShieldedEncryptedNotes\x12;.org.dash.platform.dapi.v0.GetShieldedEncryptedNotesRequest\x1a<.org.dash.platform.dapi.v0.GetShieldedEncryptedNotesResponse\x12\x81\x01\n\x12getShieldedAnchors\x12\x34.org.dash.platform.dapi.v0.GetShieldedAnchorsRequest\x1a\x35.org.dash.platform.dapi.v0.GetShieldedAnchorsResponse\x12\x9c\x01\n\x1bgetMostRecentShieldedAnchor\x12=.org.dash.platform.dapi.v0.GetMostRecentShieldedAnchorRequest\x1a>.org.dash.platform.dapi.v0.GetMostRecentShieldedAnchorResponse\x12\x87\x01\n\x14getShieldedPoolState\x12\x36.org.dash.platform.dapi.v0.GetShieldedPoolStateRequest\x1a\x37.org.dash.platform.dapi.v0.GetShieldedPoolStateResponse\x12\x8a\x01\n\x15getShieldedNotesCount\x12\x37.org.dash.platform.dapi.v0.GetShieldedNotesCountRequest\x1a\x38.org.dash.platform.dapi.v0.GetShieldedNotesCountResponse\x12\x8a\x01\n\x15getShieldedNullifiers\x12\x37.org.dash.platform.dapi.v0.GetShieldedNullifiersRequest\x1a\x38.org.dash.platform.dapi.v0.GetShieldedNullifiersResponseb\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\"\x8e\x02\n&GetIdentityKeysRemainingBudgetsRequest\x12x\n\x02v0\x18\x01 \x01(\x0b\x32j.org.dash.platform.dapi.v0.GetIdentityKeysRemainingBudgetsRequest.GetIdentityKeysRemainingBudgetsRequestV0H\x00\x1a_\n(GetIdentityKeysRemainingBudgetsRequestV0\x12\x13\n\x0bidentity_id\x18\x01 \x01(\x0c\x12\x0f\n\x07key_ids\x18\x02 \x03(\r\x12\r\n\x05prove\x18\x03 \x01(\x08\x42\t\n\x07version\"\x96\x06\n\'GetIdentityKeysRemainingBudgetsResponse\x12z\n\x02v0\x18\x01 \x01(\x0b\x32l.org.dash.platform.dapi.v0.GetIdentityKeysRemainingBudgetsResponse.GetIdentityKeysRemainingBudgetsResponseV0H\x00\x1a\xe3\x04\n)GetIdentityKeysRemainingBudgetsResponseV0\x12\xa4\x01\n\x16keys_remaining_budgets\x18\x01 \x01(\x0b\x32\x81\x01.org.dash.platform.dapi.v0.GetIdentityKeysRemainingBudgetsResponse.GetIdentityKeysRemainingBudgetsResponseV0.KeysRemainingBudgetsH\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\x61\n\x17KeyRemainingBudgetEntry\x12\x0e\n\x06key_id\x18\x01 \x01(\r\x12!\n\x10remaining_budget\x18\x02 \x01(\x04\x42\x02\x30\x01H\x00\x88\x01\x01\x42\x13\n\x11_remaining_budget\x1a\xaf\x01\n\x14KeysRemainingBudgets\x12\x96\x01\n\x07\x65ntries\x18\x01 \x03(\x0b\x32\x84\x01.org.dash.platform.dapi.v0.GetIdentityKeysRemainingBudgetsResponse.GetIdentityKeysRemainingBudgetsResponseV0.KeyRemainingBudgetEntryB\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\"\x8c\x02\n%GetDataContractsLatestVersionsRequest\x12v\n\x02v0\x18\x01 \x01(\x0b\x32h.org.dash.platform.dapi.v0.GetDataContractsLatestVersionsRequest.GetDataContractsLatestVersionsRequestV0H\x00\x1a`\n\'GetDataContractsLatestVersionsRequestV0\x12\x0b\n\x03ids\x18\x01 \x03(\x0c\x12\x19\n\x11include_contracts\x18\x02 \x01(\x08\x12\r\n\x05prove\x18\x03 \x01(\x08\x42\t\n\x07version\"\xfa\x05\n&GetDataContractsLatestVersionsResponse\x12x\n\x02v0\x18\x01 \x01(\x0b\x32j.org.dash.platform.dapi.v0.GetDataContractsLatestVersionsResponse.GetDataContractsLatestVersionsResponseV0H\x00\x1a\x84\x01\n\x1e\x44\x61taContractLatestVersionEntry\x12\x12\n\nidentifier\x18\x01 \x01(\x0c\x12\x14\n\x07version\x18\x02 \x01(\rH\x00\x88\x01\x01\x12\x1a\n\rdata_contract\x18\x03 \x01(\x0cH\x01\x88\x01\x01\x42\n\n\x08_versionB\x10\n\x0e_data_contract\x1a\x90\x01\n\x1b\x44\x61taContractsLatestVersions\x12q\n\x07\x65ntries\x18\x01 \x03(\x0b\x32`.org.dash.platform.dapi.v0.GetDataContractsLatestVersionsResponse.DataContractLatestVersionEntry\x1a\xb0\x02\n(GetDataContractsLatestVersionsResponseV0\x12\x87\x01\n\x1e\x64\x61ta_contracts_latest_versions\x18\x01 \x01(\x0b\x32].org.dash.platform.dapi.v0.GetDataContractsLatestVersionsResponse.DataContractsLatestVersionsH\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\"R\n\x1f\x43ontractGroupDocumentTypeMember\x12\x13\n\x0b\x63ontract_id\x18\x01 \x01(\x0c\x12\x1a\n\x12\x64ocument_type_name\x18\x02 \x01(\t\"G\n\x18\x43ontractGroupTokenMember\x12\x13\n\x0b\x63ontract_id\x18\x01 \x01(\x0c\x12\x16\n\x0etoken_position\x18\x02 \x01(\r\"\xd7\x01\n\x1bGetContractGroupInfoRequest\x12\x62\n\x02v0\x18\x01 \x01(\x0b\x32T.org.dash.platform.dapi.v0.GetContractGroupInfoRequest.GetContractGroupInfoRequestV0H\x00\x1aI\n\x1dGetContractGroupInfoRequestV0\x12\x19\n\x11\x63ontract_group_id\x18\x01 \x01(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\x98\x04\n\x1cGetContractGroupInfoResponse\x12\x64\n\x02v0\x18\x01 \x01(\x0b\x32V.org.dash.platform.dapi.v0.GetContractGroupInfoResponse.GetContractGroupInfoResponseV0H\x00\x1a~\n\x11\x43ontractGroupInfo\x12\x10\n\x08owner_id\x18\x01 \x01(\x0c\x12\x11\n\tadmin_ids\x18\x02 \x03(\x0c\x12\x11\n\x04name\x18\x03 \x01(\tH\x00\x88\x01\x01\x12\x18\n\x0b\x64\x65scription\x18\x04 \x01(\tH\x01\x88\x01\x01\x42\x07\n\x05_nameB\x0e\n\x0c_description\x1a\x86\x02\n\x1eGetContractGroupInfoResponseV0\x12h\n\x13\x63ontract_group_info\x18\x01 \x01(\x0b\x32I.org.dash.platform.dapi.v0.GetContractGroupInfoResponse.ContractGroupInfoH\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\"\xf8\x06\n\x1eGetContractGroupMembersRequest\x12h\n\x02v0\x18\x01 \x01(\x0b\x32Z.org.dash.platform.dapi.v0.GetContractGroupMembersRequest.GetContractGroupMembersRequestV0H\x00\x1a@\n\x14\x43ontractMembersQuery\x12\x18\n\x0bstart_after\x18\x01 \x01(\x0cH\x00\x88\x01\x01\x42\x0e\n\x0c_start_after\x1a\x80\x01\n\x18\x44ocumentTypeMembersQuery\x12T\n\x0bstart_after\x18\x01 \x01(\x0b\x32:.org.dash.platform.dapi.v0.ContractGroupDocumentTypeMemberH\x00\x88\x01\x01\x42\x0e\n\x0c_start_after\x1ar\n\x11TokenMembersQuery\x12M\n\x0bstart_after\x18\x01 \x01(\x0b\x32\x33.org.dash.platform.dapi.v0.ContractGroupTokenMemberH\x00\x88\x01\x01\x42\x0e\n\x0c_start_after\x1a\xa7\x03\n GetContractGroupMembersRequestV0\x12\x19\n\x11\x63ontract_group_id\x18\x01 \x01(\x0c\x12\x63\n\tcontracts\x18\x02 \x01(\x0b\x32N.org.dash.platform.dapi.v0.GetContractGroupMembersRequest.ContractMembersQueryH\x00\x12l\n\x0e\x64ocument_types\x18\x03 \x01(\x0b\x32R.org.dash.platform.dapi.v0.GetContractGroupMembersRequest.DocumentTypeMembersQueryH\x00\x12]\n\x06tokens\x18\x04 \x01(\x0b\x32K.org.dash.platform.dapi.v0.GetContractGroupMembersRequest.TokenMembersQueryH\x00\x12\x12\n\x05limit\x18\x05 \x01(\rH\x01\x88\x01\x01\x12\r\n\x05prove\x18\x06 \x01(\x08\x42\t\n\x07membersB\x08\n\x06_limitB\t\n\x07version\"\xc9\x06\n\x1fGetContractGroupMembersResponse\x12j\n\x02v0\x18\x01 \x01(\x0b\x32\\.org.dash.platform.dapi.v0.GetContractGroupMembersResponse.GetContractGroupMembersResponseV0H\x00\x1a\'\n\x0f\x43ontractMembers\x12\x14\n\x0c\x63ontract_ids\x18\x01 \x03(\x0c\x1ai\n\x13\x44ocumentTypeMembers\x12R\n\x0e\x64ocument_types\x18\x01 \x03(\x0b\x32:.org.dash.platform.dapi.v0.ContractGroupDocumentTypeMember\x1aS\n\x0cTokenMembers\x12\x43\n\x06tokens\x18\x01 \x03(\x0b\x32\x33.org.dash.platform.dapi.v0.ContractGroupTokenMember\x1a\xc5\x03\n!GetContractGroupMembersResponseV0\x12_\n\tcontracts\x18\x01 \x01(\x0b\x32J.org.dash.platform.dapi.v0.GetContractGroupMembersResponse.ContractMembersH\x00\x12h\n\x0e\x64ocument_types\x18\x02 \x01(\x0b\x32N.org.dash.platform.dapi.v0.GetContractGroupMembersResponse.DocumentTypeMembersH\x00\x12Y\n\x06tokens\x18\x03 \x01(\x0b\x32G.org.dash.platform.dapi.v0.GetContractGroupMembersResponse.TokenMembersH\x00\x12\x31\n\x05proof\x18\x04 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x05 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadataB\x08\n\x06resultB\t\n\x07version\"M\n\x1a\x43ontractModerationDocument\x12\x1a\n\x12\x64ocument_type_name\x18\x01 \x01(\t\x12\x13\n\x0b\x64ocument_id\x18\x02 \x01(\x0c\"\xc6\x01\n\x18\x43ontractModerationReason\x12\x11\n\x04\x63ode\x18\x01 \x01(\rH\x00\x88\x01\x01\x12\x0c\n\x04text\x18\x02 \x01(\t\x12H\n\tdocuments\x18\x03 \x03(\x0b\x32\x35.org.dash.platform.dapi.v0.ContractModerationDocument\x12\x1f\n\x12reason_document_id\x18\x04 \x01(\x0cH\x01\x88\x01\x01\x42\x07\n\x05_codeB\x15\n\x13_reason_document_id\"i\n\x0f\x43ontractWarning\x12\x11\n\twarned_at\x18\x01 \x01(\x04\x12\x43\n\x06reason\x18\x02 \x01(\x0b\x32\x33.org.dash.platform.dapi.v0.ContractModerationReason\"\xc5\x02\n\"GetContractModerationStatusRequest\x12p\n\x02v0\x18\x01 \x01(\x0b\x32\x62.org.dash.platform.dapi.v0.GetContractModerationStatusRequest.GetContractModerationStatusRequestV0H\x00\x1a\xa1\x01\n$GetContractModerationStatusRequestV0\x12\x13\n\x0b\x63ontract_id\x18\x01 \x01(\x0c\x12\x13\n\x0bidentity_id\x18\x02 \x01(\x0c\x12@\n\x05lists\x18\x03 \x03(\x0e\x32\x31.org.dash.platform.dapi.v0.ContractModerationList\x12\r\n\x05prove\x18\x04 \x01(\x08\x42\t\n\x07version\"\xec\x06\n#GetContractModerationStatusResponse\x12r\n\x02v0\x18\x01 \x01(\x0b\x32\x64.org.dash.platform.dapi.v0.GetContractModerationStatusResponse.GetContractModerationStatusResponseV0H\x00\x1a\xb4\x03\n\x18\x43ontractModerationStatus\x12\x13\n\x06\x62\x61nned\x18\x01 \x01(\x08H\x00\x88\x01\x01\x12\x1c\n\x0fsuspended_until\x18\x02 \x01(\x04H\x01\x88\x01\x01\x12@\n\x05lists\x18\x03 \x03(\x0e\x32\x31.org.dash.platform.dapi.v0.ContractModerationList\x12L\n\nban_reason\x18\x04 \x01(\x0b\x32\x33.org.dash.platform.dapi.v0.ContractModerationReasonH\x02\x88\x01\x01\x12S\n\x11suspension_reason\x18\x05 \x01(\x0b\x32\x33.org.dash.platform.dapi.v0.ContractModerationReasonH\x03\x88\x01\x01\x12<\n\x08warnings\x18\x06 \x03(\x0b\x32*.org.dash.platform.dapi.v0.ContractWarningB\t\n\x07_bannedB\x12\n\x10_suspended_untilB\r\n\x0b_ban_reasonB\x14\n\x12_suspension_reason\x1a\x8e\x02\n%GetContractModerationStatusResponseV0\x12i\n\x06status\x18\x01 \x01(\x0b\x32W.org.dash.platform.dapi.v0.GetContractModerationStatusResponse.ContractModerationStatusH\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\x02\n#GetContractModerationEntriesRequest\x12r\n\x02v0\x18\x01 \x01(\x0b\x32\x64.org.dash.platform.dapi.v0.GetContractModerationEntriesRequest.GetContractModerationEntriesRequestV0H\x00\x1a\xd4\x01\n%GetContractModerationEntriesRequestV0\x12\x13\n\x0b\x63ontract_id\x18\x01 \x01(\x0c\x12?\n\x04list\x18\x02 \x01(\x0e\x32\x31.org.dash.platform.dapi.v0.ContractModerationList\x12\x18\n\x0bstart_after\x18\x03 \x01(\x0cH\x00\x88\x01\x01\x12\x12\n\x05limit\x18\x04 \x01(\rH\x01\x88\x01\x01\x12\r\n\x05prove\x18\x05 \x01(\x08\x42\x0e\n\x0c_start_afterB\x08\n\x06_limitB\t\n\x07version\"\x96\x06\n$GetContractModerationEntriesResponse\x12t\n\x02v0\x18\x01 \x01(\x0b\x32\x66.org.dash.platform.dapi.v0.GetContractModerationEntriesResponse.GetContractModerationEntriesResponseV0H\x00\x1a\xcf\x01\n\x17\x43ontractModerationEntry\x12\x13\n\x0bidentity_id\x18\x01 \x01(\x0c\x12\x12\n\x05until\x18\x02 \x01(\x04H\x00\x88\x01\x01\x12\x43\n\x06reason\x18\x03 \x01(\x0b\x32\x33.org.dash.platform.dapi.v0.ContractModerationReason\x12<\n\x08warnings\x18\x04 \x03(\x0b\x32*.org.dash.platform.dapi.v0.ContractWarningB\x08\n\x06_until\x1a\x85\x01\n\x19\x43ontractModerationEntries\x12h\n\x07\x65ntries\x18\x01 \x03(\x0b\x32W.org.dash.platform.dapi.v0.GetContractModerationEntriesResponse.ContractModerationEntry\x1a\x92\x02\n&GetContractModerationEntriesResponseV0\x12l\n\x07\x65ntries\x18\x01 \x01(\x0b\x32Y.org.dash.platform.dapi.v0.GetContractModerationEntriesResponse.ContractModerationEntriesH\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\"\xc3\x04\n\"GetContractDocumentRemovalsRequest\x12p\n\x02v0\x18\x01 \x01(\x0b\x32\x62.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0H\x00\x1a#\n\x0b\x44ocumentIds\x12\x14\n\x0c\x64ocument_ids\x18\x01 \x03(\x0c\x1aN\n\x04Page\x12\x18\n\x0bstart_after\x18\x01 \x01(\x0cH\x00\x88\x01\x01\x12\x12\n\x05limit\x18\x02 \x01(\rH\x01\x88\x01\x01\x42\x0e\n\x0c_start_afterB\x08\n\x06_limit\x1a\xaa\x02\n$GetContractDocumentRemovalsRequestV0\x12\x13\n\x0b\x63ontract_id\x18\x01 \x01(\x0c\x12\x1a\n\x12\x64ocument_type_name\x18\x02 \x01(\t\x12\x61\n\x0c\x64ocument_ids\x18\x03 \x01(\x0b\x32I.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.DocumentIdsH\x00\x12R\n\x04page\x18\x04 \x01(\x0b\x32\x42.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.PageH\x00\x12\r\n\x05prove\x18\x05 \x01(\x08\x42\x0b\n\tselectionB\t\n\x07version\"\xe0\x07\n#GetContractDocumentRemovalsResponse\x12r\n\x02v0\x18\x01 \x01(\x0b\x32\x64.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0H\x00\x1aH\n\x1b\x43ontractDocumentRestoration\x12\x14\n\x0cmoderator_id\x18\x01 \x01(\x0c\x12\x13\n\x0brestored_at\x18\x02 \x01(\x04\x1a\xd5\x02\n\x17\x43ontractDocumentRemoval\x12\x13\n\x0b\x64ocument_id\x18\x01 \x01(\x0c\x12\x19\n\x11\x64ocument_owner_id\x18\x02 \x01(\x0c\x12\x14\n\x0cmoderator_id\x18\x03 \x01(\x0c\x12\x12\n\nremoved_at\x18\x04 \x01(\x04\x12\x43\n\x06reason\x18\x05 \x01(\x0b\x32\x33.org.dash.platform.dapi.v0.ContractModerationReason\x12\x15\n\rdocument_hash\x18\x06 \x01(\x0c\x12o\n\x0brestoration\x18\x07 \x01(\x0b\x32Z.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRestoration\x12\x13\n\x0bkept_fields\x18\x08 \x01(\x0c\x1a\x84\x01\n\x18\x43ontractDocumentRemovals\x12h\n\x08removals\x18\x01 \x03(\x0b\x32V.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval\x1a\x90\x02\n%GetContractDocumentRemovalsResponseV0\x12k\n\x08removals\x18\x01 \x01(\x0b\x32W.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemovalsH\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\"\xc7\x04\n\x1dGetContractTeamActionsRequest\x12\x66\n\x02v0\x18\x01 \x01(\x0b\x32X.org.dash.platform.dapi.v0.GetContractTeamActionsRequest.GetContractTeamActionsRequestV0H\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\xbc\x02\n\x1fGetContractTeamActionsRequestV0\x12\x13\n\x0b\x63ontract_id\x18\x01 \x01(\x0c\x12U\n\x06status\x18\x02 \x01(\x0e\x32\x45.org.dash.platform.dapi.v0.GetContractTeamActionsRequest.ActionStatus\x12i\n\x12start_at_action_id\x18\x03 \x01(\x0b\x32H.org.dash.platform.dapi.v0.GetContractTeamActionsRequest.StartAtActionIdH\x00\x88\x01\x01\x12\x12\n\x05\x63ount\x18\x04 \x01(\rH\x01\x88\x01\x01\x12\r\n\x05prove\x18\x05 \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\"\xe0\x07\n\x1eGetContractTeamActionsResponse\x12h\n\x02v0\x18\x01 \x01(\x0b\x32Z.org.dash.platform.dapi.v0.GetContractTeamActionsResponse.GetContractTeamActionsResponseV0H\x00\x1a\xe6\x01\n\x15\x44\x65leteSettledDocument\x12\x1a\n\x12\x64ocument_type_name\x18\x01 \x01(\t\x12\x13\n\x0b\x64ocument_id\x18\x02 \x01(\x0c\x12!\n\x19\x64ocument_last_modified_at\x18\x03 \x01(\x04\x12\x1e\n\x11\x64ocument_revision\x18\x04 \x01(\x04H\x00\x88\x01\x01\x12\x43\n\x06reason\x18\x05 \x01(\x0b\x32\x33.org.dash.platform.dapi.v0.ContractModerationReasonB\x14\n\x12_document_revision\x1a\xe6\x01\n\x12\x43ontractTeamAction\x12\x11\n\taction_id\x18\x01 \x01(\x0c\x12\x13\n\x0bproposer_id\x18\x02 \x01(\x0c\x12\x13\n\x0bproposed_at\x18\x03 \x01(\x04\x12r\n\x17\x64\x65lete_settled_document\x18\x04 \x01(\x0b\x32O.org.dash.platform.dapi.v0.GetContractTeamActionsResponse.DeleteSettledDocumentH\x00\x12\x16\n\x0e\x61pproval_count\x18\x05 \x01(\rB\x07\n\x05\x65vent\x1at\n\x13\x43ontractTeamActions\x12]\n\x07\x61\x63tions\x18\x01 \x03(\x0b\x32L.org.dash.platform.dapi.v0.GetContractTeamActionsResponse.ContractTeamAction\x1a\x80\x02\n GetContractTeamActionsResponseV0\x12`\n\x07\x61\x63tions\x18\x01 \x01(\x0b\x32M.org.dash.platform.dapi.v0.GetContractTeamActionsResponse.ContractTeamActionsH\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\"\x8a\x03\n#GetContractTeamActionSignersRequest\x12r\n\x02v0\x18\x01 \x01(\x0b\x32\x64.org.dash.platform.dapi.v0.GetContractTeamActionSignersRequest.GetContractTeamActionSignersRequestV0H\x00\x1a\xbb\x01\n%GetContractTeamActionSignersRequestV0\x12\x13\n\x0b\x63ontract_id\x18\x01 \x01(\x0c\x12[\n\x06status\x18\x02 \x01(\x0e\x32K.org.dash.platform.dapi.v0.GetContractTeamActionSignersRequest.ActionStatus\x12\x11\n\taction_id\x18\x03 \x01(\x0c\x12\r\n\x05prove\x18\x04 \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\"\xed\x03\n$GetContractTeamActionSignersResponse\x12t\n\x02v0\x18\x01 \x01(\x0b\x32\x66.org.dash.platform.dapi.v0.GetContractTeamActionSignersResponse.GetContractTeamActionSignersResponseV0H\x00\x1a/\n\x19\x43ontractTeamActionSigners\x12\x12\n\nsigner_ids\x18\x01 \x03(\x0c\x1a\x92\x02\n&GetContractTeamActionSignersResponseV0\x12l\n\x07signers\x18\x01 \x01(\x0b\x32Y.org.dash.platform.dapi.v0.GetContractTeamActionSignersResponse.ContractTeamActionSignersH\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\"\x85\x02\n(GetContractModerationActionCountsRequest\x12|\n\x02v0\x18\x01 \x01(\x0b\x32n.org.dash.platform.dapi.v0.GetContractModerationActionCountsRequest.GetContractModerationActionCountsRequestV0H\x00\x1aP\n*GetContractModerationActionCountsRequestV0\x12\x13\n\x0b\x63ontract_id\x18\x01 \x01(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\xb5\x05\n)GetContractModerationActionCountsResponse\x12~\n\x02v0\x18\x01 \x01(\x0b\x32p.org.dash.platform.dapi.v0.GetContractModerationActionCountsResponse.GetContractModerationActionCountsResponseV0H\x00\x1a\x43\n\x1d\x43ontractModerationActionCount\x12\x13\n\x0bidentity_id\x18\x01 \x01(\x0c\x12\r\n\x05\x63ount\x18\x02 \x01(\r\x1a\x94\x01\n\x1e\x43ontractModerationActionCounts\x12r\n\x06\x63ounts\x18\x01 \x03(\x0b\x32\x62.org.dash.platform.dapi.v0.GetContractModerationActionCountsResponse.ContractModerationActionCount\x1a\xa0\x02\n+GetContractModerationActionCountsResponseV0\x12u\n\x06\x63ounts\x18\x01 \x01(\x0b\x32\x63.org.dash.platform.dapi.v0.GetContractModerationActionCountsResponse.ContractModerationActionCountsH\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\"\xc9\x01\n\x19GetContractFeePotsRequest\x12^\n\x02v0\x18\x01 \x01(\x0b\x32P.org.dash.platform.dapi.v0.GetContractFeePotsRequest.GetContractFeePotsRequestV0H\x00\x1a\x41\n\x1bGetContractFeePotsRequestV0\x12\x13\n\x0b\x63ontract_id\x18\x01 \x01(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\x9f\x06\n\x1aGetContractFeePotsResponse\x12`\n\x02v0\x18\x01 \x01(\x0b\x32R.org.dash.platform.dapi.v0.GetContractFeePotsResponse.GetContractFeePotsResponseV0H\x00\x1aR\n\x17\x43ontractFeePotLastClaim\x12\r\n\x05\x65poch\x18\x01 \x01(\r\x12\x13\n\x07time_ms\x18\x02 \x01(\x04\x42\x02\x30\x01\x12\x13\n\x0b\x63laimant_id\x18\x03 \x01(\x0c\x1a\x88\x01\n\x0e\x43ontractFeePot\x12\x13\n\x07\x63redits\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\x61\n\nlast_claim\x18\x02 \x01(\x0b\x32M.org.dash.platform.dapi.v0.GetContractFeePotsResponse.ContractFeePotLastClaim\x1a\xc0\x01\n\x0f\x43ontractFeePots\x12S\n\x05owner\x18\x01 \x01(\x0b\x32\x44.org.dash.platform.dapi.v0.GetContractFeePotsResponse.ContractFeePot\x12X\n\nmoderators\x18\x02 \x01(\x0b\x32\x44.org.dash.platform.dapi.v0.GetContractFeePotsResponse.ContractFeePot\x1a\xf1\x01\n\x1cGetContractFeePotsResponseV0\x12U\n\x04pots\x18\x01 \x01(\x0b\x32\x45.org.dash.platform.dapi.v0.GetContractFeePotsResponse.ContractFeePotsH\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\"\xf1\x01\n#GetContractGroupsForContractRequest\x12r\n\x02v0\x18\x01 \x01(\x0b\x32\x64.org.dash.platform.dapi.v0.GetContractGroupsForContractRequest.GetContractGroupsForContractRequestV0H\x00\x1aK\n%GetContractGroupsForContractRequestV0\x12\x13\n\x0b\x63ontract_id\x18\x01 \x01(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\xf5\x06\n$GetContractGroupsForContractResponse\x12t\n\x02v0\x18\x01 \x01(\x0b\x32\x66.org.dash.platform.dapi.v0.GetContractGroupsForContractResponse.GetContractGroupsForContractResponseV0H\x00\x1aQ\n\x17\x44ocumentTypeMemberships\x12\x1a\n\x12\x64ocument_type_name\x18\x01 \x01(\t\x12\x1a\n\x12\x63ontract_group_ids\x18\x02 \x03(\x0c\x1a\x46\n\x10TokenMemberships\x12\x16\n\x0etoken_position\x18\x01 \x01(\r\x12\x1a\n\x12\x63ontract_group_ids\x18\x02 \x03(\x0c\x1a\x89\x02\n\x18\x43ontractGroupMemberships\x12\x1a\n\x12\x63ontract_group_ids\x18\x01 \x03(\x0c\x12o\n\x0e\x64ocument_types\x18\x02 \x03(\x0b\x32W.org.dash.platform.dapi.v0.GetContractGroupsForContractResponse.DocumentTypeMemberships\x12`\n\x06tokens\x18\x03 \x03(\x0b\x32P.org.dash.platform.dapi.v0.GetContractGroupsForContractResponse.TokenMemberships\x1a\xa4\x02\n&GetContractGroupsForContractResponseV0\x12~\n\x1a\x63ontract_group_memberships\x18\x01 \x01(\x0b\x32X.org.dash.platform.dapi.v0.GetContractGroupsForContractResponse.ContractGroupMembershipsH\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\"\xad\x02\n\x1eGetDataContractsByRangeRequest\x12h\n\x02v0\x18\x01 \x01(\x0b\x32Z.org.dash.platform.dapi.v0.GetDataContractsByRangeRequest.GetDataContractsByRangeRequestV0H\x00\x1a\x95\x01\n GetDataContractsByRangeRequestV0\x12\x12\n\x05limit\x18\x01 \x01(\rH\x01\x88\x01\x01\x12\x15\n\x0bstart_after\x18\x02 \x01(\x0cH\x00\x12\x12\n\x08start_at\x18\x03 \x01(\x0cH\x00\x12\x10\n\x08ids_only\x18\x04 \x01(\x08\x12\r\n\x05prove\x18\x05 \x01(\x08\x42\x07\n\x05startB\x08\n\x06_limitB\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\"\xf8\"\n\x13GetDocumentsRequest\x12R\n\x02v0\x18\x01 \x01(\x0b\x32\x44.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0H\x00\x12R\n\x02v1\x18\x02 \x01(\x0b\x32\x44.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1H\x00\x1a\xfe\x02\n\x12\x44ocumentFieldValue\x12\x14\n\nbool_value\x18\x01 \x01(\x08H\x00\x12\x19\n\x0bint64_value\x18\x02 \x01(\x12\x42\x02\x30\x01H\x00\x12\x1a\n\x0cuint64_value\x18\x03 \x01(\x04\x42\x02\x30\x01H\x00\x12\x16\n\x0c\x64ouble_value\x18\x04 \x01(\x01H\x00\x12\x0e\n\x04text\x18\x05 \x01(\tH\x00\x12\x15\n\x0b\x62ytes_value\x18\x06 \x01(\x0cH\x00\x12[\n\x04list\x18\x07 \x01(\x0b\x32K.org.dash.platform.dapi.v0.GetDocumentsRequest.DocumentFieldValue.ValueListH\x00\x12\x14\n\nnull_value\x18\x08 \x01(\x08H\x00\x1a^\n\tValueList\x12Q\n\x06values\x18\x01 \x03(\x0b\x32\x41.org.dash.platform.dapi.v0.GetDocumentsRequest.DocumentFieldValueB\t\n\x07variant\x1a\xe2\x02\n\x12TimeRangeSelection\x12\\\n\x08selector\x18\x01 \x01(\x0e\x32J.org.dash.platform.dapi.v0.GetDocumentsRequest.TimeRangeSelection.Selector\x12\x19\n\x08start_ms\x18\x02 \x01(\x04\x42\x02\x30\x01H\x00\x88\x01\x01\x12T\n\x04grid\x18\x03 \x01(\x0b\x32\x46.org.dash.platform.dapi.v0.GetDocumentsRequest.TimeRangeSelection.Grid\x1a>\n\x04Grid\x12\x11\n\x05range\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\x10\n\x04step\x18\x02 \x01(\x04\x42\x02\x30\x01\x12\x11\n\x05phase\x18\x03 \x01(\x04\x42\x02\x30\x01\"0\n\x08Selector\x12\n\n\x06NEWEST\x10\x00\x12\n\n\x06OLDEST\x10\x01\x12\x0c\n\x08\x42Y_START\x10\x02\x42\x0b\n\t_start_ms\x1a\x82\x02\n\x15IntegerRangeSelection\x12P\n\x05start\x18\x01 \x01(\x0b\x32\x41.org.dash.platform.dapi.v0.GetDocumentsRequest.DocumentFieldValue\x12W\n\x04grid\x18\x02 \x01(\x0b\x32I.org.dash.platform.dapi.v0.GetDocumentsRequest.IntegerRangeSelection.Grid\x1a>\n\x04Grid\x12\x11\n\x05range\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\x10\n\x04step\x18\x02 \x01(\x04\x42\x02\x30\x01\x12\x11\n\x05phase\x18\x03 \x01(\x04\x42\x02\x30\x01\x1a\xf2\x02\n\x0bWhereClause\x12\r\n\x05\x66ield\x18\x01 \x01(\t\x12N\n\x08operator\x18\x02 \x01(\x0e\x32<.org.dash.platform.dapi.v0.GetDocumentsRequest.WhereOperator\x12P\n\x05value\x18\x03 \x01(\x0b\x32\x41.org.dash.platform.dapi.v0.GetDocumentsRequest.DocumentFieldValue\x12U\n\ntime_range\x18\x04 \x01(\x0b\x32\x41.org.dash.platform.dapi.v0.GetDocumentsRequest.TimeRangeSelection\x12[\n\rinteger_range\x18\x05 \x01(\x0b\x32\x44.org.dash.platform.dapi.v0.GetDocumentsRequest.IntegerRangeSelection\x1a\xa4\x01\n\x0fHavingAggregate\x12Y\n\x08\x66unction\x18\x01 \x01(\x0e\x32G.org.dash.platform.dapi.v0.GetDocumentsRequest.HavingAggregate.Function\x12\r\n\x05\x66ield\x18\x02 \x01(\t\"\'\n\x08\x46unction\x12\t\n\x05\x43OUNT\x10\x00\x12\x07\n\x03SUM\x10\x01\x12\x07\n\x03\x41VG\x10\x02\x1a\xf9\x03\n\x0cHavingClause\x12Q\n\taggregate\x18\x01 \x01(\x0b\x32>.org.dash.platform.dapi.v0.GetDocumentsRequest.HavingAggregate\x12V\n\x08operator\x18\x02 \x01(\x0e\x32\x44.org.dash.platform.dapi.v0.GetDocumentsRequest.HavingClause.Operator\x12R\n\x05value\x18\x03 \x01(\x0b\x32\x41.org.dash.platform.dapi.v0.GetDocumentsRequest.DocumentFieldValueH\x00\"\xe0\x01\n\x08Operator\x12\t\n\x05\x45QUAL\x10\x00\x12\r\n\tNOT_EQUAL\x10\x01\x12\x10\n\x0cGREATER_THAN\x10\x02\x12\x1a\n\x16GREATER_THAN_OR_EQUALS\x10\x03\x12\r\n\tLESS_THAN\x10\x04\x12\x17\n\x13LESS_THAN_OR_EQUALS\x10\x05\x12\x0b\n\x07\x42\x45TWEEN\x10\x06\x12\x1a\n\x16\x42\x45TWEEN_EXCLUDE_BOUNDS\x10\x07\x12\x18\n\x14\x42\x45TWEEN_EXCLUDE_LEFT\x10\x08\x12\x19\n\x15\x42\x45TWEEN_EXCLUDE_RIGHT\x10\t\x12\x06\n\x02IN\x10\nB\x07\n\x05right\x1a\x90\x01\n\x0bOrderClause\x12\x0f\n\x05\x66ield\x18\x01 \x01(\tH\x00\x12S\n\taggregate\x18\x03 \x01(\x0b\x32>.org.dash.platform.dapi.v0.GetDocumentsRequest.HavingAggregateH\x00\x12\x11\n\tascending\x18\x02 \x01(\x08\x42\x08\n\x06target\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\x05start\x1a\xa6\x0c\n\x15GetDocumentsRequestV1\x12\x18\n\x10\x64\x61ta_contract_id\x18\x01 \x01(\x0c\x12\x15\n\rdocument_type\x18\x02 \x01(\t\x12Q\n\rwhere_clauses\x18\x03 \x03(\x0b\x32:.org.dash.platform.dapi.v0.GetDocumentsRequest.WhereClause\x12L\n\x08order_by\x18\x04 \x03(\x0b\x32:.org.dash.platform.dapi.v0.GetDocumentsRequest.OrderClause\x12\x12\n\x05limit\x18\x05 \x01(\rH\x01\x88\x01\x01\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\x12\\\n\x07selects\x18\t \x03(\x0b\x32K.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.Select\x12\x10\n\x08group_by\x18\n \x03(\t\x12K\n\x06having\x18\x0b \x03(\x0b\x32;.org.dash.platform.dapi.v0.GetDocumentsRequest.HavingClause\x12\x13\n\x06offset\x18\x0c \x01(\rH\x02\x88\x01\x01\x12\x61\n\x07\x63hained\x18\r \x01(\x0b\x32P.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.ChainedJoin\x12\x62\n\x0bsub_queries\x18\x0e \x03(\x0b\x32M.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.SubQuery\x1a\xc9\x01\n\x06Select\x12\x66\n\x08\x66unction\x18\x01 \x01(\x0e\x32T.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.Select.Function\x12\r\n\x05\x66ield\x18\x02 \x01(\t\"H\n\x08\x46unction\x12\r\n\tDOCUMENTS\x10\x00\x12\t\n\x05\x43OUNT\x10\x01\x12\x07\n\x03SUM\x10\x02\x12\x07\n\x03\x41VG\x10\x03\x12\x07\n\x03MIN\x10\x04\x12\x07\n\x03MAX\x10\x05\x1a\x41\n\x0b\x43hainedJoin\x12\x15\n\rjoin_property\x18\x01 \x01(\t\x12\x1b\n\x13outer_document_type\x18\x02 \x01(\t\x1a\xa6\x04\n\x08SubQuery\x12\x18\n\x10\x64\x61ta_contract_id\x18\x01 \x01(\x0c\x12\x15\n\rdocument_type\x18\x02 \x01(\t\x12Q\n\rwhere_clauses\x18\x03 \x03(\x0b\x32:.org.dash.platform.dapi.v0.GetDocumentsRequest.WhereClause\x12L\n\x08order_by\x18\x04 \x03(\x0b\x32:.org.dash.platform.dapi.v0.GetDocumentsRequest.OrderClause\x12\x12\n\x05limit\x18\x05 \x01(\rH\x00\x88\x01\x01\x12`\n\x04kind\x18\x06 \x01(\x0e\x32R.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.SubQuery.Kind\x12\x63\n\x04\x62ind\x18\x07 \x01(\x0b\x32U.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV1.SubQuery.Binding\x1a\x41\n\x07\x42inding\x12\x0e\n\x06source\x18\x01 \x01(\r\x12\x17\n\x0fsource_property\x18\x02 \x01(\t\x12\r\n\x05\x66ield\x18\x03 \x01(\t\" \n\x04Kind\x12\r\n\tDOCUMENTS\x10\x00\x12\t\n\x05\x43OUNT\x10\x01\x42\x08\n\x06_limitB\x07\n\x05startB\x08\n\x06_limitB\t\n\x07_offset\"\xb0\x02\n\rWhereOperator\x12\t\n\x05\x45QUAL\x10\x00\x12\x10\n\x0cGREATER_THAN\x10\x01\x12\x1a\n\x16GREATER_THAN_OR_EQUALS\x10\x02\x12\r\n\tLESS_THAN\x10\x03\x12\x17\n\x13LESS_THAN_OR_EQUALS\x10\x04\x12\x0b\n\x07\x42\x45TWEEN\x10\x05\x12\x1a\n\x16\x42\x45TWEEN_EXCLUDE_BOUNDS\x10\x06\x12\x18\n\x14\x42\x45TWEEN_EXCLUDE_LEFT\x10\x07\x12\x19\n\x15\x42\x45TWEEN_EXCLUDE_RIGHT\x10\x08\x12\x06\n\x02IN\x10\t\x12\x0f\n\x0bSTARTS_WITH\x10\n\x12\x11\n\rIN_TIME_RANGE\x10\x0b\x12\x14\n\x10IN_INTEGER_RANGE\x10\x0c\x12\x0c\n\x08\x43ONTAINS\x10\r\x12\x10\n\x0c\x43ONTAINS_ANY\x10\x0e\x42\t\n\x07version\"\xd5\x1d\n\x14GetDocumentsResponse\x12T\n\x02v0\x18\x01 \x01(\x0b\x32\x46.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0H\x00\x12T\n\x02v1\x18\x02 \x01(\x0b\x32\x46.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1H\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\x06result\x1a\xe7\x19\n\x16GetDocumentsResponseV1\x12\x61\n\x04\x64\x61ta\x18\x01 \x01(\x0b\x32Q.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ResultDataH\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\x1aL\n\nCountEntry\x12\x13\n\x06in_key\x18\x01 \x01(\x0cH\x00\x88\x01\x01\x12\x0b\n\x03key\x18\x02 \x01(\x0c\x12\x11\n\x05\x63ount\x18\x03 \x01(\x04\x42\x02\x30\x01\x42\t\n\x07_in_key\x1ar\n\x0c\x43ountEntries\x12\x62\n\x07\x65ntries\x18\x01 \x03(\x0b\x32Q.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntry\x1a\xa0\x01\n\x0c\x43ountResults\x12\x1d\n\x0f\x61ggregate_count\x18\x01 \x01(\x04\x42\x02\x30\x01H\x00\x12\x66\n\x07\x65ntries\x18\x02 \x01(\x0b\x32S.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntriesH\x00\x42\t\n\x07variant\x1aH\n\x08SumEntry\x12\x13\n\x06in_key\x18\x01 \x01(\x0cH\x00\x88\x01\x01\x12\x0b\n\x03key\x18\x02 \x01(\x0c\x12\x0f\n\x03sum\x18\x03 \x01(\x12\x42\x02\x30\x01\x42\t\n\x07_in_key\x1an\n\nSumEntries\x12`\n\x07\x65ntries\x18\x01 \x03(\x0b\x32O.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.SumEntry\x1a\x9a\x01\n\nSumResults\x12\x1b\n\raggregate_sum\x18\x01 \x01(\x12\x42\x02\x30\x01H\x00\x12\x64\n\x07\x65ntries\x18\x02 \x01(\x0b\x32Q.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.SumEntriesH\x00\x42\t\n\x07variant\x1a_\n\x0c\x41verageEntry\x12\x13\n\x06in_key\x18\x01 \x01(\x0cH\x00\x88\x01\x01\x12\x0b\n\x03key\x18\x02 \x01(\x0c\x12\x11\n\x05\x63ount\x18\x03 \x01(\x04\x42\x02\x30\x01\x12\x0f\n\x03sum\x18\x04 \x01(\x12\x42\x02\x30\x01\x42\t\n\x07_in_key\x1av\n\x0e\x41verageEntries\x12\x64\n\x07\x65ntries\x18\x01 \x03(\x0b\x32S.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.AverageEntry\x1a\x36\n\x10\x41verageAggregate\x12\x11\n\x05\x63ount\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\x0f\n\x03sum\x18\x02 \x01(\x12\x42\x02\x30\x01\x1a\xfb\x01\n\x0e\x41verageResults\x12t\n\x11\x61ggregate_average\x18\x01 \x01(\x0b\x32W.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.AverageAggregateH\x00\x12h\n\x07\x65ntries\x18\x02 \x01(\x0b\x32U.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.AverageEntriesH\x00\x42\t\n\x07variant\x1az\n\x0bRankedEntry\x12\x0b\n\x03key\x18\x01 \x01(\x0c\x12\x13\n\x05\x63ount\x18\x02 \x01(\x04\x42\x02\x30\x01H\x00\x12\x11\n\x03sum\x18\x03 \x01(\x12\x42\x02\x30\x01H\x00\x12\r\n\x03\x61vg\x18\x04 \x01(\x01H\x00\x12\x13\n\x06in_key\x18\x05 \x01(\x0cH\x01\x88\x01\x01\x42\x07\n\x05valueB\t\n\x07_in_key\x1a\x9a\x01\n\rRankedEntries\x12\x63\n\x07\x65ntries\x18\x01 \x03(\x0b\x32R.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.RankedEntry\x12\x18\n\x07skipped\x18\x02 \x01(\x04\x42\x02\x30\x01H\x00\x88\x01\x01\x42\n\n\x08_skipped\x1a\xf7\x05\n\nResultData\x12\x65\n\tdocuments\x18\x01 \x01(\x0b\x32P.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.DocumentsH\x00\x12\x65\n\x06\x63ounts\x18\x02 \x01(\x0b\x32S.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountResultsH\x00\x12\x61\n\x04sums\x18\x03 \x01(\x0b\x32Q.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.SumResultsH\x00\x12i\n\x08\x61verages\x18\x04 \x01(\x0b\x32U.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.AverageResultsH\x00\x12\x66\n\x06ranked\x18\x05 \x01(\x0b\x32T.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.RankedEntriesH\x00\x12j\n\x07\x63hained\x18\x06 \x01(\x0b\x32W.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.ChainedDocumentsH\x00\x12n\n\tcomposite\x18\x07 \x01(\x0b\x32Y.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CompositeDocumentsH\x00\x42\t\n\x07variant\x1a\xd8\x01\n\x10\x43hainedDocuments\x12\x17\n\x0finner_documents\x18\x01 \x03(\x0c\x12\x17\n\x0fouter_documents\x18\x02 \x03(\x0c\x12\x19\n\x11missing_outer_ids\x18\x03 \x03(\x0c\x12w\n\x17removed_outer_documents\x18\x04 \x03(\x0b\x32V.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval\x1a\x94\x04\n\x12\x43ompositeDocuments\x12\x16\n\x0epage_documents\x18\x01 \x03(\x0c\x12}\n\x0bsub_results\x18\x02 \x03(\x0b\x32h.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CompositeDocuments.SubQueryResult\x1a\xe6\x02\n\x0eSubQueryResult\x12\x65\n\tdocuments\x18\x01 \x01(\x0b\x32P.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.DocumentsH\x00\x12\x65\n\x06\x63ounts\x18\x02 \x01(\x0b\x32S.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV1.CountEntriesH\x00\x12\x13\n\x0bmissing_ids\x18\x03 \x03(\x0c\x12g\n\x07removed\x18\x04 \x03(\x0b\x32V.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemovalB\x08\n\x06resultB\x08\n\x06resultB\t\n\x07version\"\xf4\x02\n\x19GetDocumentHistoryRequest\x12^\n\x02v0\x18\x01 \x01(\x0b\x32P.org.dash.platform.dapi.v0.GetDocumentHistoryRequest.GetDocumentHistoryRequestV0H\x00\x1a\xeb\x01\n\x1bGetDocumentHistoryRequestV0\x12\x18\n\x10\x64\x61ta_contract_id\x18\x01 \x01(\x0c\x12\x1a\n\x12\x64ocument_type_name\x18\x02 \x01(\t\x12\x13\n\x0b\x64ocument_id\x18\x03 \x01(\x0c\x12+\n\x05limit\x18\x04 \x01(\x0b\x32\x1c.google.protobuf.UInt32Value\x12,\n\x06offset\x18\x05 \x01(\x0b\x32\x1c.google.protobuf.UInt32Value\x12\x17\n\x0bstart_at_ms\x18\x06 \x01(\x04\x42\x02\x30\x01\x12\r\n\x05prove\x18\x07 \x01(\x08\x42\t\n\x07version\"\xf7\x04\n\x1aGetDocumentHistoryResponse\x12`\n\x02v0\x18\x01 \x01(\x0b\x32R.org.dash.platform.dapi.v0.GetDocumentHistoryResponse.GetDocumentHistoryResponseV0H\x00\x1a\xeb\x03\n\x1cGetDocumentHistoryResponseV0\x12~\n\x10\x64ocument_history\x18\x01 \x01(\x0b\x32\x62.org.dash.platform.dapi.v0.GetDocumentHistoryResponse.GetDocumentHistoryResponseV0.DocumentHistoryH\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\x37\n\x14\x44ocumentHistoryEntry\x12\x10\n\x04\x64\x61te\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\r\n\x05value\x18\x02 \x01(\x0c\x1a\x95\x01\n\x0f\x44ocumentHistory\x12\x81\x01\n\x10\x64ocument_entries\x18\x01 \x03(\x0b\x32g.org.dash.platform.dapi.v0.GetDocumentHistoryResponse.GetDocumentHistoryResponseV0.DocumentHistoryEntryB\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\"\xbd\x02\n*GetIdentityByNonUniquePublicKeyHashRequest\x12\x80\x01\n\x02v0\x18\x01 \x01(\x0b\x32r.org.dash.platform.dapi.v0.GetIdentityByNonUniquePublicKeyHashRequest.GetIdentityByNonUniquePublicKeyHashRequestV0H\x00\x1a\x80\x01\n,GetIdentityByNonUniquePublicKeyHashRequestV0\x12\x17\n\x0fpublic_key_hash\x18\x01 \x01(\x0c\x12\x18\n\x0bstart_after\x18\x02 \x01(\x0cH\x00\x88\x01\x01\x12\r\n\x05prove\x18\x03 \x01(\x08\x42\x0e\n\x0c_start_afterB\t\n\x07version\"\xc6\x04\n+GetIdentityByNonUniquePublicKeyHashResponse\x12\x82\x01\n\x02v0\x18\x01 \x01(\x0b\x32t.org.dash.platform.dapi.v0.GetIdentityByNonUniquePublicKeyHashResponse.GetIdentityByNonUniquePublicKeyHashResponseV0H\x00\x1a\x86\x03\n-GetIdentityByNonUniquePublicKeyHashResponseV0\x12\x9a\x01\n\x08identity\x18\x01 \x01(\x0b\x32\x85\x01.org.dash.platform.dapi.v0.GetIdentityByNonUniquePublicKeyHashResponse.GetIdentityByNonUniquePublicKeyHashResponseV0.IdentityResponseH\x00\x12\x31\n\x05proof\x18\x04 \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\x36\n\x10IdentityResponse\x12\x15\n\x08identity\x18\x01 \x01(\x0cH\x00\x88\x01\x01\x42\x0b\n\t_identityB\x08\n\x06resultJ\x04\x08\x02\x10\x03\x42\t\n\x07version\"\x99\x02\n#WaitForStateTransitionResultRequest\x12r\n\x02v0\x18\x01 \x01(\x0b\x32\x64.org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0H\x00\x1as\n%WaitForStateTransitionResultRequestV0\x12\x1d\n\x15state_transition_hash\x18\x01 \x01(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\x12\x1c\n\x14request_user_balance\x18\x03 \x01(\x08\x42\t\n\x07version\"\xce\x04\n$WaitForStateTransitionResultResponse\x12t\n\x02v0\x18\x01 \x01(\x0b\x32\x66.org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0H\x00\x1a\x34\n\x17SuccessWithOwnerBalance\x12\x19\n\rowner_balance\x18\x01 \x01(\x04\x42\x02\x30\x01\x1a\xee\x02\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\x1asuccess_with_owner_balance\x18\x04 \x01(\x0b\x32W.org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.SuccessWithOwnerBalanceH\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\"\xbf\x02\n\x1dGetFinalizedEpochInfosRequest\x12\x66\n\x02v0\x18\x01 \x01(\x0b\x32X.org.dash.platform.dapi.v0.GetFinalizedEpochInfosRequest.GetFinalizedEpochInfosRequestV0H\x00\x1a\xaa\x01\n\x1fGetFinalizedEpochInfosRequestV0\x12\x19\n\x11start_epoch_index\x18\x01 \x01(\r\x12\"\n\x1astart_epoch_index_included\x18\x02 \x01(\x08\x12\x17\n\x0f\x65nd_epoch_index\x18\x03 \x01(\r\x12 \n\x18\x65nd_epoch_index_included\x18\x04 \x01(\x08\x12\r\n\x05prove\x18\x05 \x01(\x08\x42\t\n\x07version\"\xbd\t\n\x1eGetFinalizedEpochInfosResponse\x12h\n\x02v0\x18\x01 \x01(\x0b\x32Z.org.dash.platform.dapi.v0.GetFinalizedEpochInfosResponse.GetFinalizedEpochInfosResponseV0H\x00\x1a\xa5\x08\n GetFinalizedEpochInfosResponseV0\x12\x80\x01\n\x06\x65pochs\x18\x01 \x01(\x0b\x32n.org.dash.platform.dapi.v0.GetFinalizedEpochInfosResponse.GetFinalizedEpochInfosResponseV0.FinalizedEpochInfosH\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\xa4\x01\n\x13\x46inalizedEpochInfos\x12\x8c\x01\n\x15\x66inalized_epoch_infos\x18\x01 \x03(\x0b\x32m.org.dash.platform.dapi.v0.GetFinalizedEpochInfosResponse.GetFinalizedEpochInfosResponseV0.FinalizedEpochInfo\x1a\x9f\x04\n\x12\x46inalizedEpochInfo\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\x1c\n\x10\x66irst_block_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(\r\x12!\n\x15total_blocks_in_epoch\x18\x07 \x01(\x04\x42\x02\x30\x01\x12*\n\"next_epoch_start_core_block_height\x18\x08 \x01(\r\x12!\n\x15total_processing_fees\x18\t \x01(\x04\x42\x02\x30\x01\x12*\n\x1etotal_distributed_storage_fees\x18\n \x01(\x04\x42\x02\x30\x01\x12&\n\x1atotal_created_storage_fees\x18\x0b \x01(\x04\x42\x02\x30\x01\x12\x1e\n\x12\x63ore_block_rewards\x18\x0c \x01(\x04\x42\x02\x30\x01\x12\x81\x01\n\x0f\x62lock_proposers\x18\r \x03(\x0b\x32h.org.dash.platform.dapi.v0.GetFinalizedEpochInfosResponse.GetFinalizedEpochInfosResponseV0.BlockProposer\x1a\x39\n\rBlockProposer\x12\x13\n\x0bproposer_id\x18\x01 \x01(\x0c\x12\x13\n\x0b\x62lock_count\x18\x02 \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\"\xe4\x10\n\x11GetStatusResponse\x12N\n\x02v0\x18\x01 \x01(\x0b\x32@.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0H\x00\x1a\xf3\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\x82\x05\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\xcc\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\x12\x12\n\nnext_epoch\x18\x05 \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\x01\n#GetTokenDirectPurchasePricesRequest\x12r\n\x02v0\x18\x01 \x01(\x0b\x32\x64.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0H\x00\x1aI\n%GetTokenDirectPurchasePricesRequestV0\x12\x11\n\ttoken_ids\x18\x01 \x03(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\x8b\t\n$GetTokenDirectPurchasePricesResponse\x12t\n\x02v0\x18\x01 \x01(\x0b\x32\x66.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0H\x00\x1a\xe1\x07\n&GetTokenDirectPurchasePricesResponseV0\x12\xa9\x01\n\x1ctoken_direct_purchase_prices\x18\x01 \x01(\x0b\x32\x80\x01.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePricesH\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\x33\n\x10PriceForQuantity\x12\x10\n\x08quantity\x18\x01 \x01(\x04\x12\r\n\x05price\x18\x02 \x01(\x04\x1a\xa7\x01\n\x0fPricingSchedule\x12\x93\x01\n\x12price_for_quantity\x18\x01 \x03(\x0b\x32w.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity\x1a\xe4\x01\n\x1dTokenDirectPurchasePriceEntry\x12\x10\n\x08token_id\x18\x01 \x01(\x0c\x12\x15\n\x0b\x66ixed_price\x18\x02 \x01(\x04H\x00\x12\x90\x01\n\x0evariable_price\x18\x03 \x01(\x0b\x32v.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingScheduleH\x00\x42\x07\n\x05price\x1a\xc8\x01\n\x19TokenDirectPurchasePrices\x12\xaa\x01\n\x1btoken_direct_purchase_price\x18\x01 \x03(\x0b\x32\x84\x01.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntryB\x08\n\x06resultB\t\n\x07version\"\xce\x01\n\x1bGetTokenContractInfoRequest\x12\x62\n\x02v0\x18\x01 \x01(\x0b\x32T.org.dash.platform.dapi.v0.GetTokenContractInfoRequest.GetTokenContractInfoRequestV0H\x00\x1a@\n\x1dGetTokenContractInfoRequestV0\x12\x10\n\x08token_id\x18\x01 \x01(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\xfb\x03\n\x1cGetTokenContractInfoResponse\x12\x64\n\x02v0\x18\x01 \x01(\x0b\x32V.org.dash.platform.dapi.v0.GetTokenContractInfoResponse.GetTokenContractInfoResponseV0H\x00\x1a\xe9\x02\n\x1eGetTokenContractInfoResponseV0\x12|\n\x04\x64\x61ta\x18\x01 \x01(\x0b\x32l.org.dash.platform.dapi.v0.GetTokenContractInfoResponse.GetTokenContractInfoResponseV0.TokenContractInfoDataH\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\x1aM\n\x15TokenContractInfoData\x12\x13\n\x0b\x63ontract_id\x18\x01 \x01(\x0c\x12\x1f\n\x17token_contract_position\x18\x02 \x01(\rB\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\"\x82\x04\n-GetTokenPerpetualDistributionLastClaimRequest\x12\x86\x01\n\x02v0\x18\x01 \x01(\x0b\x32x.org.dash.platform.dapi.v0.GetTokenPerpetualDistributionLastClaimRequest.GetTokenPerpetualDistributionLastClaimRequestV0H\x00\x1aI\n\x11\x43ontractTokenInfo\x12\x13\n\x0b\x63ontract_id\x18\x01 \x01(\x0c\x12\x1f\n\x17token_contract_position\x18\x02 \x01(\r\x1a\xf1\x01\n/GetTokenPerpetualDistributionLastClaimRequestV0\x12\x10\n\x08token_id\x18\x01 \x01(\x0c\x12v\n\rcontract_info\x18\x02 \x01(\x0b\x32Z.org.dash.platform.dapi.v0.GetTokenPerpetualDistributionLastClaimRequest.ContractTokenInfoH\x00\x88\x01\x01\x12\x13\n\x0bidentity_id\x18\x04 \x01(\x0c\x12\r\n\x05prove\x18\x05 \x01(\x08\x42\x10\n\x0e_contract_infoB\t\n\x07version\"\x93\x05\n.GetTokenPerpetualDistributionLastClaimResponse\x12\x88\x01\n\x02v0\x18\x01 \x01(\x0b\x32z.org.dash.platform.dapi.v0.GetTokenPerpetualDistributionLastClaimResponse.GetTokenPerpetualDistributionLastClaimResponseV0H\x00\x1a\xca\x03\n0GetTokenPerpetualDistributionLastClaimResponseV0\x12\x9f\x01\n\nlast_claim\x18\x01 \x01(\x0b\x32\x88\x01.org.dash.platform.dapi.v0.GetTokenPerpetualDistributionLastClaimResponse.GetTokenPerpetualDistributionLastClaimResponseV0.LastClaimInfoH\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\rLastClaimInfo\x12\x1a\n\x0ctimestamp_ms\x18\x01 \x01(\x04\x42\x02\x30\x01H\x00\x12\x1a\n\x0c\x62lock_height\x18\x02 \x01(\x04\x42\x02\x30\x01H\x00\x12\x0f\n\x05\x65poch\x18\x03 \x01(\rH\x00\x12\x13\n\traw_bytes\x18\x04 \x01(\x0cH\x00\x42\t\n\x07paid_atB\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\"\x92\"\n\x17GetGroupActionsResponse\x12Z\n\x02v0\x18\x01 \x01(\x0b\x32L.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0H\x00\x1a\x8f!\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[\n\tBurnEvent\x12\x0e\n\x06\x61mount\x18\x01 \x01(\x04\x12\x14\n\x0c\x62urn_from_id\x18\x02 \x01(\x0c\x12\x18\n\x0bpublic_note\x18\x03 \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\xe6\x03\n\x1eUpdateDirectPurchasePriceEvent\x12\x15\n\x0b\x66ixed_price\x18\x01 \x01(\x04H\x00\x12\x95\x01\n\x0evariable_price\x18\x02 \x01(\x0b\x32{.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingScheduleH\x00\x12\x18\n\x0bpublic_note\x18\x03 \x01(\tH\x01\x88\x01\x01\x1a\x33\n\x10PriceForQuantity\x12\x10\n\x08quantity\x18\x01 \x01(\x04\x12\r\n\x05price\x18\x02 \x01(\x04\x1a\xac\x01\n\x0fPricingSchedule\x12\x98\x01\n\x12price_for_quantity\x18\x01 \x03(\x0b\x32|.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantityB\x07\n\x05priceB\x0e\n\x0c_public_note\x1a\x63\n\x0fMintToPoolEvent\x12\x0e\n\x06\x61mount\x18\x01 \x01(\x04\x12\x16\n\x0e\x61\x63tions_digest\x18\x02 \x01(\x0c\x12\x18\n\x0bpublic_note\x18\x03 \x01(\tH\x00\x88\x01\x01\x42\x0e\n\x0c_public_note\x1a\x65\n\x11\x42urnFromPoolEvent\x12\x0e\n\x06\x61mount\x18\x01 \x01(\x04\x12\x16\n\x0e\x61\x63tions_digest\x18\x02 \x01(\x0c\x12\x18\n\x0bpublic_note\x18\x03 \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\xc1\t\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\x12\x83\x01\n\x0cupdate_price\x18\x08 \x01(\x0b\x32k.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEventH\x00\x12t\n\x0cmint_to_pool\x18\t \x01(\x0b\x32\\.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintToPoolEventH\x00\x12x\n\x0e\x62urn_from_pool\x18\n \x01(\x0b\x32^.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnFromPoolEventH\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\"\xb5\x01\n\x15GetAddressInfoRequest\x12V\n\x02v0\x18\x01 \x01(\x0b\x32H.org.dash.platform.dapi.v0.GetAddressInfoRequest.GetAddressInfoRequestV0H\x00\x1a\x39\n\x17GetAddressInfoRequestV0\x12\x0f\n\x07\x61\x64\x64ress\x18\x01 \x01(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\x85\x01\n\x10\x41\x64\x64ressInfoEntry\x12\x0f\n\x07\x61\x64\x64ress\x18\x01 \x01(\x0c\x12J\n\x11\x62\x61lance_and_nonce\x18\x02 \x01(\x0b\x32*.org.dash.platform.dapi.v0.BalanceAndNonceH\x00\x88\x01\x01\x42\x14\n\x12_balance_and_nonce\"1\n\x0f\x42\x61lanceAndNonce\x12\x0f\n\x07\x62\x61lance\x18\x01 \x01(\x04\x12\r\n\x05nonce\x18\x02 \x01(\r\"_\n\x12\x41\x64\x64ressInfoEntries\x12I\n\x14\x61\x64\x64ress_info_entries\x18\x01 \x03(\x0b\x32+.org.dash.platform.dapi.v0.AddressInfoEntry\"m\n\x14\x41\x64\x64ressBalanceChange\x12\x0f\n\x07\x61\x64\x64ress\x18\x01 \x01(\x0c\x12\x19\n\x0bset_balance\x18\x02 \x01(\x04\x42\x02\x30\x01H\x00\x12\x1c\n\x0e\x61\x64\x64_to_balance\x18\x03 \x01(\x04\x42\x02\x30\x01H\x00\x42\x0b\n\toperation\"x\n\x1a\x42lockAddressBalanceChanges\x12\x18\n\x0c\x62lock_height\x18\x01 \x01(\x04\x42\x02\x30\x01\x12@\n\x07\x63hanges\x18\x02 \x03(\x0b\x32/.org.dash.platform.dapi.v0.AddressBalanceChange\"k\n\x1b\x41\x64\x64ressBalanceUpdateEntries\x12L\n\rblock_changes\x18\x01 \x03(\x0b\x32\x35.org.dash.platform.dapi.v0.BlockAddressBalanceChanges\"\xe1\x02\n\x16GetAddressInfoResponse\x12X\n\x02v0\x18\x01 \x01(\x0b\x32J.org.dash.platform.dapi.v0.GetAddressInfoResponse.GetAddressInfoResponseV0H\x00\x1a\xe1\x01\n\x18GetAddressInfoResponseV0\x12I\n\x12\x61\x64\x64ress_info_entry\x18\x01 \x01(\x0b\x32+.org.dash.platform.dapi.v0.AddressInfoEntryH\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\"\xc3\x01\n\x18GetAddressesInfosRequest\x12\\\n\x02v0\x18\x01 \x01(\x0b\x32N.org.dash.platform.dapi.v0.GetAddressesInfosRequest.GetAddressesInfosRequestV0H\x00\x1a>\n\x1aGetAddressesInfosRequestV0\x12\x11\n\taddresses\x18\x01 \x03(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\xf1\x02\n\x19GetAddressesInfosResponse\x12^\n\x02v0\x18\x01 \x01(\x0b\x32P.org.dash.platform.dapi.v0.GetAddressesInfosResponse.GetAddressesInfosResponseV0H\x00\x1a\xe8\x01\n\x1bGetAddressesInfosResponseV0\x12M\n\x14\x61\x64\x64ress_info_entries\x18\x01 \x01(\x0b\x32-.org.dash.platform.dapi.v0.AddressInfoEntriesH\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\"\xb5\x01\n\x1dGetAddressesTrunkStateRequest\x12\x66\n\x02v0\x18\x01 \x01(\x0b\x32X.org.dash.platform.dapi.v0.GetAddressesTrunkStateRequest.GetAddressesTrunkStateRequestV0H\x00\x1a!\n\x1fGetAddressesTrunkStateRequestV0B\t\n\x07version\"\xaa\x02\n\x1eGetAddressesTrunkStateResponse\x12h\n\x02v0\x18\x01 \x01(\x0b\x32Z.org.dash.platform.dapi.v0.GetAddressesTrunkStateResponse.GetAddressesTrunkStateResponseV0H\x00\x1a\x92\x01\n GetAddressesTrunkStateResponseV0\x12/\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.Proof\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadataB\t\n\x07version\"\xf0\x01\n\x1eGetAddressesBranchStateRequest\x12h\n\x02v0\x18\x01 \x01(\x0b\x32Z.org.dash.platform.dapi.v0.GetAddressesBranchStateRequest.GetAddressesBranchStateRequestV0H\x00\x1aY\n GetAddressesBranchStateRequestV0\x12\x0b\n\x03key\x18\x01 \x01(\x0c\x12\r\n\x05\x64\x65pth\x18\x02 \x01(\r\x12\x19\n\x11\x63heckpoint_height\x18\x03 \x01(\x04\x42\t\n\x07version\"\xd1\x01\n\x1fGetAddressesBranchStateResponse\x12j\n\x02v0\x18\x01 \x01(\x0b\x32\\.org.dash.platform.dapi.v0.GetAddressesBranchStateResponse.GetAddressesBranchStateResponseV0H\x00\x1a\x37\n!GetAddressesBranchStateResponseV0\x12\x12\n\nmerk_proof\x18\x02 \x01(\x0c\x42\t\n\x07version\"\x9e\x02\n%GetRecentAddressBalanceChangesRequest\x12v\n\x02v0\x18\x01 \x01(\x0b\x32h.org.dash.platform.dapi.v0.GetRecentAddressBalanceChangesRequest.GetRecentAddressBalanceChangesRequestV0H\x00\x1ar\n\'GetRecentAddressBalanceChangesRequestV0\x12\x18\n\x0cstart_height\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\r\n\x05prove\x18\x02 \x01(\x08\x12\x1e\n\x16start_height_exclusive\x18\x03 \x01(\x08\x42\t\n\x07version\"\xb8\x03\n&GetRecentAddressBalanceChangesResponse\x12x\n\x02v0\x18\x01 \x01(\x0b\x32j.org.dash.platform.dapi.v0.GetRecentAddressBalanceChangesResponse.GetRecentAddressBalanceChangesResponseV0H\x00\x1a\x88\x02\n(GetRecentAddressBalanceChangesResponseV0\x12`\n\x1e\x61\x64\x64ress_balance_update_entries\x18\x01 \x01(\x0b\x32\x36.org.dash.platform.dapi.v0.AddressBalanceUpdateEntriesH\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\"G\n\x16\x42lockHeightCreditEntry\x12\x18\n\x0c\x62lock_height\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\x13\n\x07\x63redits\x18\x02 \x01(\x04\x42\x02\x30\x01\"\xb0\x01\n\x1d\x43ompactedAddressBalanceChange\x12\x0f\n\x07\x61\x64\x64ress\x18\x01 \x01(\x0c\x12\x19\n\x0bset_credits\x18\x02 \x01(\x04\x42\x02\x30\x01H\x00\x12V\n\x19\x61\x64\x64_to_credits_operations\x18\x03 \x01(\x0b\x32\x31.org.dash.platform.dapi.v0.AddToCreditsOperationsH\x00\x42\x0b\n\toperation\"\\\n\x16\x41\x64\x64ToCreditsOperations\x12\x42\n\x07\x65ntries\x18\x01 \x03(\x0b\x32\x31.org.dash.platform.dapi.v0.BlockHeightCreditEntry\"\xae\x01\n#CompactedBlockAddressBalanceChanges\x12\x1e\n\x12start_block_height\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\x1c\n\x10\x65nd_block_height\x18\x02 \x01(\x04\x42\x02\x30\x01\x12I\n\x07\x63hanges\x18\x03 \x03(\x0b\x32\x38.org.dash.platform.dapi.v0.CompactedAddressBalanceChange\"\x87\x01\n$CompactedAddressBalanceUpdateEntries\x12_\n\x17\x63ompacted_block_changes\x18\x01 \x03(\x0b\x32>.org.dash.platform.dapi.v0.CompactedBlockAddressBalanceChanges\"\xa9\x02\n.GetRecentCompactedAddressBalanceChangesRequest\x12\x88\x01\n\x02v0\x18\x01 \x01(\x0b\x32z.org.dash.platform.dapi.v0.GetRecentCompactedAddressBalanceChangesRequest.GetRecentCompactedAddressBalanceChangesRequestV0H\x00\x1a\x61\n0GetRecentCompactedAddressBalanceChangesRequestV0\x12\x1e\n\x12start_block_height\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\xf0\x03\n/GetRecentCompactedAddressBalanceChangesResponse\x12\x8a\x01\n\x02v0\x18\x01 \x01(\x0b\x32|.org.dash.platform.dapi.v0.GetRecentCompactedAddressBalanceChangesResponse.GetRecentCompactedAddressBalanceChangesResponseV0H\x00\x1a\xa4\x02\n1GetRecentCompactedAddressBalanceChangesResponseV0\x12s\n(compacted_address_balance_update_entries\x18\x01 \x01(\x0b\x32?.org.dash.platform.dapi.v0.CompactedAddressBalanceUpdateEntriesH\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\"\x98\x02\n GetShieldedEncryptedNotesRequest\x12l\n\x02v0\x18\x01 \x01(\x0b\x32^.org.dash.platform.dapi.v0.GetShieldedEncryptedNotesRequest.GetShieldedEncryptedNotesRequestV0H\x00\x1a{\n\"GetShieldedEncryptedNotesRequestV0\x12\x13\n\x0bstart_index\x18\x01 \x01(\x04\x12\r\n\x05\x63ount\x18\x02 \x01(\r\x12\r\n\x05prove\x18\x03 \x01(\x08\x12\x15\n\x08token_id\x18\x04 \x01(\x0cH\x00\x88\x01\x01\x42\x0b\n\t_token_idB\t\n\x07version\"\xbc\x05\n!GetShieldedEncryptedNotesResponse\x12n\n\x02v0\x18\x01 \x01(\x0b\x32`.org.dash.platform.dapi.v0.GetShieldedEncryptedNotesResponse.GetShieldedEncryptedNotesResponseV0H\x00\x1a\x9b\x04\n#GetShieldedEncryptedNotesResponseV0\x12\x8a\x01\n\x0f\x65ncrypted_notes\x18\x01 \x01(\x0b\x32o.org.dash.platform.dapi.v0.GetShieldedEncryptedNotesResponse.GetShieldedEncryptedNotesResponseV0.EncryptedNotesH\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\x1aW\n\rEncryptedNote\x12\x11\n\tnullifier\x18\x01 \x01(\x0c\x12\x0b\n\x03\x63mx\x18\x02 \x01(\x0c\x12\x16\n\x0e\x65ncrypted_note\x18\x03 \x01(\x0c\x12\x0e\n\x06\x63v_net\x18\x04 \x01(\x0c\x1a\x91\x01\n\x0e\x45ncryptedNotes\x12\x7f\n\x07\x65ntries\x18\x01 \x03(\x0b\x32n.org.dash.platform.dapi.v0.GetShieldedEncryptedNotesResponse.GetShieldedEncryptedNotesResponseV0.EncryptedNoteB\x08\n\x06resultB\t\n\x07version\"\xd8\x01\n\x19GetShieldedAnchorsRequest\x12^\n\x02v0\x18\x01 \x01(\x0b\x32P.org.dash.platform.dapi.v0.GetShieldedAnchorsRequest.GetShieldedAnchorsRequestV0H\x00\x1aP\n\x1bGetShieldedAnchorsRequestV0\x12\r\n\x05prove\x18\x01 \x01(\x08\x12\x15\n\x08token_id\x18\x02 \x01(\x0cH\x00\x88\x01\x01\x42\x0b\n\t_token_idB\t\n\x07version\"\xb1\x03\n\x1aGetShieldedAnchorsResponse\x12`\n\x02v0\x18\x01 \x01(\x0b\x32R.org.dash.platform.dapi.v0.GetShieldedAnchorsResponse.GetShieldedAnchorsResponseV0H\x00\x1a\xa5\x02\n\x1cGetShieldedAnchorsResponseV0\x12m\n\x07\x61nchors\x18\x01 \x01(\x0b\x32Z.org.dash.platform.dapi.v0.GetShieldedAnchorsResponse.GetShieldedAnchorsResponseV0.AnchorsH\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\x07\x41nchors\x12\x0f\n\x07\x61nchors\x18\x01 \x03(\x0c\x42\x08\n\x06resultB\t\n\x07version\"\xfc\x01\n\"GetMostRecentShieldedAnchorRequest\x12p\n\x02v0\x18\x01 \x01(\x0b\x32\x62.org.dash.platform.dapi.v0.GetMostRecentShieldedAnchorRequest.GetMostRecentShieldedAnchorRequestV0H\x00\x1aY\n$GetMostRecentShieldedAnchorRequestV0\x12\r\n\x05prove\x18\x01 \x01(\x08\x12\x15\n\x08token_id\x18\x02 \x01(\x0cH\x00\x88\x01\x01\x42\x0b\n\t_token_idB\t\n\x07version\"\xdc\x02\n#GetMostRecentShieldedAnchorResponse\x12r\n\x02v0\x18\x01 \x01(\x0b\x32\x64.org.dash.platform.dapi.v0.GetMostRecentShieldedAnchorResponse.GetMostRecentShieldedAnchorResponseV0H\x00\x1a\xb5\x01\n%GetMostRecentShieldedAnchorResponseV0\x12\x10\n\x06\x61nchor\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\"\xe0\x01\n\x1bGetShieldedPoolStateRequest\x12\x62\n\x02v0\x18\x01 \x01(\x0b\x32T.org.dash.platform.dapi.v0.GetShieldedPoolStateRequest.GetShieldedPoolStateRequestV0H\x00\x1aR\n\x1dGetShieldedPoolStateRequestV0\x12\r\n\x05prove\x18\x01 \x01(\x08\x12\x15\n\x08token_id\x18\x02 \x01(\x0cH\x00\x88\x01\x01\x42\x0b\n\t_token_idB\t\n\x07version\"\xcb\x02\n\x1cGetShieldedPoolStateResponse\x12\x64\n\x02v0\x18\x01 \x01(\x0b\x32V.org.dash.platform.dapi.v0.GetShieldedPoolStateResponse.GetShieldedPoolStateResponseV0H\x00\x1a\xb9\x01\n\x1eGetShieldedPoolStateResponseV0\x12\x1b\n\rtotal_balance\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\"\xe4\x01\n\x1cGetShieldedNotesCountRequest\x12\x64\n\x02v0\x18\x01 \x01(\x0b\x32V.org.dash.platform.dapi.v0.GetShieldedNotesCountRequest.GetShieldedNotesCountRequestV0H\x00\x1aS\n\x1eGetShieldedNotesCountRequestV0\x12\r\n\x05prove\x18\x01 \x01(\x08\x12\x15\n\x08token_id\x18\x02 \x01(\x0cH\x00\x88\x01\x01\x42\x0b\n\t_token_idB\t\n\x07version\"\xd3\x02\n\x1dGetShieldedNotesCountResponse\x12\x66\n\x02v0\x18\x01 \x01(\x0b\x32X.org.dash.platform.dapi.v0.GetShieldedNotesCountResponse.GetShieldedNotesCountResponseV0H\x00\x1a\xbe\x01\n\x1fGetShieldedNotesCountResponseV0\x12\x1f\n\x11total_notes_count\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\"\xf8\x01\n\x1cGetShieldedNullifiersRequest\x12\x64\n\x02v0\x18\x01 \x01(\x0b\x32V.org.dash.platform.dapi.v0.GetShieldedNullifiersRequest.GetShieldedNullifiersRequestV0H\x00\x1ag\n\x1eGetShieldedNullifiersRequestV0\x12\x12\n\nnullifiers\x18\x01 \x03(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\x12\x15\n\x08token_id\x18\x03 \x01(\x0cH\x00\x88\x01\x01\x42\x0b\n\t_token_idB\t\n\x07version\"\x86\x05\n\x1dGetShieldedNullifiersResponse\x12\x66\n\x02v0\x18\x01 \x01(\x0b\x32X.org.dash.platform.dapi.v0.GetShieldedNullifiersResponse.GetShieldedNullifiersResponseV0H\x00\x1a\xf1\x03\n\x1fGetShieldedNullifiersResponseV0\x12\x88\x01\n\x12nullifier_statuses\x18\x01 \x01(\x0b\x32j.org.dash.platform.dapi.v0.GetShieldedNullifiersResponse.GetShieldedNullifiersResponseV0.NullifierStatusesH\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\x36\n\x0fNullifierStatus\x12\x11\n\tnullifier\x18\x01 \x01(\x0c\x12\x10\n\x08is_spent\x18\x02 \x01(\x08\x1a\x8e\x01\n\x11NullifierStatuses\x12y\n\x07\x65ntries\x18\x01 \x03(\x0b\x32h.org.dash.platform.dapi.v0.GetShieldedNullifiersResponse.GetShieldedNullifiersResponseV0.NullifierStatusB\x08\n\x06resultB\t\n\x07version\"\xba\r\n\"SubscribeToStateTransitionsRequest\x12p\n\x02v0\x18\x01 \x01(\x0b\x32\x62.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0H\x00\x1a\xc2\x07\n\x0e\x44ocumentFilter\x12\x18\n\x10\x64\x61ta_contract_id\x18\x01 \x01(\x0c\x12\x1f\n\x12\x64ocument_type_name\x18\x02 \x01(\tH\x00\x88\x01\x01\x12i\n\x07\x61\x63tions\x18\x03 \x03(\x0b\x32X.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch\x12\x1b\n\x0e\x62\x61tch_owner_id\x18\x04 \x01(\x0cH\x01\x88\x01\x01\x1a\xaf\x01\n\x0bPriceClause\x12N\n\x08operator\x18\x01 \x01(\x0e\x32<.org.dash.platform.dapi.v0.GetDocumentsRequest.WhereOperator\x12P\n\x05value\x18\x02 \x01(\x0b\x32\x41.org.dash.platform.dapi.v0.GetDocumentsRequest.DocumentFieldValue\x1a\xb3\x03\n\x0b\x41\x63tionMatch\x12h\n\x06\x61\x63tion\x18\x01 \x01(\x0e\x32S.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionH\x00\x88\x01\x01\x12V\n\x12new_document_where\x18\x02 \x03(\x0b\x32:.org.dash.platform.dapi.v0.GetDocumentsRequest.WhereClause\x12[\n\x17original_document_where\x18\x03 \x03(\x0b\x32:.org.dash.platform.dapi.v0.GetDocumentsRequest.WhereClause\x12\x11\n\towner_ids\x18\x04 \x03(\x0c\x12g\n\x05price\x18\x05 \x01(\x0b\x32X.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.PriceClauseB\t\n\x07_action\"[\n\x06\x41\x63tion\x12\n\n\x06\x43REATE\x10\x00\x12\x0b\n\x07REPLACE\x10\x01\x12\n\n\x06\x44\x45LETE\x10\x02\x12\x0c\n\x08TRANSFER\x10\x03\x12\x10\n\x0cUPDATE_PRICE\x10\x04\x12\x0c\n\x08PURCHASE\x10\x05\x42\x15\n\x13_document_type_nameB\x11\n\x0f_batch_owner_id\x1at\n\rAddressFilter\x12\x11\n\taddresses\x18\x01 \x03(\x0c\x12P\n\x04role\x18\x02 \x01(\x0e\x32\x42.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.Role\x1a\xe6\x01\n\x15StateTransitionFilter\x12\x61\n\tdocuments\x18\x01 \x01(\x0b\x32L.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilterH\x00\x12`\n\taddresses\x18\x02 \x01(\x0b\x32K.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.AddressFilterH\x00\x42\x08\n\x06\x66ilter\x1a\xc6\x01\n$SubscribeToStateTransitionsRequestV0\x12\x64\n\x07\x66ilters\x18\x01 \x03(\x0b\x32S.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter\x12\"\n\x11\x66rom_block_height\x18\x02 \x01(\x04\x42\x02\x30\x01H\x00\x88\x01\x01\x42\x14\n\x12_from_block_height\"*\n\x04Role\x12\x07\n\x03\x41NY\x10\x00\x12\n\n\x06SENDER\x10\x01\x12\r\n\tRECIPIENT\x10\x02\x42\t\n\x07version\"\xfe\x05\n#SubscribeToStateTransitionsResponse\x12r\n\x02v0\x18\x01 \x01(\x0b\x32\x64.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0H\x00\x1a\xd7\x04\n%SubscribeToStateTransitionsResponseV0\x12\x95\x01\n\x10state_transition\x18\x01 \x01(\x0b\x32y.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatchH\x00\x12\x85\x01\n\ncheckpoint\x18\x02 \x01(\x0b\x32o.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.CheckpointH\x00\x1a\xd8\x01\n\x14StateTransitionMatch\x12\x18\n\x0c\x62lock_height\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\x19\n\rblock_time_ms\x18\x02 \x01(\x04\x42\x02\x30\x01\x12\x18\n\x10protocol_version\x18\x03 \x01(\r\x12\x1d\n\x15state_transition_hash\x18\x04 \x01(\x0c\x12\x18\n\x10state_transition\x18\x05 \x01(\x0c\x12\x17\n\x0fmatched_filters\x18\x06 \x03(\r\x12\x1f\n\x17matched_batch_positions\x18\x07 \x03(\r\x1a&\n\nCheckpoint\x12\x18\n\x0c\x62lock_height\x18\x01 \x01(\x04\x42\x02\x30\x01\x42\x0b\n\tresponsesB\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*\xb9\x01\n\x16\x43ontractModerationList\x12(\n$CONTRACT_MODERATION_LIST_UNSPECIFIED\x10\x00\x12$\n CONTRACT_MODERATION_LIST_BANLIST\x10\x01\x12(\n$CONTRACT_MODERATION_LIST_SUSPENSIONS\x10\x02\x12%\n!CONTRACT_MODERATION_LIST_WARNINGS\x10\x03\x32\xd4U\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\xa8\x01\n\x1fgetIdentityKeysRemainingBudgets\x12\x41.org.dash.platform.dapi.v0.GetIdentityKeysRemainingBudgetsRequest\x1a\x42.org.dash.platform.dapi.v0.GetIdentityKeysRemainingBudgetsResponse\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\xa5\x01\n\x1egetDataContractsLatestVersions\x12@.org.dash.platform.dapi.v0.GetDataContractsLatestVersionsRequest\x1a\x41.org.dash.platform.dapi.v0.GetDataContractsLatestVersionsResponse\x12{\n\x10getDataContracts\x12\x32.org.dash.platform.dapi.v0.GetDataContractsRequest\x1a\x33.org.dash.platform.dapi.v0.GetDataContractsResponse\x12\x89\x01\n\x17getDataContractsByRange\x12\x39.org.dash.platform.dapi.v0.GetDataContractsByRangeRequest\x1a\x33.org.dash.platform.dapi.v0.GetDataContractsResponse\x12\x87\x01\n\x14getContractGroupInfo\x12\x36.org.dash.platform.dapi.v0.GetContractGroupInfoRequest\x1a\x37.org.dash.platform.dapi.v0.GetContractGroupInfoResponse\x12\x90\x01\n\x17getContractGroupMembers\x12\x39.org.dash.platform.dapi.v0.GetContractGroupMembersRequest\x1a:.org.dash.platform.dapi.v0.GetContractGroupMembersResponse\x12\x9f\x01\n\x1cgetContractGroupsForContract\x12>.org.dash.platform.dapi.v0.GetContractGroupsForContractRequest\x1a?.org.dash.platform.dapi.v0.GetContractGroupsForContractResponse\x12\x9c\x01\n\x1bgetContractModerationStatus\x12=.org.dash.platform.dapi.v0.GetContractModerationStatusRequest\x1a>.org.dash.platform.dapi.v0.GetContractModerationStatusResponse\x12\x9f\x01\n\x1cgetContractModerationEntries\x12>.org.dash.platform.dapi.v0.GetContractModerationEntriesRequest\x1a?.org.dash.platform.dapi.v0.GetContractModerationEntriesResponse\x12\x9c\x01\n\x1bgetContractDocumentRemovals\x12=.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest\x1a>.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse\x12\x8d\x01\n\x16getContractTeamActions\x12\x38.org.dash.platform.dapi.v0.GetContractTeamActionsRequest\x1a\x39.org.dash.platform.dapi.v0.GetContractTeamActionsResponse\x12\x9f\x01\n\x1cgetContractTeamActionSigners\x12>.org.dash.platform.dapi.v0.GetContractTeamActionSignersRequest\x1a?.org.dash.platform.dapi.v0.GetContractTeamActionSignersResponse\x12\xae\x01\n!getContractModerationActionCounts\x12\x43.org.dash.platform.dapi.v0.GetContractModerationActionCountsRequest\x1a\x44.org.dash.platform.dapi.v0.GetContractModerationActionCountsResponse\x12\x81\x01\n\x12getContractFeePots\x12\x34.org.dash.platform.dapi.v0.GetContractFeePotsRequest\x1a\x35.org.dash.platform.dapi.v0.GetContractFeePotsResponse\x12\x81\x01\n\x12getDocumentHistory\x12\x34.org.dash.platform.dapi.v0.GetDocumentHistoryRequest\x1a\x35.org.dash.platform.dapi.v0.GetDocumentHistoryResponse\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\xb4\x01\n#getIdentityByNonUniquePublicKeyHash\x12\x45.org.dash.platform.dapi.v0.GetIdentityByNonUniquePublicKeyHashRequest\x1a\x46.org.dash.platform.dapi.v0.GetIdentityByNonUniquePublicKeyHashResponse\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\x8d\x01\n\x16getFinalizedEpochInfos\x12\x38.org.dash.platform.dapi.v0.GetFinalizedEpochInfosRequest\x1a\x39.org.dash.platform.dapi.v0.GetFinalizedEpochInfosResponse\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\x9f\x01\n\x1cgetTokenDirectPurchasePrices\x12>.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest\x1a?.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse\x12\x87\x01\n\x14getTokenContractInfo\x12\x36.org.dash.platform.dapi.v0.GetTokenContractInfoRequest\x1a\x37.org.dash.platform.dapi.v0.GetTokenContractInfoResponse\x12\xb1\x01\n\"getTokenPreProgrammedDistributions\x12\x44.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest\x1a\x45.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse\x12\xbd\x01\n&getTokenPerpetualDistributionLastClaim\x12H.org.dash.platform.dapi.v0.GetTokenPerpetualDistributionLastClaimRequest\x1aI.org.dash.platform.dapi.v0.GetTokenPerpetualDistributionLastClaimResponse\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.GetGroupActionSignersResponse\x12u\n\x0egetAddressInfo\x12\x30.org.dash.platform.dapi.v0.GetAddressInfoRequest\x1a\x31.org.dash.platform.dapi.v0.GetAddressInfoResponse\x12~\n\x11getAddressesInfos\x12\x33.org.dash.platform.dapi.v0.GetAddressesInfosRequest\x1a\x34.org.dash.platform.dapi.v0.GetAddressesInfosResponse\x12\x8d\x01\n\x16getAddressesTrunkState\x12\x38.org.dash.platform.dapi.v0.GetAddressesTrunkStateRequest\x1a\x39.org.dash.platform.dapi.v0.GetAddressesTrunkStateResponse\x12\x90\x01\n\x17getAddressesBranchState\x12\x39.org.dash.platform.dapi.v0.GetAddressesBranchStateRequest\x1a:.org.dash.platform.dapi.v0.GetAddressesBranchStateResponse\x12\xa5\x01\n\x1egetRecentAddressBalanceChanges\x12@.org.dash.platform.dapi.v0.GetRecentAddressBalanceChangesRequest\x1a\x41.org.dash.platform.dapi.v0.GetRecentAddressBalanceChangesResponse\x12\xc0\x01\n\'getRecentCompactedAddressBalanceChanges\x12I.org.dash.platform.dapi.v0.GetRecentCompactedAddressBalanceChangesRequest\x1aJ.org.dash.platform.dapi.v0.GetRecentCompactedAddressBalanceChangesResponse\x12\x96\x01\n\x19getShieldedEncryptedNotes\x12;.org.dash.platform.dapi.v0.GetShieldedEncryptedNotesRequest\x1a<.org.dash.platform.dapi.v0.GetShieldedEncryptedNotesResponse\x12\x81\x01\n\x12getShieldedAnchors\x12\x34.org.dash.platform.dapi.v0.GetShieldedAnchorsRequest\x1a\x35.org.dash.platform.dapi.v0.GetShieldedAnchorsResponse\x12\x9c\x01\n\x1bgetMostRecentShieldedAnchor\x12=.org.dash.platform.dapi.v0.GetMostRecentShieldedAnchorRequest\x1a>.org.dash.platform.dapi.v0.GetMostRecentShieldedAnchorResponse\x12\x87\x01\n\x14getShieldedPoolState\x12\x36.org.dash.platform.dapi.v0.GetShieldedPoolStateRequest\x1a\x37.org.dash.platform.dapi.v0.GetShieldedPoolStateResponse\x12\x8a\x01\n\x15getShieldedNotesCount\x12\x37.org.dash.platform.dapi.v0.GetShieldedNotesCountRequest\x1a\x38.org.dash.platform.dapi.v0.GetShieldedNotesCountResponse\x12\x8a\x01\n\x15getShieldedNullifiers\x12\x37.org.dash.platform.dapi.v0.GetShieldedNullifiersRequest\x1a\x38.org.dash.platform.dapi.v0.GetShieldedNullifiersResponse\x12\x9e\x01\n\x1bsubscribeToStateTransitions\x12=.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest\x1a>.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse0\x01\x62\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=84048, - serialized_end=84138, + serialized_start=86542, + serialized_end=86632, ) _sym_db.RegisterEnumDescriptor(_KEYPURPOSE) @@ -98,8 +98,8 @@ ], containing_type=None, serialized_options=None, - serialized_start=84141, - serialized_end=84326, + serialized_start=86635, + serialized_end=86820, ) _sym_db.RegisterEnumDescriptor(_CONTRACTMODERATIONLIST) @@ -645,6 +645,81 @@ ) _sym_db.RegisterEnumDescriptor(_GETGROUPACTIONSIGNERSREQUEST_ACTIONSTATUS) +_SUBSCRIBETOSTATETRANSITIONSREQUEST_DOCUMENTFILTER_ACTION = _descriptor.EnumDescriptor( + name='Action', + full_name='org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.Action', + filename=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + values=[ + _descriptor.EnumValueDescriptor( + name='CREATE', index=0, number=0, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='REPLACE', index=1, number=1, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='DELETE', index=2, number=2, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='TRANSFER', index=3, number=3, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='UPDATE_PRICE', index=4, number=4, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='PURCHASE', index=5, number=5, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + ], + containing_type=None, + serialized_options=None, + serialized_start=85031, + serialized_end=85122, +) +_sym_db.RegisterEnumDescriptor(_SUBSCRIBETOSTATETRANSITIONSREQUEST_DOCUMENTFILTER_ACTION) + +_SUBSCRIBETOSTATETRANSITIONSREQUEST_ROLE = _descriptor.EnumDescriptor( + name='Role', + full_name='org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.Role', + filename=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + values=[ + _descriptor.EnumValueDescriptor( + name='ANY', index=0, number=0, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='SENDER', index=1, number=1, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='RECIPIENT', index=2, number=2, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + ], + containing_type=None, + serialized_options=None, + serialized_start=85718, + serialized_end=85760, +) +_sym_db.RegisterEnumDescriptor(_SUBSCRIBETOSTATETRANSITIONSREQUEST_ROLE) + _PROOF = _descriptor.Descriptor( name='Proof', @@ -22199,207 +22274,718 @@ serialized_end=84046, ) -_GETIDENTITYREQUEST_GETIDENTITYREQUESTV0.containing_type = _GETIDENTITYREQUEST -_GETIDENTITYREQUEST.fields_by_name['v0'].message_type = _GETIDENTITYREQUEST_GETIDENTITYREQUESTV0 -_GETIDENTITYREQUEST.oneofs_by_name['version'].fields.append( - _GETIDENTITYREQUEST.fields_by_name['v0']) -_GETIDENTITYREQUEST.fields_by_name['v0'].containing_oneof = _GETIDENTITYREQUEST.oneofs_by_name['version'] -_GETIDENTITYNONCEREQUEST_GETIDENTITYNONCEREQUESTV0.containing_type = _GETIDENTITYNONCEREQUEST -_GETIDENTITYNONCEREQUEST.fields_by_name['v0'].message_type = _GETIDENTITYNONCEREQUEST_GETIDENTITYNONCEREQUESTV0 -_GETIDENTITYNONCEREQUEST.oneofs_by_name['version'].fields.append( - _GETIDENTITYNONCEREQUEST.fields_by_name['v0']) -_GETIDENTITYNONCEREQUEST.fields_by_name['v0'].containing_oneof = _GETIDENTITYNONCEREQUEST.oneofs_by_name['version'] -_GETIDENTITYCONTRACTNONCEREQUEST_GETIDENTITYCONTRACTNONCEREQUESTV0.containing_type = _GETIDENTITYCONTRACTNONCEREQUEST -_GETIDENTITYCONTRACTNONCEREQUEST.fields_by_name['v0'].message_type = _GETIDENTITYCONTRACTNONCEREQUEST_GETIDENTITYCONTRACTNONCEREQUESTV0 -_GETIDENTITYCONTRACTNONCEREQUEST.oneofs_by_name['version'].fields.append( - _GETIDENTITYCONTRACTNONCEREQUEST.fields_by_name['v0']) -_GETIDENTITYCONTRACTNONCEREQUEST.fields_by_name['v0'].containing_oneof = _GETIDENTITYCONTRACTNONCEREQUEST.oneofs_by_name['version'] -_GETIDENTITYBALANCEREQUEST_GETIDENTITYBALANCEREQUESTV0.containing_type = _GETIDENTITYBALANCEREQUEST -_GETIDENTITYBALANCEREQUEST.fields_by_name['v0'].message_type = _GETIDENTITYBALANCEREQUEST_GETIDENTITYBALANCEREQUESTV0 -_GETIDENTITYBALANCEREQUEST.oneofs_by_name['version'].fields.append( - _GETIDENTITYBALANCEREQUEST.fields_by_name['v0']) -_GETIDENTITYBALANCEREQUEST.fields_by_name['v0'].containing_oneof = _GETIDENTITYBALANCEREQUEST.oneofs_by_name['version'] -_GETIDENTITYBALANCEANDREVISIONREQUEST_GETIDENTITYBALANCEANDREVISIONREQUESTV0.containing_type = _GETIDENTITYBALANCEANDREVISIONREQUEST -_GETIDENTITYBALANCEANDREVISIONREQUEST.fields_by_name['v0'].message_type = _GETIDENTITYBALANCEANDREVISIONREQUEST_GETIDENTITYBALANCEANDREVISIONREQUESTV0 -_GETIDENTITYBALANCEANDREVISIONREQUEST.oneofs_by_name['version'].fields.append( - _GETIDENTITYBALANCEANDREVISIONREQUEST.fields_by_name['v0']) -_GETIDENTITYBALANCEANDREVISIONREQUEST.fields_by_name['v0'].containing_oneof = _GETIDENTITYBALANCEANDREVISIONREQUEST.oneofs_by_name['version'] -_GETIDENTITYRESPONSE_GETIDENTITYRESPONSEV0.fields_by_name['proof'].message_type = _PROOF -_GETIDENTITYRESPONSE_GETIDENTITYRESPONSEV0.fields_by_name['metadata'].message_type = _RESPONSEMETADATA -_GETIDENTITYRESPONSE_GETIDENTITYRESPONSEV0.containing_type = _GETIDENTITYRESPONSE -_GETIDENTITYRESPONSE_GETIDENTITYRESPONSEV0.oneofs_by_name['result'].fields.append( - _GETIDENTITYRESPONSE_GETIDENTITYRESPONSEV0.fields_by_name['identity']) -_GETIDENTITYRESPONSE_GETIDENTITYRESPONSEV0.fields_by_name['identity'].containing_oneof = _GETIDENTITYRESPONSE_GETIDENTITYRESPONSEV0.oneofs_by_name['result'] -_GETIDENTITYRESPONSE_GETIDENTITYRESPONSEV0.oneofs_by_name['result'].fields.append( - _GETIDENTITYRESPONSE_GETIDENTITYRESPONSEV0.fields_by_name['proof']) -_GETIDENTITYRESPONSE_GETIDENTITYRESPONSEV0.fields_by_name['proof'].containing_oneof = _GETIDENTITYRESPONSE_GETIDENTITYRESPONSEV0.oneofs_by_name['result'] -_GETIDENTITYRESPONSE.fields_by_name['v0'].message_type = _GETIDENTITYRESPONSE_GETIDENTITYRESPONSEV0 -_GETIDENTITYRESPONSE.oneofs_by_name['version'].fields.append( - _GETIDENTITYRESPONSE.fields_by_name['v0']) -_GETIDENTITYRESPONSE.fields_by_name['v0'].containing_oneof = _GETIDENTITYRESPONSE.oneofs_by_name['version'] -_GETIDENTITYNONCERESPONSE_GETIDENTITYNONCERESPONSEV0.fields_by_name['proof'].message_type = _PROOF -_GETIDENTITYNONCERESPONSE_GETIDENTITYNONCERESPONSEV0.fields_by_name['metadata'].message_type = _RESPONSEMETADATA -_GETIDENTITYNONCERESPONSE_GETIDENTITYNONCERESPONSEV0.containing_type = _GETIDENTITYNONCERESPONSE -_GETIDENTITYNONCERESPONSE_GETIDENTITYNONCERESPONSEV0.oneofs_by_name['result'].fields.append( - _GETIDENTITYNONCERESPONSE_GETIDENTITYNONCERESPONSEV0.fields_by_name['identity_nonce']) -_GETIDENTITYNONCERESPONSE_GETIDENTITYNONCERESPONSEV0.fields_by_name['identity_nonce'].containing_oneof = _GETIDENTITYNONCERESPONSE_GETIDENTITYNONCERESPONSEV0.oneofs_by_name['result'] -_GETIDENTITYNONCERESPONSE_GETIDENTITYNONCERESPONSEV0.oneofs_by_name['result'].fields.append( - _GETIDENTITYNONCERESPONSE_GETIDENTITYNONCERESPONSEV0.fields_by_name['proof']) -_GETIDENTITYNONCERESPONSE_GETIDENTITYNONCERESPONSEV0.fields_by_name['proof'].containing_oneof = _GETIDENTITYNONCERESPONSE_GETIDENTITYNONCERESPONSEV0.oneofs_by_name['result'] -_GETIDENTITYNONCERESPONSE.fields_by_name['v0'].message_type = _GETIDENTITYNONCERESPONSE_GETIDENTITYNONCERESPONSEV0 -_GETIDENTITYNONCERESPONSE.oneofs_by_name['version'].fields.append( - _GETIDENTITYNONCERESPONSE.fields_by_name['v0']) -_GETIDENTITYNONCERESPONSE.fields_by_name['v0'].containing_oneof = _GETIDENTITYNONCERESPONSE.oneofs_by_name['version'] -_GETIDENTITYCONTRACTNONCERESPONSE_GETIDENTITYCONTRACTNONCERESPONSEV0.fields_by_name['proof'].message_type = _PROOF -_GETIDENTITYCONTRACTNONCERESPONSE_GETIDENTITYCONTRACTNONCERESPONSEV0.fields_by_name['metadata'].message_type = _RESPONSEMETADATA -_GETIDENTITYCONTRACTNONCERESPONSE_GETIDENTITYCONTRACTNONCERESPONSEV0.containing_type = _GETIDENTITYCONTRACTNONCERESPONSE -_GETIDENTITYCONTRACTNONCERESPONSE_GETIDENTITYCONTRACTNONCERESPONSEV0.oneofs_by_name['result'].fields.append( - _GETIDENTITYCONTRACTNONCERESPONSE_GETIDENTITYCONTRACTNONCERESPONSEV0.fields_by_name['identity_contract_nonce']) -_GETIDENTITYCONTRACTNONCERESPONSE_GETIDENTITYCONTRACTNONCERESPONSEV0.fields_by_name['identity_contract_nonce'].containing_oneof = _GETIDENTITYCONTRACTNONCERESPONSE_GETIDENTITYCONTRACTNONCERESPONSEV0.oneofs_by_name['result'] -_GETIDENTITYCONTRACTNONCERESPONSE_GETIDENTITYCONTRACTNONCERESPONSEV0.oneofs_by_name['result'].fields.append( - _GETIDENTITYCONTRACTNONCERESPONSE_GETIDENTITYCONTRACTNONCERESPONSEV0.fields_by_name['proof']) -_GETIDENTITYCONTRACTNONCERESPONSE_GETIDENTITYCONTRACTNONCERESPONSEV0.fields_by_name['proof'].containing_oneof = _GETIDENTITYCONTRACTNONCERESPONSE_GETIDENTITYCONTRACTNONCERESPONSEV0.oneofs_by_name['result'] -_GETIDENTITYCONTRACTNONCERESPONSE.fields_by_name['v0'].message_type = _GETIDENTITYCONTRACTNONCERESPONSE_GETIDENTITYCONTRACTNONCERESPONSEV0 -_GETIDENTITYCONTRACTNONCERESPONSE.oneofs_by_name['version'].fields.append( - _GETIDENTITYCONTRACTNONCERESPONSE.fields_by_name['v0']) -_GETIDENTITYCONTRACTNONCERESPONSE.fields_by_name['v0'].containing_oneof = _GETIDENTITYCONTRACTNONCERESPONSE.oneofs_by_name['version'] -_GETIDENTITYKEYSREMAININGBUDGETSREQUEST_GETIDENTITYKEYSREMAININGBUDGETSREQUESTV0.containing_type = _GETIDENTITYKEYSREMAININGBUDGETSREQUEST -_GETIDENTITYKEYSREMAININGBUDGETSREQUEST.fields_by_name['v0'].message_type = _GETIDENTITYKEYSREMAININGBUDGETSREQUEST_GETIDENTITYKEYSREMAININGBUDGETSREQUESTV0 -_GETIDENTITYKEYSREMAININGBUDGETSREQUEST.oneofs_by_name['version'].fields.append( - _GETIDENTITYKEYSREMAININGBUDGETSREQUEST.fields_by_name['v0']) -_GETIDENTITYKEYSREMAININGBUDGETSREQUEST.fields_by_name['v0'].containing_oneof = _GETIDENTITYKEYSREMAININGBUDGETSREQUEST.oneofs_by_name['version'] -_GETIDENTITYKEYSREMAININGBUDGETSRESPONSE_GETIDENTITYKEYSREMAININGBUDGETSRESPONSEV0_KEYREMAININGBUDGETENTRY.containing_type = _GETIDENTITYKEYSREMAININGBUDGETSRESPONSE_GETIDENTITYKEYSREMAININGBUDGETSRESPONSEV0 -_GETIDENTITYKEYSREMAININGBUDGETSRESPONSE_GETIDENTITYKEYSREMAININGBUDGETSRESPONSEV0_KEYREMAININGBUDGETENTRY.oneofs_by_name['_remaining_budget'].fields.append( - _GETIDENTITYKEYSREMAININGBUDGETSRESPONSE_GETIDENTITYKEYSREMAININGBUDGETSRESPONSEV0_KEYREMAININGBUDGETENTRY.fields_by_name['remaining_budget']) -_GETIDENTITYKEYSREMAININGBUDGETSRESPONSE_GETIDENTITYKEYSREMAININGBUDGETSRESPONSEV0_KEYREMAININGBUDGETENTRY.fields_by_name['remaining_budget'].containing_oneof = _GETIDENTITYKEYSREMAININGBUDGETSRESPONSE_GETIDENTITYKEYSREMAININGBUDGETSRESPONSEV0_KEYREMAININGBUDGETENTRY.oneofs_by_name['_remaining_budget'] -_GETIDENTITYKEYSREMAININGBUDGETSRESPONSE_GETIDENTITYKEYSREMAININGBUDGETSRESPONSEV0_KEYSREMAININGBUDGETS.fields_by_name['entries'].message_type = _GETIDENTITYKEYSREMAININGBUDGETSRESPONSE_GETIDENTITYKEYSREMAININGBUDGETSRESPONSEV0_KEYREMAININGBUDGETENTRY -_GETIDENTITYKEYSREMAININGBUDGETSRESPONSE_GETIDENTITYKEYSREMAININGBUDGETSRESPONSEV0_KEYSREMAININGBUDGETS.containing_type = _GETIDENTITYKEYSREMAININGBUDGETSRESPONSE_GETIDENTITYKEYSREMAININGBUDGETSRESPONSEV0 -_GETIDENTITYKEYSREMAININGBUDGETSRESPONSE_GETIDENTITYKEYSREMAININGBUDGETSRESPONSEV0.fields_by_name['keys_remaining_budgets'].message_type = _GETIDENTITYKEYSREMAININGBUDGETSRESPONSE_GETIDENTITYKEYSREMAININGBUDGETSRESPONSEV0_KEYSREMAININGBUDGETS -_GETIDENTITYKEYSREMAININGBUDGETSRESPONSE_GETIDENTITYKEYSREMAININGBUDGETSRESPONSEV0.fields_by_name['proof'].message_type = _PROOF -_GETIDENTITYKEYSREMAININGBUDGETSRESPONSE_GETIDENTITYKEYSREMAININGBUDGETSRESPONSEV0.fields_by_name['metadata'].message_type = _RESPONSEMETADATA -_GETIDENTITYKEYSREMAININGBUDGETSRESPONSE_GETIDENTITYKEYSREMAININGBUDGETSRESPONSEV0.containing_type = _GETIDENTITYKEYSREMAININGBUDGETSRESPONSE -_GETIDENTITYKEYSREMAININGBUDGETSRESPONSE_GETIDENTITYKEYSREMAININGBUDGETSRESPONSEV0.oneofs_by_name['result'].fields.append( - _GETIDENTITYKEYSREMAININGBUDGETSRESPONSE_GETIDENTITYKEYSREMAININGBUDGETSRESPONSEV0.fields_by_name['keys_remaining_budgets']) -_GETIDENTITYKEYSREMAININGBUDGETSRESPONSE_GETIDENTITYKEYSREMAININGBUDGETSRESPONSEV0.fields_by_name['keys_remaining_budgets'].containing_oneof = _GETIDENTITYKEYSREMAININGBUDGETSRESPONSE_GETIDENTITYKEYSREMAININGBUDGETSRESPONSEV0.oneofs_by_name['result'] -_GETIDENTITYKEYSREMAININGBUDGETSRESPONSE_GETIDENTITYKEYSREMAININGBUDGETSRESPONSEV0.oneofs_by_name['result'].fields.append( - _GETIDENTITYKEYSREMAININGBUDGETSRESPONSE_GETIDENTITYKEYSREMAININGBUDGETSRESPONSEV0.fields_by_name['proof']) -_GETIDENTITYKEYSREMAININGBUDGETSRESPONSE_GETIDENTITYKEYSREMAININGBUDGETSRESPONSEV0.fields_by_name['proof'].containing_oneof = _GETIDENTITYKEYSREMAININGBUDGETSRESPONSE_GETIDENTITYKEYSREMAININGBUDGETSRESPONSEV0.oneofs_by_name['result'] -_GETIDENTITYKEYSREMAININGBUDGETSRESPONSE.fields_by_name['v0'].message_type = _GETIDENTITYKEYSREMAININGBUDGETSRESPONSE_GETIDENTITYKEYSREMAININGBUDGETSRESPONSEV0 -_GETIDENTITYKEYSREMAININGBUDGETSRESPONSE.oneofs_by_name['version'].fields.append( - _GETIDENTITYKEYSREMAININGBUDGETSRESPONSE.fields_by_name['v0']) -_GETIDENTITYKEYSREMAININGBUDGETSRESPONSE.fields_by_name['v0'].containing_oneof = _GETIDENTITYKEYSREMAININGBUDGETSRESPONSE.oneofs_by_name['version'] -_GETIDENTITYBALANCERESPONSE_GETIDENTITYBALANCERESPONSEV0.fields_by_name['proof'].message_type = _PROOF -_GETIDENTITYBALANCERESPONSE_GETIDENTITYBALANCERESPONSEV0.fields_by_name['metadata'].message_type = _RESPONSEMETADATA -_GETIDENTITYBALANCERESPONSE_GETIDENTITYBALANCERESPONSEV0.containing_type = _GETIDENTITYBALANCERESPONSE -_GETIDENTITYBALANCERESPONSE_GETIDENTITYBALANCERESPONSEV0.oneofs_by_name['result'].fields.append( - _GETIDENTITYBALANCERESPONSE_GETIDENTITYBALANCERESPONSEV0.fields_by_name['balance']) -_GETIDENTITYBALANCERESPONSE_GETIDENTITYBALANCERESPONSEV0.fields_by_name['balance'].containing_oneof = _GETIDENTITYBALANCERESPONSE_GETIDENTITYBALANCERESPONSEV0.oneofs_by_name['result'] -_GETIDENTITYBALANCERESPONSE_GETIDENTITYBALANCERESPONSEV0.oneofs_by_name['result'].fields.append( - _GETIDENTITYBALANCERESPONSE_GETIDENTITYBALANCERESPONSEV0.fields_by_name['proof']) -_GETIDENTITYBALANCERESPONSE_GETIDENTITYBALANCERESPONSEV0.fields_by_name['proof'].containing_oneof = _GETIDENTITYBALANCERESPONSE_GETIDENTITYBALANCERESPONSEV0.oneofs_by_name['result'] -_GETIDENTITYBALANCERESPONSE.fields_by_name['v0'].message_type = _GETIDENTITYBALANCERESPONSE_GETIDENTITYBALANCERESPONSEV0 -_GETIDENTITYBALANCERESPONSE.oneofs_by_name['version'].fields.append( - _GETIDENTITYBALANCERESPONSE.fields_by_name['v0']) -_GETIDENTITYBALANCERESPONSE.fields_by_name['v0'].containing_oneof = _GETIDENTITYBALANCERESPONSE.oneofs_by_name['version'] -_GETIDENTITYBALANCEANDREVISIONRESPONSE_GETIDENTITYBALANCEANDREVISIONRESPONSEV0_BALANCEANDREVISION.containing_type = _GETIDENTITYBALANCEANDREVISIONRESPONSE_GETIDENTITYBALANCEANDREVISIONRESPONSEV0 -_GETIDENTITYBALANCEANDREVISIONRESPONSE_GETIDENTITYBALANCEANDREVISIONRESPONSEV0.fields_by_name['balance_and_revision'].message_type = _GETIDENTITYBALANCEANDREVISIONRESPONSE_GETIDENTITYBALANCEANDREVISIONRESPONSEV0_BALANCEANDREVISION -_GETIDENTITYBALANCEANDREVISIONRESPONSE_GETIDENTITYBALANCEANDREVISIONRESPONSEV0.fields_by_name['proof'].message_type = _PROOF -_GETIDENTITYBALANCEANDREVISIONRESPONSE_GETIDENTITYBALANCEANDREVISIONRESPONSEV0.fields_by_name['metadata'].message_type = _RESPONSEMETADATA -_GETIDENTITYBALANCEANDREVISIONRESPONSE_GETIDENTITYBALANCEANDREVISIONRESPONSEV0.containing_type = _GETIDENTITYBALANCEANDREVISIONRESPONSE -_GETIDENTITYBALANCEANDREVISIONRESPONSE_GETIDENTITYBALANCEANDREVISIONRESPONSEV0.oneofs_by_name['result'].fields.append( - _GETIDENTITYBALANCEANDREVISIONRESPONSE_GETIDENTITYBALANCEANDREVISIONRESPONSEV0.fields_by_name['balance_and_revision']) -_GETIDENTITYBALANCEANDREVISIONRESPONSE_GETIDENTITYBALANCEANDREVISIONRESPONSEV0.fields_by_name['balance_and_revision'].containing_oneof = _GETIDENTITYBALANCEANDREVISIONRESPONSE_GETIDENTITYBALANCEANDREVISIONRESPONSEV0.oneofs_by_name['result'] -_GETIDENTITYBALANCEANDREVISIONRESPONSE_GETIDENTITYBALANCEANDREVISIONRESPONSEV0.oneofs_by_name['result'].fields.append( - _GETIDENTITYBALANCEANDREVISIONRESPONSE_GETIDENTITYBALANCEANDREVISIONRESPONSEV0.fields_by_name['proof']) -_GETIDENTITYBALANCEANDREVISIONRESPONSE_GETIDENTITYBALANCEANDREVISIONRESPONSEV0.fields_by_name['proof'].containing_oneof = _GETIDENTITYBALANCEANDREVISIONRESPONSE_GETIDENTITYBALANCEANDREVISIONRESPONSEV0.oneofs_by_name['result'] -_GETIDENTITYBALANCEANDREVISIONRESPONSE.fields_by_name['v0'].message_type = _GETIDENTITYBALANCEANDREVISIONRESPONSE_GETIDENTITYBALANCEANDREVISIONRESPONSEV0 -_GETIDENTITYBALANCEANDREVISIONRESPONSE.oneofs_by_name['version'].fields.append( - _GETIDENTITYBALANCEANDREVISIONRESPONSE.fields_by_name['v0']) -_GETIDENTITYBALANCEANDREVISIONRESPONSE.fields_by_name['v0'].containing_oneof = _GETIDENTITYBALANCEANDREVISIONRESPONSE.oneofs_by_name['version'] -_KEYREQUESTTYPE.fields_by_name['all_keys'].message_type = _ALLKEYS -_KEYREQUESTTYPE.fields_by_name['specific_keys'].message_type = _SPECIFICKEYS -_KEYREQUESTTYPE.fields_by_name['search_key'].message_type = _SEARCHKEY -_KEYREQUESTTYPE.oneofs_by_name['request'].fields.append( - _KEYREQUESTTYPE.fields_by_name['all_keys']) -_KEYREQUESTTYPE.fields_by_name['all_keys'].containing_oneof = _KEYREQUESTTYPE.oneofs_by_name['request'] -_KEYREQUESTTYPE.oneofs_by_name['request'].fields.append( - _KEYREQUESTTYPE.fields_by_name['specific_keys']) -_KEYREQUESTTYPE.fields_by_name['specific_keys'].containing_oneof = _KEYREQUESTTYPE.oneofs_by_name['request'] -_KEYREQUESTTYPE.oneofs_by_name['request'].fields.append( - _KEYREQUESTTYPE.fields_by_name['search_key']) -_KEYREQUESTTYPE.fields_by_name['search_key'].containing_oneof = _KEYREQUESTTYPE.oneofs_by_name['request'] -_SEARCHKEY_PURPOSEMAPENTRY.fields_by_name['value'].message_type = _SECURITYLEVELMAP -_SEARCHKEY_PURPOSEMAPENTRY.containing_type = _SEARCHKEY -_SEARCHKEY.fields_by_name['purpose_map'].message_type = _SEARCHKEY_PURPOSEMAPENTRY -_SECURITYLEVELMAP_SECURITYLEVELMAPENTRY.fields_by_name['value'].enum_type = _SECURITYLEVELMAP_KEYKINDREQUESTTYPE -_SECURITYLEVELMAP_SECURITYLEVELMAPENTRY.containing_type = _SECURITYLEVELMAP -_SECURITYLEVELMAP.fields_by_name['security_level_map'].message_type = _SECURITYLEVELMAP_SECURITYLEVELMAPENTRY -_SECURITYLEVELMAP_KEYKINDREQUESTTYPE.containing_type = _SECURITYLEVELMAP -_GETIDENTITYKEYSREQUEST_GETIDENTITYKEYSREQUESTV0.fields_by_name['request_type'].message_type = _KEYREQUESTTYPE -_GETIDENTITYKEYSREQUEST_GETIDENTITYKEYSREQUESTV0.fields_by_name['limit'].message_type = google_dot_protobuf_dot_wrappers__pb2._UINT32VALUE -_GETIDENTITYKEYSREQUEST_GETIDENTITYKEYSREQUESTV0.fields_by_name['offset'].message_type = google_dot_protobuf_dot_wrappers__pb2._UINT32VALUE -_GETIDENTITYKEYSREQUEST_GETIDENTITYKEYSREQUESTV0.containing_type = _GETIDENTITYKEYSREQUEST -_GETIDENTITYKEYSREQUEST.fields_by_name['v0'].message_type = _GETIDENTITYKEYSREQUEST_GETIDENTITYKEYSREQUESTV0 -_GETIDENTITYKEYSREQUEST.oneofs_by_name['version'].fields.append( - _GETIDENTITYKEYSREQUEST.fields_by_name['v0']) -_GETIDENTITYKEYSREQUEST.fields_by_name['v0'].containing_oneof = _GETIDENTITYKEYSREQUEST.oneofs_by_name['version'] -_GETIDENTITYKEYSRESPONSE_GETIDENTITYKEYSRESPONSEV0_KEYS.containing_type = _GETIDENTITYKEYSRESPONSE_GETIDENTITYKEYSRESPONSEV0 -_GETIDENTITYKEYSRESPONSE_GETIDENTITYKEYSRESPONSEV0.fields_by_name['keys'].message_type = _GETIDENTITYKEYSRESPONSE_GETIDENTITYKEYSRESPONSEV0_KEYS -_GETIDENTITYKEYSRESPONSE_GETIDENTITYKEYSRESPONSEV0.fields_by_name['proof'].message_type = _PROOF -_GETIDENTITYKEYSRESPONSE_GETIDENTITYKEYSRESPONSEV0.fields_by_name['metadata'].message_type = _RESPONSEMETADATA -_GETIDENTITYKEYSRESPONSE_GETIDENTITYKEYSRESPONSEV0.containing_type = _GETIDENTITYKEYSRESPONSE -_GETIDENTITYKEYSRESPONSE_GETIDENTITYKEYSRESPONSEV0.oneofs_by_name['result'].fields.append( - _GETIDENTITYKEYSRESPONSE_GETIDENTITYKEYSRESPONSEV0.fields_by_name['keys']) -_GETIDENTITYKEYSRESPONSE_GETIDENTITYKEYSRESPONSEV0.fields_by_name['keys'].containing_oneof = _GETIDENTITYKEYSRESPONSE_GETIDENTITYKEYSRESPONSEV0.oneofs_by_name['result'] -_GETIDENTITYKEYSRESPONSE_GETIDENTITYKEYSRESPONSEV0.oneofs_by_name['result'].fields.append( - _GETIDENTITYKEYSRESPONSE_GETIDENTITYKEYSRESPONSEV0.fields_by_name['proof']) -_GETIDENTITYKEYSRESPONSE_GETIDENTITYKEYSRESPONSEV0.fields_by_name['proof'].containing_oneof = _GETIDENTITYKEYSRESPONSE_GETIDENTITYKEYSRESPONSEV0.oneofs_by_name['result'] -_GETIDENTITYKEYSRESPONSE.fields_by_name['v0'].message_type = _GETIDENTITYKEYSRESPONSE_GETIDENTITYKEYSRESPONSEV0 -_GETIDENTITYKEYSRESPONSE.oneofs_by_name['version'].fields.append( - _GETIDENTITYKEYSRESPONSE.fields_by_name['v0']) -_GETIDENTITYKEYSRESPONSE.fields_by_name['v0'].containing_oneof = _GETIDENTITYKEYSRESPONSE.oneofs_by_name['version'] -_GETIDENTITIESCONTRACTKEYSREQUEST_GETIDENTITIESCONTRACTKEYSREQUESTV0.fields_by_name['purposes'].enum_type = _KEYPURPOSE -_GETIDENTITIESCONTRACTKEYSREQUEST_GETIDENTITIESCONTRACTKEYSREQUESTV0.containing_type = _GETIDENTITIESCONTRACTKEYSREQUEST -_GETIDENTITIESCONTRACTKEYSREQUEST_GETIDENTITIESCONTRACTKEYSREQUESTV0.oneofs_by_name['_document_type_name'].fields.append( - _GETIDENTITIESCONTRACTKEYSREQUEST_GETIDENTITIESCONTRACTKEYSREQUESTV0.fields_by_name['document_type_name']) -_GETIDENTITIESCONTRACTKEYSREQUEST_GETIDENTITIESCONTRACTKEYSREQUESTV0.fields_by_name['document_type_name'].containing_oneof = _GETIDENTITIESCONTRACTKEYSREQUEST_GETIDENTITIESCONTRACTKEYSREQUESTV0.oneofs_by_name['_document_type_name'] -_GETIDENTITIESCONTRACTKEYSREQUEST.fields_by_name['v0'].message_type = _GETIDENTITIESCONTRACTKEYSREQUEST_GETIDENTITIESCONTRACTKEYSREQUESTV0 -_GETIDENTITIESCONTRACTKEYSREQUEST.oneofs_by_name['version'].fields.append( - _GETIDENTITIESCONTRACTKEYSREQUEST.fields_by_name['v0']) -_GETIDENTITIESCONTRACTKEYSREQUEST.fields_by_name['v0'].containing_oneof = _GETIDENTITIESCONTRACTKEYSREQUEST.oneofs_by_name['version'] -_GETIDENTITIESCONTRACTKEYSRESPONSE_GETIDENTITIESCONTRACTKEYSRESPONSEV0_PURPOSEKEYS.fields_by_name['purpose'].enum_type = _KEYPURPOSE -_GETIDENTITIESCONTRACTKEYSRESPONSE_GETIDENTITIESCONTRACTKEYSRESPONSEV0_PURPOSEKEYS.containing_type = _GETIDENTITIESCONTRACTKEYSRESPONSE_GETIDENTITIESCONTRACTKEYSRESPONSEV0 -_GETIDENTITIESCONTRACTKEYSRESPONSE_GETIDENTITIESCONTRACTKEYSRESPONSEV0_IDENTITYKEYS.fields_by_name['keys'].message_type = _GETIDENTITIESCONTRACTKEYSRESPONSE_GETIDENTITIESCONTRACTKEYSRESPONSEV0_PURPOSEKEYS -_GETIDENTITIESCONTRACTKEYSRESPONSE_GETIDENTITIESCONTRACTKEYSRESPONSEV0_IDENTITYKEYS.containing_type = _GETIDENTITIESCONTRACTKEYSRESPONSE_GETIDENTITIESCONTRACTKEYSRESPONSEV0 -_GETIDENTITIESCONTRACTKEYSRESPONSE_GETIDENTITIESCONTRACTKEYSRESPONSEV0_IDENTITIESKEYS.fields_by_name['entries'].message_type = _GETIDENTITIESCONTRACTKEYSRESPONSE_GETIDENTITIESCONTRACTKEYSRESPONSEV0_IDENTITYKEYS -_GETIDENTITIESCONTRACTKEYSRESPONSE_GETIDENTITIESCONTRACTKEYSRESPONSEV0_IDENTITIESKEYS.containing_type = _GETIDENTITIESCONTRACTKEYSRESPONSE_GETIDENTITIESCONTRACTKEYSRESPONSEV0 -_GETIDENTITIESCONTRACTKEYSRESPONSE_GETIDENTITIESCONTRACTKEYSRESPONSEV0.fields_by_name['identities_keys'].message_type = _GETIDENTITIESCONTRACTKEYSRESPONSE_GETIDENTITIESCONTRACTKEYSRESPONSEV0_IDENTITIESKEYS -_GETIDENTITIESCONTRACTKEYSRESPONSE_GETIDENTITIESCONTRACTKEYSRESPONSEV0.fields_by_name['proof'].message_type = _PROOF -_GETIDENTITIESCONTRACTKEYSRESPONSE_GETIDENTITIESCONTRACTKEYSRESPONSEV0.fields_by_name['metadata'].message_type = _RESPONSEMETADATA -_GETIDENTITIESCONTRACTKEYSRESPONSE_GETIDENTITIESCONTRACTKEYSRESPONSEV0.containing_type = _GETIDENTITIESCONTRACTKEYSRESPONSE -_GETIDENTITIESCONTRACTKEYSRESPONSE_GETIDENTITIESCONTRACTKEYSRESPONSEV0.oneofs_by_name['result'].fields.append( - _GETIDENTITIESCONTRACTKEYSRESPONSE_GETIDENTITIESCONTRACTKEYSRESPONSEV0.fields_by_name['identities_keys']) -_GETIDENTITIESCONTRACTKEYSRESPONSE_GETIDENTITIESCONTRACTKEYSRESPONSEV0.fields_by_name['identities_keys'].containing_oneof = _GETIDENTITIESCONTRACTKEYSRESPONSE_GETIDENTITIESCONTRACTKEYSRESPONSEV0.oneofs_by_name['result'] -_GETIDENTITIESCONTRACTKEYSRESPONSE_GETIDENTITIESCONTRACTKEYSRESPONSEV0.oneofs_by_name['result'].fields.append( - _GETIDENTITIESCONTRACTKEYSRESPONSE_GETIDENTITIESCONTRACTKEYSRESPONSEV0.fields_by_name['proof']) -_GETIDENTITIESCONTRACTKEYSRESPONSE_GETIDENTITIESCONTRACTKEYSRESPONSEV0.fields_by_name['proof'].containing_oneof = _GETIDENTITIESCONTRACTKEYSRESPONSE_GETIDENTITIESCONTRACTKEYSRESPONSEV0.oneofs_by_name['result'] -_GETIDENTITIESCONTRACTKEYSRESPONSE.fields_by_name['v0'].message_type = _GETIDENTITIESCONTRACTKEYSRESPONSE_GETIDENTITIESCONTRACTKEYSRESPONSEV0 -_GETIDENTITIESCONTRACTKEYSRESPONSE.oneofs_by_name['version'].fields.append( - _GETIDENTITIESCONTRACTKEYSRESPONSE.fields_by_name['v0']) -_GETIDENTITIESCONTRACTKEYSRESPONSE.fields_by_name['v0'].containing_oneof = _GETIDENTITIESCONTRACTKEYSRESPONSE.oneofs_by_name['version'] -_GETEVONODESPROPOSEDEPOCHBLOCKSBYIDSREQUEST_GETEVONODESPROPOSEDEPOCHBLOCKSBYIDSREQUESTV0.containing_type = _GETEVONODESPROPOSEDEPOCHBLOCKSBYIDSREQUEST -_GETEVONODESPROPOSEDEPOCHBLOCKSBYIDSREQUEST_GETEVONODESPROPOSEDEPOCHBLOCKSBYIDSREQUESTV0.oneofs_by_name['_epoch'].fields.append( - _GETEVONODESPROPOSEDEPOCHBLOCKSBYIDSREQUEST_GETEVONODESPROPOSEDEPOCHBLOCKSBYIDSREQUESTV0.fields_by_name['epoch']) -_GETEVONODESPROPOSEDEPOCHBLOCKSBYIDSREQUEST_GETEVONODESPROPOSEDEPOCHBLOCKSBYIDSREQUESTV0.fields_by_name['epoch'].containing_oneof = _GETEVONODESPROPOSEDEPOCHBLOCKSBYIDSREQUEST_GETEVONODESPROPOSEDEPOCHBLOCKSBYIDSREQUESTV0.oneofs_by_name['_epoch'] -_GETEVONODESPROPOSEDEPOCHBLOCKSBYIDSREQUEST.fields_by_name['v0'].message_type = _GETEVONODESPROPOSEDEPOCHBLOCKSBYIDSREQUEST_GETEVONODESPROPOSEDEPOCHBLOCKSBYIDSREQUESTV0 -_GETEVONODESPROPOSEDEPOCHBLOCKSBYIDSREQUEST.oneofs_by_name['version'].fields.append( - _GETEVONODESPROPOSEDEPOCHBLOCKSBYIDSREQUEST.fields_by_name['v0']) -_GETEVONODESPROPOSEDEPOCHBLOCKSBYIDSREQUEST.fields_by_name['v0'].containing_oneof = _GETEVONODESPROPOSEDEPOCHBLOCKSBYIDSREQUEST.oneofs_by_name['version'] -_GETEVONODESPROPOSEDEPOCHBLOCKSRESPONSE_GETEVONODESPROPOSEDEPOCHBLOCKSRESPONSEV0_EVONODEPROPOSEDBLOCKS.containing_type = _GETEVONODESPROPOSEDEPOCHBLOCKSRESPONSE_GETEVONODESPROPOSEDEPOCHBLOCKSRESPONSEV0 -_GETEVONODESPROPOSEDEPOCHBLOCKSRESPONSE_GETEVONODESPROPOSEDEPOCHBLOCKSRESPONSEV0_EVONODESPROPOSEDBLOCKS.fields_by_name['evonodes_proposed_block_counts'].message_type = _GETEVONODESPROPOSEDEPOCHBLOCKSRESPONSE_GETEVONODESPROPOSEDEPOCHBLOCKSRESPONSEV0_EVONODEPROPOSEDBLOCKS -_GETEVONODESPROPOSEDEPOCHBLOCKSRESPONSE_GETEVONODESPROPOSEDEPOCHBLOCKSRESPONSEV0_EVONODESPROPOSEDBLOCKS.containing_type = _GETEVONODESPROPOSEDEPOCHBLOCKSRESPONSE_GETEVONODESPROPOSEDEPOCHBLOCKSRESPONSEV0 -_GETEVONODESPROPOSEDEPOCHBLOCKSRESPONSE_GETEVONODESPROPOSEDEPOCHBLOCKSRESPONSEV0.fields_by_name['evonodes_proposed_block_counts_info'].message_type = _GETEVONODESPROPOSEDEPOCHBLOCKSRESPONSE_GETEVONODESPROPOSEDEPOCHBLOCKSRESPONSEV0_EVONODESPROPOSEDBLOCKS -_GETEVONODESPROPOSEDEPOCHBLOCKSRESPONSE_GETEVONODESPROPOSEDEPOCHBLOCKSRESPONSEV0.fields_by_name['proof'].message_type = _PROOF + +_SUBSCRIBETOSTATETRANSITIONSREQUEST_DOCUMENTFILTER_PRICECLAUSE = _descriptor.Descriptor( + name='PriceClause', + full_name='org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.PriceClause', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='operator', full_name='org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.PriceClause.operator', index=0, + number=1, 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), + _descriptor.FieldDescriptor( + name='value', full_name='org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.PriceClause.value', 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), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=84416, + serialized_end=84591, +) + +_SUBSCRIBETOSTATETRANSITIONSREQUEST_DOCUMENTFILTER_ACTIONMATCH = _descriptor.Descriptor( + name='ActionMatch', + full_name='org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='action', full_name='org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch.action', index=0, + number=1, 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), + _descriptor.FieldDescriptor( + name='new_document_where', full_name='org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch.new_document_where', 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='original_document_where', full_name='org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch.original_document_where', 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='owner_ids', full_name='org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch.owner_ids', 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='price', full_name='org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch.price', index=4, + number=5, 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=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + _descriptor.OneofDescriptor( + name='_action', full_name='org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch._action', + index=0, containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[]), + ], + serialized_start=84594, + serialized_end=85029, +) + +_SUBSCRIBETOSTATETRANSITIONSREQUEST_DOCUMENTFILTER = _descriptor.Descriptor( + name='DocumentFilter', + full_name='org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='data_contract_id', full_name='org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.data_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.SubscribeToStateTransitionsRequest.DocumentFilter.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='actions', full_name='org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.actions', 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='batch_owner_id', full_name='org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.batch_owner_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), + ], + extensions=[ + ], + nested_types=[_SUBSCRIBETOSTATETRANSITIONSREQUEST_DOCUMENTFILTER_PRICECLAUSE, _SUBSCRIBETOSTATETRANSITIONSREQUEST_DOCUMENTFILTER_ACTIONMATCH, ], + enum_types=[ + _SUBSCRIBETOSTATETRANSITIONSREQUEST_DOCUMENTFILTER_ACTION, + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + _descriptor.OneofDescriptor( + name='_document_type_name', full_name='org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter._document_type_name', + index=0, containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[]), + _descriptor.OneofDescriptor( + name='_batch_owner_id', full_name='org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter._batch_owner_id', + index=1, containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[]), + ], + serialized_start=84202, + serialized_end=85164, +) + +_SUBSCRIBETOSTATETRANSITIONSREQUEST_ADDRESSFILTER = _descriptor.Descriptor( + name='AddressFilter', + full_name='org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.AddressFilter', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='addresses', full_name='org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.AddressFilter.addresses', 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='role', full_name='org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.AddressFilter.role', 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=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=85166, + serialized_end=85282, +) + +_SUBSCRIBETOSTATETRANSITIONSREQUEST_STATETRANSITIONFILTER = _descriptor.Descriptor( + name='StateTransitionFilter', + full_name='org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='documents', full_name='org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter.documents', 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='addresses', full_name='org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter.addresses', 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), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + _descriptor.OneofDescriptor( + name='filter', full_name='org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter.filter', + index=0, containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[]), + ], + serialized_start=85285, + serialized_end=85515, +) + +_SUBSCRIBETOSTATETRANSITIONSREQUEST_SUBSCRIBETOSTATETRANSITIONSREQUESTV0 = _descriptor.Descriptor( + name='SubscribeToStateTransitionsRequestV0', + full_name='org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='filters', full_name='org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0.filters', 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='from_block_height', full_name='org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0.from_block_height', 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='_from_block_height', full_name='org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0._from_block_height', + index=0, containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[]), + ], + serialized_start=85518, + serialized_end=85716, +) + +_SUBSCRIBETOSTATETRANSITIONSREQUEST = _descriptor.Descriptor( + name='SubscribeToStateTransitionsRequest', + full_name='org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest', + 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.SubscribeToStateTransitionsRequest.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=[_SUBSCRIBETOSTATETRANSITIONSREQUEST_DOCUMENTFILTER, _SUBSCRIBETOSTATETRANSITIONSREQUEST_ADDRESSFILTER, _SUBSCRIBETOSTATETRANSITIONSREQUEST_STATETRANSITIONFILTER, _SUBSCRIBETOSTATETRANSITIONSREQUEST_SUBSCRIBETOSTATETRANSITIONSREQUESTV0, ], + enum_types=[ + _SUBSCRIBETOSTATETRANSITIONSREQUEST_ROLE, + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + _descriptor.OneofDescriptor( + name='version', full_name='org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.version', + index=0, containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[]), + ], + serialized_start=84049, + serialized_end=85771, +) + + +_SUBSCRIBETOSTATETRANSITIONSRESPONSE_SUBSCRIBETOSTATETRANSITIONSRESPONSEV0_STATETRANSITIONMATCH = _descriptor.Descriptor( + name='StateTransitionMatch', + full_name='org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='block_height', full_name='org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch.block_height', index=0, + number=1, 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), + _descriptor.FieldDescriptor( + name='block_time_ms', full_name='org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch.block_time_ms', 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), + _descriptor.FieldDescriptor( + name='protocol_version', full_name='org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch.protocol_version', index=2, + number=3, type=13, cpp_type=3, 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), + _descriptor.FieldDescriptor( + name='state_transition_hash', full_name='org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch.state_transition_hash', 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='state_transition', full_name='org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch.state_transition', 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), + _descriptor.FieldDescriptor( + name='matched_filters', full_name='org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch.matched_filters', index=5, + number=6, type=13, cpp_type=3, 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='matched_batch_positions', full_name='org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch.matched_batch_positions', index=6, + number=7, type=13, cpp_type=3, 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=86260, + serialized_end=86476, +) + +_SUBSCRIBETOSTATETRANSITIONSRESPONSE_SUBSCRIBETOSTATETRANSITIONSRESPONSEV0_CHECKPOINT = _descriptor.Descriptor( + name='Checkpoint', + full_name='org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.Checkpoint', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='block_height', full_name='org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.Checkpoint.block_height', index=0, + number=1, 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=[ + ], + serialized_start=86478, + serialized_end=86516, +) + +_SUBSCRIBETOSTATETRANSITIONSRESPONSE_SUBSCRIBETOSTATETRANSITIONSRESPONSEV0 = _descriptor.Descriptor( + name='SubscribeToStateTransitionsResponseV0', + full_name='org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='state_transition', full_name='org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.state_transition', 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='checkpoint', full_name='org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.checkpoint', 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), + ], + extensions=[ + ], + nested_types=[_SUBSCRIBETOSTATETRANSITIONSRESPONSE_SUBSCRIBETOSTATETRANSITIONSRESPONSEV0_STATETRANSITIONMATCH, _SUBSCRIBETOSTATETRANSITIONSRESPONSE_SUBSCRIBETOSTATETRANSITIONSRESPONSEV0_CHECKPOINT, ], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + _descriptor.OneofDescriptor( + name='responses', full_name='org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.responses', + index=0, containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[]), + ], + serialized_start=85930, + serialized_end=86529, +) + +_SUBSCRIBETOSTATETRANSITIONSRESPONSE = _descriptor.Descriptor( + name='SubscribeToStateTransitionsResponse', + full_name='org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse', + 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.SubscribeToStateTransitionsResponse.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=[_SUBSCRIBETOSTATETRANSITIONSRESPONSE_SUBSCRIBETOSTATETRANSITIONSRESPONSEV0, ], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + _descriptor.OneofDescriptor( + name='version', full_name='org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.version', + index=0, containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[]), + ], + serialized_start=85774, + serialized_end=86540, +) + +_GETIDENTITYREQUEST_GETIDENTITYREQUESTV0.containing_type = _GETIDENTITYREQUEST +_GETIDENTITYREQUEST.fields_by_name['v0'].message_type = _GETIDENTITYREQUEST_GETIDENTITYREQUESTV0 +_GETIDENTITYREQUEST.oneofs_by_name['version'].fields.append( + _GETIDENTITYREQUEST.fields_by_name['v0']) +_GETIDENTITYREQUEST.fields_by_name['v0'].containing_oneof = _GETIDENTITYREQUEST.oneofs_by_name['version'] +_GETIDENTITYNONCEREQUEST_GETIDENTITYNONCEREQUESTV0.containing_type = _GETIDENTITYNONCEREQUEST +_GETIDENTITYNONCEREQUEST.fields_by_name['v0'].message_type = _GETIDENTITYNONCEREQUEST_GETIDENTITYNONCEREQUESTV0 +_GETIDENTITYNONCEREQUEST.oneofs_by_name['version'].fields.append( + _GETIDENTITYNONCEREQUEST.fields_by_name['v0']) +_GETIDENTITYNONCEREQUEST.fields_by_name['v0'].containing_oneof = _GETIDENTITYNONCEREQUEST.oneofs_by_name['version'] +_GETIDENTITYCONTRACTNONCEREQUEST_GETIDENTITYCONTRACTNONCEREQUESTV0.containing_type = _GETIDENTITYCONTRACTNONCEREQUEST +_GETIDENTITYCONTRACTNONCEREQUEST.fields_by_name['v0'].message_type = _GETIDENTITYCONTRACTNONCEREQUEST_GETIDENTITYCONTRACTNONCEREQUESTV0 +_GETIDENTITYCONTRACTNONCEREQUEST.oneofs_by_name['version'].fields.append( + _GETIDENTITYCONTRACTNONCEREQUEST.fields_by_name['v0']) +_GETIDENTITYCONTRACTNONCEREQUEST.fields_by_name['v0'].containing_oneof = _GETIDENTITYCONTRACTNONCEREQUEST.oneofs_by_name['version'] +_GETIDENTITYBALANCEREQUEST_GETIDENTITYBALANCEREQUESTV0.containing_type = _GETIDENTITYBALANCEREQUEST +_GETIDENTITYBALANCEREQUEST.fields_by_name['v0'].message_type = _GETIDENTITYBALANCEREQUEST_GETIDENTITYBALANCEREQUESTV0 +_GETIDENTITYBALANCEREQUEST.oneofs_by_name['version'].fields.append( + _GETIDENTITYBALANCEREQUEST.fields_by_name['v0']) +_GETIDENTITYBALANCEREQUEST.fields_by_name['v0'].containing_oneof = _GETIDENTITYBALANCEREQUEST.oneofs_by_name['version'] +_GETIDENTITYBALANCEANDREVISIONREQUEST_GETIDENTITYBALANCEANDREVISIONREQUESTV0.containing_type = _GETIDENTITYBALANCEANDREVISIONREQUEST +_GETIDENTITYBALANCEANDREVISIONREQUEST.fields_by_name['v0'].message_type = _GETIDENTITYBALANCEANDREVISIONREQUEST_GETIDENTITYBALANCEANDREVISIONREQUESTV0 +_GETIDENTITYBALANCEANDREVISIONREQUEST.oneofs_by_name['version'].fields.append( + _GETIDENTITYBALANCEANDREVISIONREQUEST.fields_by_name['v0']) +_GETIDENTITYBALANCEANDREVISIONREQUEST.fields_by_name['v0'].containing_oneof = _GETIDENTITYBALANCEANDREVISIONREQUEST.oneofs_by_name['version'] +_GETIDENTITYRESPONSE_GETIDENTITYRESPONSEV0.fields_by_name['proof'].message_type = _PROOF +_GETIDENTITYRESPONSE_GETIDENTITYRESPONSEV0.fields_by_name['metadata'].message_type = _RESPONSEMETADATA +_GETIDENTITYRESPONSE_GETIDENTITYRESPONSEV0.containing_type = _GETIDENTITYRESPONSE +_GETIDENTITYRESPONSE_GETIDENTITYRESPONSEV0.oneofs_by_name['result'].fields.append( + _GETIDENTITYRESPONSE_GETIDENTITYRESPONSEV0.fields_by_name['identity']) +_GETIDENTITYRESPONSE_GETIDENTITYRESPONSEV0.fields_by_name['identity'].containing_oneof = _GETIDENTITYRESPONSE_GETIDENTITYRESPONSEV0.oneofs_by_name['result'] +_GETIDENTITYRESPONSE_GETIDENTITYRESPONSEV0.oneofs_by_name['result'].fields.append( + _GETIDENTITYRESPONSE_GETIDENTITYRESPONSEV0.fields_by_name['proof']) +_GETIDENTITYRESPONSE_GETIDENTITYRESPONSEV0.fields_by_name['proof'].containing_oneof = _GETIDENTITYRESPONSE_GETIDENTITYRESPONSEV0.oneofs_by_name['result'] +_GETIDENTITYRESPONSE.fields_by_name['v0'].message_type = _GETIDENTITYRESPONSE_GETIDENTITYRESPONSEV0 +_GETIDENTITYRESPONSE.oneofs_by_name['version'].fields.append( + _GETIDENTITYRESPONSE.fields_by_name['v0']) +_GETIDENTITYRESPONSE.fields_by_name['v0'].containing_oneof = _GETIDENTITYRESPONSE.oneofs_by_name['version'] +_GETIDENTITYNONCERESPONSE_GETIDENTITYNONCERESPONSEV0.fields_by_name['proof'].message_type = _PROOF +_GETIDENTITYNONCERESPONSE_GETIDENTITYNONCERESPONSEV0.fields_by_name['metadata'].message_type = _RESPONSEMETADATA +_GETIDENTITYNONCERESPONSE_GETIDENTITYNONCERESPONSEV0.containing_type = _GETIDENTITYNONCERESPONSE +_GETIDENTITYNONCERESPONSE_GETIDENTITYNONCERESPONSEV0.oneofs_by_name['result'].fields.append( + _GETIDENTITYNONCERESPONSE_GETIDENTITYNONCERESPONSEV0.fields_by_name['identity_nonce']) +_GETIDENTITYNONCERESPONSE_GETIDENTITYNONCERESPONSEV0.fields_by_name['identity_nonce'].containing_oneof = _GETIDENTITYNONCERESPONSE_GETIDENTITYNONCERESPONSEV0.oneofs_by_name['result'] +_GETIDENTITYNONCERESPONSE_GETIDENTITYNONCERESPONSEV0.oneofs_by_name['result'].fields.append( + _GETIDENTITYNONCERESPONSE_GETIDENTITYNONCERESPONSEV0.fields_by_name['proof']) +_GETIDENTITYNONCERESPONSE_GETIDENTITYNONCERESPONSEV0.fields_by_name['proof'].containing_oneof = _GETIDENTITYNONCERESPONSE_GETIDENTITYNONCERESPONSEV0.oneofs_by_name['result'] +_GETIDENTITYNONCERESPONSE.fields_by_name['v0'].message_type = _GETIDENTITYNONCERESPONSE_GETIDENTITYNONCERESPONSEV0 +_GETIDENTITYNONCERESPONSE.oneofs_by_name['version'].fields.append( + _GETIDENTITYNONCERESPONSE.fields_by_name['v0']) +_GETIDENTITYNONCERESPONSE.fields_by_name['v0'].containing_oneof = _GETIDENTITYNONCERESPONSE.oneofs_by_name['version'] +_GETIDENTITYCONTRACTNONCERESPONSE_GETIDENTITYCONTRACTNONCERESPONSEV0.fields_by_name['proof'].message_type = _PROOF +_GETIDENTITYCONTRACTNONCERESPONSE_GETIDENTITYCONTRACTNONCERESPONSEV0.fields_by_name['metadata'].message_type = _RESPONSEMETADATA +_GETIDENTITYCONTRACTNONCERESPONSE_GETIDENTITYCONTRACTNONCERESPONSEV0.containing_type = _GETIDENTITYCONTRACTNONCERESPONSE +_GETIDENTITYCONTRACTNONCERESPONSE_GETIDENTITYCONTRACTNONCERESPONSEV0.oneofs_by_name['result'].fields.append( + _GETIDENTITYCONTRACTNONCERESPONSE_GETIDENTITYCONTRACTNONCERESPONSEV0.fields_by_name['identity_contract_nonce']) +_GETIDENTITYCONTRACTNONCERESPONSE_GETIDENTITYCONTRACTNONCERESPONSEV0.fields_by_name['identity_contract_nonce'].containing_oneof = _GETIDENTITYCONTRACTNONCERESPONSE_GETIDENTITYCONTRACTNONCERESPONSEV0.oneofs_by_name['result'] +_GETIDENTITYCONTRACTNONCERESPONSE_GETIDENTITYCONTRACTNONCERESPONSEV0.oneofs_by_name['result'].fields.append( + _GETIDENTITYCONTRACTNONCERESPONSE_GETIDENTITYCONTRACTNONCERESPONSEV0.fields_by_name['proof']) +_GETIDENTITYCONTRACTNONCERESPONSE_GETIDENTITYCONTRACTNONCERESPONSEV0.fields_by_name['proof'].containing_oneof = _GETIDENTITYCONTRACTNONCERESPONSE_GETIDENTITYCONTRACTNONCERESPONSEV0.oneofs_by_name['result'] +_GETIDENTITYCONTRACTNONCERESPONSE.fields_by_name['v0'].message_type = _GETIDENTITYCONTRACTNONCERESPONSE_GETIDENTITYCONTRACTNONCERESPONSEV0 +_GETIDENTITYCONTRACTNONCERESPONSE.oneofs_by_name['version'].fields.append( + _GETIDENTITYCONTRACTNONCERESPONSE.fields_by_name['v0']) +_GETIDENTITYCONTRACTNONCERESPONSE.fields_by_name['v0'].containing_oneof = _GETIDENTITYCONTRACTNONCERESPONSE.oneofs_by_name['version'] +_GETIDENTITYKEYSREMAININGBUDGETSREQUEST_GETIDENTITYKEYSREMAININGBUDGETSREQUESTV0.containing_type = _GETIDENTITYKEYSREMAININGBUDGETSREQUEST +_GETIDENTITYKEYSREMAININGBUDGETSREQUEST.fields_by_name['v0'].message_type = _GETIDENTITYKEYSREMAININGBUDGETSREQUEST_GETIDENTITYKEYSREMAININGBUDGETSREQUESTV0 +_GETIDENTITYKEYSREMAININGBUDGETSREQUEST.oneofs_by_name['version'].fields.append( + _GETIDENTITYKEYSREMAININGBUDGETSREQUEST.fields_by_name['v0']) +_GETIDENTITYKEYSREMAININGBUDGETSREQUEST.fields_by_name['v0'].containing_oneof = _GETIDENTITYKEYSREMAININGBUDGETSREQUEST.oneofs_by_name['version'] +_GETIDENTITYKEYSREMAININGBUDGETSRESPONSE_GETIDENTITYKEYSREMAININGBUDGETSRESPONSEV0_KEYREMAININGBUDGETENTRY.containing_type = _GETIDENTITYKEYSREMAININGBUDGETSRESPONSE_GETIDENTITYKEYSREMAININGBUDGETSRESPONSEV0 +_GETIDENTITYKEYSREMAININGBUDGETSRESPONSE_GETIDENTITYKEYSREMAININGBUDGETSRESPONSEV0_KEYREMAININGBUDGETENTRY.oneofs_by_name['_remaining_budget'].fields.append( + _GETIDENTITYKEYSREMAININGBUDGETSRESPONSE_GETIDENTITYKEYSREMAININGBUDGETSRESPONSEV0_KEYREMAININGBUDGETENTRY.fields_by_name['remaining_budget']) +_GETIDENTITYKEYSREMAININGBUDGETSRESPONSE_GETIDENTITYKEYSREMAININGBUDGETSRESPONSEV0_KEYREMAININGBUDGETENTRY.fields_by_name['remaining_budget'].containing_oneof = _GETIDENTITYKEYSREMAININGBUDGETSRESPONSE_GETIDENTITYKEYSREMAININGBUDGETSRESPONSEV0_KEYREMAININGBUDGETENTRY.oneofs_by_name['_remaining_budget'] +_GETIDENTITYKEYSREMAININGBUDGETSRESPONSE_GETIDENTITYKEYSREMAININGBUDGETSRESPONSEV0_KEYSREMAININGBUDGETS.fields_by_name['entries'].message_type = _GETIDENTITYKEYSREMAININGBUDGETSRESPONSE_GETIDENTITYKEYSREMAININGBUDGETSRESPONSEV0_KEYREMAININGBUDGETENTRY +_GETIDENTITYKEYSREMAININGBUDGETSRESPONSE_GETIDENTITYKEYSREMAININGBUDGETSRESPONSEV0_KEYSREMAININGBUDGETS.containing_type = _GETIDENTITYKEYSREMAININGBUDGETSRESPONSE_GETIDENTITYKEYSREMAININGBUDGETSRESPONSEV0 +_GETIDENTITYKEYSREMAININGBUDGETSRESPONSE_GETIDENTITYKEYSREMAININGBUDGETSRESPONSEV0.fields_by_name['keys_remaining_budgets'].message_type = _GETIDENTITYKEYSREMAININGBUDGETSRESPONSE_GETIDENTITYKEYSREMAININGBUDGETSRESPONSEV0_KEYSREMAININGBUDGETS +_GETIDENTITYKEYSREMAININGBUDGETSRESPONSE_GETIDENTITYKEYSREMAININGBUDGETSRESPONSEV0.fields_by_name['proof'].message_type = _PROOF +_GETIDENTITYKEYSREMAININGBUDGETSRESPONSE_GETIDENTITYKEYSREMAININGBUDGETSRESPONSEV0.fields_by_name['metadata'].message_type = _RESPONSEMETADATA +_GETIDENTITYKEYSREMAININGBUDGETSRESPONSE_GETIDENTITYKEYSREMAININGBUDGETSRESPONSEV0.containing_type = _GETIDENTITYKEYSREMAININGBUDGETSRESPONSE +_GETIDENTITYKEYSREMAININGBUDGETSRESPONSE_GETIDENTITYKEYSREMAININGBUDGETSRESPONSEV0.oneofs_by_name['result'].fields.append( + _GETIDENTITYKEYSREMAININGBUDGETSRESPONSE_GETIDENTITYKEYSREMAININGBUDGETSRESPONSEV0.fields_by_name['keys_remaining_budgets']) +_GETIDENTITYKEYSREMAININGBUDGETSRESPONSE_GETIDENTITYKEYSREMAININGBUDGETSRESPONSEV0.fields_by_name['keys_remaining_budgets'].containing_oneof = _GETIDENTITYKEYSREMAININGBUDGETSRESPONSE_GETIDENTITYKEYSREMAININGBUDGETSRESPONSEV0.oneofs_by_name['result'] +_GETIDENTITYKEYSREMAININGBUDGETSRESPONSE_GETIDENTITYKEYSREMAININGBUDGETSRESPONSEV0.oneofs_by_name['result'].fields.append( + _GETIDENTITYKEYSREMAININGBUDGETSRESPONSE_GETIDENTITYKEYSREMAININGBUDGETSRESPONSEV0.fields_by_name['proof']) +_GETIDENTITYKEYSREMAININGBUDGETSRESPONSE_GETIDENTITYKEYSREMAININGBUDGETSRESPONSEV0.fields_by_name['proof'].containing_oneof = _GETIDENTITYKEYSREMAININGBUDGETSRESPONSE_GETIDENTITYKEYSREMAININGBUDGETSRESPONSEV0.oneofs_by_name['result'] +_GETIDENTITYKEYSREMAININGBUDGETSRESPONSE.fields_by_name['v0'].message_type = _GETIDENTITYKEYSREMAININGBUDGETSRESPONSE_GETIDENTITYKEYSREMAININGBUDGETSRESPONSEV0 +_GETIDENTITYKEYSREMAININGBUDGETSRESPONSE.oneofs_by_name['version'].fields.append( + _GETIDENTITYKEYSREMAININGBUDGETSRESPONSE.fields_by_name['v0']) +_GETIDENTITYKEYSREMAININGBUDGETSRESPONSE.fields_by_name['v0'].containing_oneof = _GETIDENTITYKEYSREMAININGBUDGETSRESPONSE.oneofs_by_name['version'] +_GETIDENTITYBALANCERESPONSE_GETIDENTITYBALANCERESPONSEV0.fields_by_name['proof'].message_type = _PROOF +_GETIDENTITYBALANCERESPONSE_GETIDENTITYBALANCERESPONSEV0.fields_by_name['metadata'].message_type = _RESPONSEMETADATA +_GETIDENTITYBALANCERESPONSE_GETIDENTITYBALANCERESPONSEV0.containing_type = _GETIDENTITYBALANCERESPONSE +_GETIDENTITYBALANCERESPONSE_GETIDENTITYBALANCERESPONSEV0.oneofs_by_name['result'].fields.append( + _GETIDENTITYBALANCERESPONSE_GETIDENTITYBALANCERESPONSEV0.fields_by_name['balance']) +_GETIDENTITYBALANCERESPONSE_GETIDENTITYBALANCERESPONSEV0.fields_by_name['balance'].containing_oneof = _GETIDENTITYBALANCERESPONSE_GETIDENTITYBALANCERESPONSEV0.oneofs_by_name['result'] +_GETIDENTITYBALANCERESPONSE_GETIDENTITYBALANCERESPONSEV0.oneofs_by_name['result'].fields.append( + _GETIDENTITYBALANCERESPONSE_GETIDENTITYBALANCERESPONSEV0.fields_by_name['proof']) +_GETIDENTITYBALANCERESPONSE_GETIDENTITYBALANCERESPONSEV0.fields_by_name['proof'].containing_oneof = _GETIDENTITYBALANCERESPONSE_GETIDENTITYBALANCERESPONSEV0.oneofs_by_name['result'] +_GETIDENTITYBALANCERESPONSE.fields_by_name['v0'].message_type = _GETIDENTITYBALANCERESPONSE_GETIDENTITYBALANCERESPONSEV0 +_GETIDENTITYBALANCERESPONSE.oneofs_by_name['version'].fields.append( + _GETIDENTITYBALANCERESPONSE.fields_by_name['v0']) +_GETIDENTITYBALANCERESPONSE.fields_by_name['v0'].containing_oneof = _GETIDENTITYBALANCERESPONSE.oneofs_by_name['version'] +_GETIDENTITYBALANCEANDREVISIONRESPONSE_GETIDENTITYBALANCEANDREVISIONRESPONSEV0_BALANCEANDREVISION.containing_type = _GETIDENTITYBALANCEANDREVISIONRESPONSE_GETIDENTITYBALANCEANDREVISIONRESPONSEV0 +_GETIDENTITYBALANCEANDREVISIONRESPONSE_GETIDENTITYBALANCEANDREVISIONRESPONSEV0.fields_by_name['balance_and_revision'].message_type = _GETIDENTITYBALANCEANDREVISIONRESPONSE_GETIDENTITYBALANCEANDREVISIONRESPONSEV0_BALANCEANDREVISION +_GETIDENTITYBALANCEANDREVISIONRESPONSE_GETIDENTITYBALANCEANDREVISIONRESPONSEV0.fields_by_name['proof'].message_type = _PROOF +_GETIDENTITYBALANCEANDREVISIONRESPONSE_GETIDENTITYBALANCEANDREVISIONRESPONSEV0.fields_by_name['metadata'].message_type = _RESPONSEMETADATA +_GETIDENTITYBALANCEANDREVISIONRESPONSE_GETIDENTITYBALANCEANDREVISIONRESPONSEV0.containing_type = _GETIDENTITYBALANCEANDREVISIONRESPONSE +_GETIDENTITYBALANCEANDREVISIONRESPONSE_GETIDENTITYBALANCEANDREVISIONRESPONSEV0.oneofs_by_name['result'].fields.append( + _GETIDENTITYBALANCEANDREVISIONRESPONSE_GETIDENTITYBALANCEANDREVISIONRESPONSEV0.fields_by_name['balance_and_revision']) +_GETIDENTITYBALANCEANDREVISIONRESPONSE_GETIDENTITYBALANCEANDREVISIONRESPONSEV0.fields_by_name['balance_and_revision'].containing_oneof = _GETIDENTITYBALANCEANDREVISIONRESPONSE_GETIDENTITYBALANCEANDREVISIONRESPONSEV0.oneofs_by_name['result'] +_GETIDENTITYBALANCEANDREVISIONRESPONSE_GETIDENTITYBALANCEANDREVISIONRESPONSEV0.oneofs_by_name['result'].fields.append( + _GETIDENTITYBALANCEANDREVISIONRESPONSE_GETIDENTITYBALANCEANDREVISIONRESPONSEV0.fields_by_name['proof']) +_GETIDENTITYBALANCEANDREVISIONRESPONSE_GETIDENTITYBALANCEANDREVISIONRESPONSEV0.fields_by_name['proof'].containing_oneof = _GETIDENTITYBALANCEANDREVISIONRESPONSE_GETIDENTITYBALANCEANDREVISIONRESPONSEV0.oneofs_by_name['result'] +_GETIDENTITYBALANCEANDREVISIONRESPONSE.fields_by_name['v0'].message_type = _GETIDENTITYBALANCEANDREVISIONRESPONSE_GETIDENTITYBALANCEANDREVISIONRESPONSEV0 +_GETIDENTITYBALANCEANDREVISIONRESPONSE.oneofs_by_name['version'].fields.append( + _GETIDENTITYBALANCEANDREVISIONRESPONSE.fields_by_name['v0']) +_GETIDENTITYBALANCEANDREVISIONRESPONSE.fields_by_name['v0'].containing_oneof = _GETIDENTITYBALANCEANDREVISIONRESPONSE.oneofs_by_name['version'] +_KEYREQUESTTYPE.fields_by_name['all_keys'].message_type = _ALLKEYS +_KEYREQUESTTYPE.fields_by_name['specific_keys'].message_type = _SPECIFICKEYS +_KEYREQUESTTYPE.fields_by_name['search_key'].message_type = _SEARCHKEY +_KEYREQUESTTYPE.oneofs_by_name['request'].fields.append( + _KEYREQUESTTYPE.fields_by_name['all_keys']) +_KEYREQUESTTYPE.fields_by_name['all_keys'].containing_oneof = _KEYREQUESTTYPE.oneofs_by_name['request'] +_KEYREQUESTTYPE.oneofs_by_name['request'].fields.append( + _KEYREQUESTTYPE.fields_by_name['specific_keys']) +_KEYREQUESTTYPE.fields_by_name['specific_keys'].containing_oneof = _KEYREQUESTTYPE.oneofs_by_name['request'] +_KEYREQUESTTYPE.oneofs_by_name['request'].fields.append( + _KEYREQUESTTYPE.fields_by_name['search_key']) +_KEYREQUESTTYPE.fields_by_name['search_key'].containing_oneof = _KEYREQUESTTYPE.oneofs_by_name['request'] +_SEARCHKEY_PURPOSEMAPENTRY.fields_by_name['value'].message_type = _SECURITYLEVELMAP +_SEARCHKEY_PURPOSEMAPENTRY.containing_type = _SEARCHKEY +_SEARCHKEY.fields_by_name['purpose_map'].message_type = _SEARCHKEY_PURPOSEMAPENTRY +_SECURITYLEVELMAP_SECURITYLEVELMAPENTRY.fields_by_name['value'].enum_type = _SECURITYLEVELMAP_KEYKINDREQUESTTYPE +_SECURITYLEVELMAP_SECURITYLEVELMAPENTRY.containing_type = _SECURITYLEVELMAP +_SECURITYLEVELMAP.fields_by_name['security_level_map'].message_type = _SECURITYLEVELMAP_SECURITYLEVELMAPENTRY +_SECURITYLEVELMAP_KEYKINDREQUESTTYPE.containing_type = _SECURITYLEVELMAP +_GETIDENTITYKEYSREQUEST_GETIDENTITYKEYSREQUESTV0.fields_by_name['request_type'].message_type = _KEYREQUESTTYPE +_GETIDENTITYKEYSREQUEST_GETIDENTITYKEYSREQUESTV0.fields_by_name['limit'].message_type = google_dot_protobuf_dot_wrappers__pb2._UINT32VALUE +_GETIDENTITYKEYSREQUEST_GETIDENTITYKEYSREQUESTV0.fields_by_name['offset'].message_type = google_dot_protobuf_dot_wrappers__pb2._UINT32VALUE +_GETIDENTITYKEYSREQUEST_GETIDENTITYKEYSREQUESTV0.containing_type = _GETIDENTITYKEYSREQUEST +_GETIDENTITYKEYSREQUEST.fields_by_name['v0'].message_type = _GETIDENTITYKEYSREQUEST_GETIDENTITYKEYSREQUESTV0 +_GETIDENTITYKEYSREQUEST.oneofs_by_name['version'].fields.append( + _GETIDENTITYKEYSREQUEST.fields_by_name['v0']) +_GETIDENTITYKEYSREQUEST.fields_by_name['v0'].containing_oneof = _GETIDENTITYKEYSREQUEST.oneofs_by_name['version'] +_GETIDENTITYKEYSRESPONSE_GETIDENTITYKEYSRESPONSEV0_KEYS.containing_type = _GETIDENTITYKEYSRESPONSE_GETIDENTITYKEYSRESPONSEV0 +_GETIDENTITYKEYSRESPONSE_GETIDENTITYKEYSRESPONSEV0.fields_by_name['keys'].message_type = _GETIDENTITYKEYSRESPONSE_GETIDENTITYKEYSRESPONSEV0_KEYS +_GETIDENTITYKEYSRESPONSE_GETIDENTITYKEYSRESPONSEV0.fields_by_name['proof'].message_type = _PROOF +_GETIDENTITYKEYSRESPONSE_GETIDENTITYKEYSRESPONSEV0.fields_by_name['metadata'].message_type = _RESPONSEMETADATA +_GETIDENTITYKEYSRESPONSE_GETIDENTITYKEYSRESPONSEV0.containing_type = _GETIDENTITYKEYSRESPONSE +_GETIDENTITYKEYSRESPONSE_GETIDENTITYKEYSRESPONSEV0.oneofs_by_name['result'].fields.append( + _GETIDENTITYKEYSRESPONSE_GETIDENTITYKEYSRESPONSEV0.fields_by_name['keys']) +_GETIDENTITYKEYSRESPONSE_GETIDENTITYKEYSRESPONSEV0.fields_by_name['keys'].containing_oneof = _GETIDENTITYKEYSRESPONSE_GETIDENTITYKEYSRESPONSEV0.oneofs_by_name['result'] +_GETIDENTITYKEYSRESPONSE_GETIDENTITYKEYSRESPONSEV0.oneofs_by_name['result'].fields.append( + _GETIDENTITYKEYSRESPONSE_GETIDENTITYKEYSRESPONSEV0.fields_by_name['proof']) +_GETIDENTITYKEYSRESPONSE_GETIDENTITYKEYSRESPONSEV0.fields_by_name['proof'].containing_oneof = _GETIDENTITYKEYSRESPONSE_GETIDENTITYKEYSRESPONSEV0.oneofs_by_name['result'] +_GETIDENTITYKEYSRESPONSE.fields_by_name['v0'].message_type = _GETIDENTITYKEYSRESPONSE_GETIDENTITYKEYSRESPONSEV0 +_GETIDENTITYKEYSRESPONSE.oneofs_by_name['version'].fields.append( + _GETIDENTITYKEYSRESPONSE.fields_by_name['v0']) +_GETIDENTITYKEYSRESPONSE.fields_by_name['v0'].containing_oneof = _GETIDENTITYKEYSRESPONSE.oneofs_by_name['version'] +_GETIDENTITIESCONTRACTKEYSREQUEST_GETIDENTITIESCONTRACTKEYSREQUESTV0.fields_by_name['purposes'].enum_type = _KEYPURPOSE +_GETIDENTITIESCONTRACTKEYSREQUEST_GETIDENTITIESCONTRACTKEYSREQUESTV0.containing_type = _GETIDENTITIESCONTRACTKEYSREQUEST +_GETIDENTITIESCONTRACTKEYSREQUEST_GETIDENTITIESCONTRACTKEYSREQUESTV0.oneofs_by_name['_document_type_name'].fields.append( + _GETIDENTITIESCONTRACTKEYSREQUEST_GETIDENTITIESCONTRACTKEYSREQUESTV0.fields_by_name['document_type_name']) +_GETIDENTITIESCONTRACTKEYSREQUEST_GETIDENTITIESCONTRACTKEYSREQUESTV0.fields_by_name['document_type_name'].containing_oneof = _GETIDENTITIESCONTRACTKEYSREQUEST_GETIDENTITIESCONTRACTKEYSREQUESTV0.oneofs_by_name['_document_type_name'] +_GETIDENTITIESCONTRACTKEYSREQUEST.fields_by_name['v0'].message_type = _GETIDENTITIESCONTRACTKEYSREQUEST_GETIDENTITIESCONTRACTKEYSREQUESTV0 +_GETIDENTITIESCONTRACTKEYSREQUEST.oneofs_by_name['version'].fields.append( + _GETIDENTITIESCONTRACTKEYSREQUEST.fields_by_name['v0']) +_GETIDENTITIESCONTRACTKEYSREQUEST.fields_by_name['v0'].containing_oneof = _GETIDENTITIESCONTRACTKEYSREQUEST.oneofs_by_name['version'] +_GETIDENTITIESCONTRACTKEYSRESPONSE_GETIDENTITIESCONTRACTKEYSRESPONSEV0_PURPOSEKEYS.fields_by_name['purpose'].enum_type = _KEYPURPOSE +_GETIDENTITIESCONTRACTKEYSRESPONSE_GETIDENTITIESCONTRACTKEYSRESPONSEV0_PURPOSEKEYS.containing_type = _GETIDENTITIESCONTRACTKEYSRESPONSE_GETIDENTITIESCONTRACTKEYSRESPONSEV0 +_GETIDENTITIESCONTRACTKEYSRESPONSE_GETIDENTITIESCONTRACTKEYSRESPONSEV0_IDENTITYKEYS.fields_by_name['keys'].message_type = _GETIDENTITIESCONTRACTKEYSRESPONSE_GETIDENTITIESCONTRACTKEYSRESPONSEV0_PURPOSEKEYS +_GETIDENTITIESCONTRACTKEYSRESPONSE_GETIDENTITIESCONTRACTKEYSRESPONSEV0_IDENTITYKEYS.containing_type = _GETIDENTITIESCONTRACTKEYSRESPONSE_GETIDENTITIESCONTRACTKEYSRESPONSEV0 +_GETIDENTITIESCONTRACTKEYSRESPONSE_GETIDENTITIESCONTRACTKEYSRESPONSEV0_IDENTITIESKEYS.fields_by_name['entries'].message_type = _GETIDENTITIESCONTRACTKEYSRESPONSE_GETIDENTITIESCONTRACTKEYSRESPONSEV0_IDENTITYKEYS +_GETIDENTITIESCONTRACTKEYSRESPONSE_GETIDENTITIESCONTRACTKEYSRESPONSEV0_IDENTITIESKEYS.containing_type = _GETIDENTITIESCONTRACTKEYSRESPONSE_GETIDENTITIESCONTRACTKEYSRESPONSEV0 +_GETIDENTITIESCONTRACTKEYSRESPONSE_GETIDENTITIESCONTRACTKEYSRESPONSEV0.fields_by_name['identities_keys'].message_type = _GETIDENTITIESCONTRACTKEYSRESPONSE_GETIDENTITIESCONTRACTKEYSRESPONSEV0_IDENTITIESKEYS +_GETIDENTITIESCONTRACTKEYSRESPONSE_GETIDENTITIESCONTRACTKEYSRESPONSEV0.fields_by_name['proof'].message_type = _PROOF +_GETIDENTITIESCONTRACTKEYSRESPONSE_GETIDENTITIESCONTRACTKEYSRESPONSEV0.fields_by_name['metadata'].message_type = _RESPONSEMETADATA +_GETIDENTITIESCONTRACTKEYSRESPONSE_GETIDENTITIESCONTRACTKEYSRESPONSEV0.containing_type = _GETIDENTITIESCONTRACTKEYSRESPONSE +_GETIDENTITIESCONTRACTKEYSRESPONSE_GETIDENTITIESCONTRACTKEYSRESPONSEV0.oneofs_by_name['result'].fields.append( + _GETIDENTITIESCONTRACTKEYSRESPONSE_GETIDENTITIESCONTRACTKEYSRESPONSEV0.fields_by_name['identities_keys']) +_GETIDENTITIESCONTRACTKEYSRESPONSE_GETIDENTITIESCONTRACTKEYSRESPONSEV0.fields_by_name['identities_keys'].containing_oneof = _GETIDENTITIESCONTRACTKEYSRESPONSE_GETIDENTITIESCONTRACTKEYSRESPONSEV0.oneofs_by_name['result'] +_GETIDENTITIESCONTRACTKEYSRESPONSE_GETIDENTITIESCONTRACTKEYSRESPONSEV0.oneofs_by_name['result'].fields.append( + _GETIDENTITIESCONTRACTKEYSRESPONSE_GETIDENTITIESCONTRACTKEYSRESPONSEV0.fields_by_name['proof']) +_GETIDENTITIESCONTRACTKEYSRESPONSE_GETIDENTITIESCONTRACTKEYSRESPONSEV0.fields_by_name['proof'].containing_oneof = _GETIDENTITIESCONTRACTKEYSRESPONSE_GETIDENTITIESCONTRACTKEYSRESPONSEV0.oneofs_by_name['result'] +_GETIDENTITIESCONTRACTKEYSRESPONSE.fields_by_name['v0'].message_type = _GETIDENTITIESCONTRACTKEYSRESPONSE_GETIDENTITIESCONTRACTKEYSRESPONSEV0 +_GETIDENTITIESCONTRACTKEYSRESPONSE.oneofs_by_name['version'].fields.append( + _GETIDENTITIESCONTRACTKEYSRESPONSE.fields_by_name['v0']) +_GETIDENTITIESCONTRACTKEYSRESPONSE.fields_by_name['v0'].containing_oneof = _GETIDENTITIESCONTRACTKEYSRESPONSE.oneofs_by_name['version'] +_GETEVONODESPROPOSEDEPOCHBLOCKSBYIDSREQUEST_GETEVONODESPROPOSEDEPOCHBLOCKSBYIDSREQUESTV0.containing_type = _GETEVONODESPROPOSEDEPOCHBLOCKSBYIDSREQUEST +_GETEVONODESPROPOSEDEPOCHBLOCKSBYIDSREQUEST_GETEVONODESPROPOSEDEPOCHBLOCKSBYIDSREQUESTV0.oneofs_by_name['_epoch'].fields.append( + _GETEVONODESPROPOSEDEPOCHBLOCKSBYIDSREQUEST_GETEVONODESPROPOSEDEPOCHBLOCKSBYIDSREQUESTV0.fields_by_name['epoch']) +_GETEVONODESPROPOSEDEPOCHBLOCKSBYIDSREQUEST_GETEVONODESPROPOSEDEPOCHBLOCKSBYIDSREQUESTV0.fields_by_name['epoch'].containing_oneof = _GETEVONODESPROPOSEDEPOCHBLOCKSBYIDSREQUEST_GETEVONODESPROPOSEDEPOCHBLOCKSBYIDSREQUESTV0.oneofs_by_name['_epoch'] +_GETEVONODESPROPOSEDEPOCHBLOCKSBYIDSREQUEST.fields_by_name['v0'].message_type = _GETEVONODESPROPOSEDEPOCHBLOCKSBYIDSREQUEST_GETEVONODESPROPOSEDEPOCHBLOCKSBYIDSREQUESTV0 +_GETEVONODESPROPOSEDEPOCHBLOCKSBYIDSREQUEST.oneofs_by_name['version'].fields.append( + _GETEVONODESPROPOSEDEPOCHBLOCKSBYIDSREQUEST.fields_by_name['v0']) +_GETEVONODESPROPOSEDEPOCHBLOCKSBYIDSREQUEST.fields_by_name['v0'].containing_oneof = _GETEVONODESPROPOSEDEPOCHBLOCKSBYIDSREQUEST.oneofs_by_name['version'] +_GETEVONODESPROPOSEDEPOCHBLOCKSRESPONSE_GETEVONODESPROPOSEDEPOCHBLOCKSRESPONSEV0_EVONODEPROPOSEDBLOCKS.containing_type = _GETEVONODESPROPOSEDEPOCHBLOCKSRESPONSE_GETEVONODESPROPOSEDEPOCHBLOCKSRESPONSEV0 +_GETEVONODESPROPOSEDEPOCHBLOCKSRESPONSE_GETEVONODESPROPOSEDEPOCHBLOCKSRESPONSEV0_EVONODESPROPOSEDBLOCKS.fields_by_name['evonodes_proposed_block_counts'].message_type = _GETEVONODESPROPOSEDEPOCHBLOCKSRESPONSE_GETEVONODESPROPOSEDEPOCHBLOCKSRESPONSEV0_EVONODEPROPOSEDBLOCKS +_GETEVONODESPROPOSEDEPOCHBLOCKSRESPONSE_GETEVONODESPROPOSEDEPOCHBLOCKSRESPONSEV0_EVONODESPROPOSEDBLOCKS.containing_type = _GETEVONODESPROPOSEDEPOCHBLOCKSRESPONSE_GETEVONODESPROPOSEDEPOCHBLOCKSRESPONSEV0 +_GETEVONODESPROPOSEDEPOCHBLOCKSRESPONSE_GETEVONODESPROPOSEDEPOCHBLOCKSRESPONSEV0.fields_by_name['evonodes_proposed_block_counts_info'].message_type = _GETEVONODESPROPOSEDEPOCHBLOCKSRESPONSE_GETEVONODESPROPOSEDEPOCHBLOCKSRESPONSEV0_EVONODESPROPOSEDBLOCKS +_GETEVONODESPROPOSEDEPOCHBLOCKSRESPONSE_GETEVONODESPROPOSEDEPOCHBLOCKSRESPONSEV0.fields_by_name['proof'].message_type = _PROOF _GETEVONODESPROPOSEDEPOCHBLOCKSRESPONSE_GETEVONODESPROPOSEDEPOCHBLOCKSRESPONSEV0.fields_by_name['metadata'].message_type = _RESPONSEMETADATA _GETEVONODESPROPOSEDEPOCHBLOCKSRESPONSE_GETEVONODESPROPOSEDEPOCHBLOCKSRESPONSEV0.containing_type = _GETEVONODESPROPOSEDEPOCHBLOCKSRESPONSE _GETEVONODESPROPOSEDEPOCHBLOCKSRESPONSE_GETEVONODESPROPOSEDEPOCHBLOCKSRESPONSEV0.oneofs_by_name['result'].fields.append( @@ -24422,6 +25008,62 @@ _GETSHIELDEDNULLIFIERSRESPONSE.oneofs_by_name['version'].fields.append( _GETSHIELDEDNULLIFIERSRESPONSE.fields_by_name['v0']) _GETSHIELDEDNULLIFIERSRESPONSE.fields_by_name['v0'].containing_oneof = _GETSHIELDEDNULLIFIERSRESPONSE.oneofs_by_name['version'] +_SUBSCRIBETOSTATETRANSITIONSREQUEST_DOCUMENTFILTER_PRICECLAUSE.fields_by_name['operator'].enum_type = _GETDOCUMENTSREQUEST_WHEREOPERATOR +_SUBSCRIBETOSTATETRANSITIONSREQUEST_DOCUMENTFILTER_PRICECLAUSE.fields_by_name['value'].message_type = _GETDOCUMENTSREQUEST_DOCUMENTFIELDVALUE +_SUBSCRIBETOSTATETRANSITIONSREQUEST_DOCUMENTFILTER_PRICECLAUSE.containing_type = _SUBSCRIBETOSTATETRANSITIONSREQUEST_DOCUMENTFILTER +_SUBSCRIBETOSTATETRANSITIONSREQUEST_DOCUMENTFILTER_ACTIONMATCH.fields_by_name['action'].enum_type = _SUBSCRIBETOSTATETRANSITIONSREQUEST_DOCUMENTFILTER_ACTION +_SUBSCRIBETOSTATETRANSITIONSREQUEST_DOCUMENTFILTER_ACTIONMATCH.fields_by_name['new_document_where'].message_type = _GETDOCUMENTSREQUEST_WHERECLAUSE +_SUBSCRIBETOSTATETRANSITIONSREQUEST_DOCUMENTFILTER_ACTIONMATCH.fields_by_name['original_document_where'].message_type = _GETDOCUMENTSREQUEST_WHERECLAUSE +_SUBSCRIBETOSTATETRANSITIONSREQUEST_DOCUMENTFILTER_ACTIONMATCH.fields_by_name['price'].message_type = _SUBSCRIBETOSTATETRANSITIONSREQUEST_DOCUMENTFILTER_PRICECLAUSE +_SUBSCRIBETOSTATETRANSITIONSREQUEST_DOCUMENTFILTER_ACTIONMATCH.containing_type = _SUBSCRIBETOSTATETRANSITIONSREQUEST_DOCUMENTFILTER +_SUBSCRIBETOSTATETRANSITIONSREQUEST_DOCUMENTFILTER_ACTIONMATCH.oneofs_by_name['_action'].fields.append( + _SUBSCRIBETOSTATETRANSITIONSREQUEST_DOCUMENTFILTER_ACTIONMATCH.fields_by_name['action']) +_SUBSCRIBETOSTATETRANSITIONSREQUEST_DOCUMENTFILTER_ACTIONMATCH.fields_by_name['action'].containing_oneof = _SUBSCRIBETOSTATETRANSITIONSREQUEST_DOCUMENTFILTER_ACTIONMATCH.oneofs_by_name['_action'] +_SUBSCRIBETOSTATETRANSITIONSREQUEST_DOCUMENTFILTER.fields_by_name['actions'].message_type = _SUBSCRIBETOSTATETRANSITIONSREQUEST_DOCUMENTFILTER_ACTIONMATCH +_SUBSCRIBETOSTATETRANSITIONSREQUEST_DOCUMENTFILTER.containing_type = _SUBSCRIBETOSTATETRANSITIONSREQUEST +_SUBSCRIBETOSTATETRANSITIONSREQUEST_DOCUMENTFILTER_ACTION.containing_type = _SUBSCRIBETOSTATETRANSITIONSREQUEST_DOCUMENTFILTER +_SUBSCRIBETOSTATETRANSITIONSREQUEST_DOCUMENTFILTER.oneofs_by_name['_document_type_name'].fields.append( + _SUBSCRIBETOSTATETRANSITIONSREQUEST_DOCUMENTFILTER.fields_by_name['document_type_name']) +_SUBSCRIBETOSTATETRANSITIONSREQUEST_DOCUMENTFILTER.fields_by_name['document_type_name'].containing_oneof = _SUBSCRIBETOSTATETRANSITIONSREQUEST_DOCUMENTFILTER.oneofs_by_name['_document_type_name'] +_SUBSCRIBETOSTATETRANSITIONSREQUEST_DOCUMENTFILTER.oneofs_by_name['_batch_owner_id'].fields.append( + _SUBSCRIBETOSTATETRANSITIONSREQUEST_DOCUMENTFILTER.fields_by_name['batch_owner_id']) +_SUBSCRIBETOSTATETRANSITIONSREQUEST_DOCUMENTFILTER.fields_by_name['batch_owner_id'].containing_oneof = _SUBSCRIBETOSTATETRANSITIONSREQUEST_DOCUMENTFILTER.oneofs_by_name['_batch_owner_id'] +_SUBSCRIBETOSTATETRANSITIONSREQUEST_ADDRESSFILTER.fields_by_name['role'].enum_type = _SUBSCRIBETOSTATETRANSITIONSREQUEST_ROLE +_SUBSCRIBETOSTATETRANSITIONSREQUEST_ADDRESSFILTER.containing_type = _SUBSCRIBETOSTATETRANSITIONSREQUEST +_SUBSCRIBETOSTATETRANSITIONSREQUEST_STATETRANSITIONFILTER.fields_by_name['documents'].message_type = _SUBSCRIBETOSTATETRANSITIONSREQUEST_DOCUMENTFILTER +_SUBSCRIBETOSTATETRANSITIONSREQUEST_STATETRANSITIONFILTER.fields_by_name['addresses'].message_type = _SUBSCRIBETOSTATETRANSITIONSREQUEST_ADDRESSFILTER +_SUBSCRIBETOSTATETRANSITIONSREQUEST_STATETRANSITIONFILTER.containing_type = _SUBSCRIBETOSTATETRANSITIONSREQUEST +_SUBSCRIBETOSTATETRANSITIONSREQUEST_STATETRANSITIONFILTER.oneofs_by_name['filter'].fields.append( + _SUBSCRIBETOSTATETRANSITIONSREQUEST_STATETRANSITIONFILTER.fields_by_name['documents']) +_SUBSCRIBETOSTATETRANSITIONSREQUEST_STATETRANSITIONFILTER.fields_by_name['documents'].containing_oneof = _SUBSCRIBETOSTATETRANSITIONSREQUEST_STATETRANSITIONFILTER.oneofs_by_name['filter'] +_SUBSCRIBETOSTATETRANSITIONSREQUEST_STATETRANSITIONFILTER.oneofs_by_name['filter'].fields.append( + _SUBSCRIBETOSTATETRANSITIONSREQUEST_STATETRANSITIONFILTER.fields_by_name['addresses']) +_SUBSCRIBETOSTATETRANSITIONSREQUEST_STATETRANSITIONFILTER.fields_by_name['addresses'].containing_oneof = _SUBSCRIBETOSTATETRANSITIONSREQUEST_STATETRANSITIONFILTER.oneofs_by_name['filter'] +_SUBSCRIBETOSTATETRANSITIONSREQUEST_SUBSCRIBETOSTATETRANSITIONSREQUESTV0.fields_by_name['filters'].message_type = _SUBSCRIBETOSTATETRANSITIONSREQUEST_STATETRANSITIONFILTER +_SUBSCRIBETOSTATETRANSITIONSREQUEST_SUBSCRIBETOSTATETRANSITIONSREQUESTV0.containing_type = _SUBSCRIBETOSTATETRANSITIONSREQUEST +_SUBSCRIBETOSTATETRANSITIONSREQUEST_SUBSCRIBETOSTATETRANSITIONSREQUESTV0.oneofs_by_name['_from_block_height'].fields.append( + _SUBSCRIBETOSTATETRANSITIONSREQUEST_SUBSCRIBETOSTATETRANSITIONSREQUESTV0.fields_by_name['from_block_height']) +_SUBSCRIBETOSTATETRANSITIONSREQUEST_SUBSCRIBETOSTATETRANSITIONSREQUESTV0.fields_by_name['from_block_height'].containing_oneof = _SUBSCRIBETOSTATETRANSITIONSREQUEST_SUBSCRIBETOSTATETRANSITIONSREQUESTV0.oneofs_by_name['_from_block_height'] +_SUBSCRIBETOSTATETRANSITIONSREQUEST.fields_by_name['v0'].message_type = _SUBSCRIBETOSTATETRANSITIONSREQUEST_SUBSCRIBETOSTATETRANSITIONSREQUESTV0 +_SUBSCRIBETOSTATETRANSITIONSREQUEST_ROLE.containing_type = _SUBSCRIBETOSTATETRANSITIONSREQUEST +_SUBSCRIBETOSTATETRANSITIONSREQUEST.oneofs_by_name['version'].fields.append( + _SUBSCRIBETOSTATETRANSITIONSREQUEST.fields_by_name['v0']) +_SUBSCRIBETOSTATETRANSITIONSREQUEST.fields_by_name['v0'].containing_oneof = _SUBSCRIBETOSTATETRANSITIONSREQUEST.oneofs_by_name['version'] +_SUBSCRIBETOSTATETRANSITIONSRESPONSE_SUBSCRIBETOSTATETRANSITIONSRESPONSEV0_STATETRANSITIONMATCH.containing_type = _SUBSCRIBETOSTATETRANSITIONSRESPONSE_SUBSCRIBETOSTATETRANSITIONSRESPONSEV0 +_SUBSCRIBETOSTATETRANSITIONSRESPONSE_SUBSCRIBETOSTATETRANSITIONSRESPONSEV0_CHECKPOINT.containing_type = _SUBSCRIBETOSTATETRANSITIONSRESPONSE_SUBSCRIBETOSTATETRANSITIONSRESPONSEV0 +_SUBSCRIBETOSTATETRANSITIONSRESPONSE_SUBSCRIBETOSTATETRANSITIONSRESPONSEV0.fields_by_name['state_transition'].message_type = _SUBSCRIBETOSTATETRANSITIONSRESPONSE_SUBSCRIBETOSTATETRANSITIONSRESPONSEV0_STATETRANSITIONMATCH +_SUBSCRIBETOSTATETRANSITIONSRESPONSE_SUBSCRIBETOSTATETRANSITIONSRESPONSEV0.fields_by_name['checkpoint'].message_type = _SUBSCRIBETOSTATETRANSITIONSRESPONSE_SUBSCRIBETOSTATETRANSITIONSRESPONSEV0_CHECKPOINT +_SUBSCRIBETOSTATETRANSITIONSRESPONSE_SUBSCRIBETOSTATETRANSITIONSRESPONSEV0.containing_type = _SUBSCRIBETOSTATETRANSITIONSRESPONSE +_SUBSCRIBETOSTATETRANSITIONSRESPONSE_SUBSCRIBETOSTATETRANSITIONSRESPONSEV0.oneofs_by_name['responses'].fields.append( + _SUBSCRIBETOSTATETRANSITIONSRESPONSE_SUBSCRIBETOSTATETRANSITIONSRESPONSEV0.fields_by_name['state_transition']) +_SUBSCRIBETOSTATETRANSITIONSRESPONSE_SUBSCRIBETOSTATETRANSITIONSRESPONSEV0.fields_by_name['state_transition'].containing_oneof = _SUBSCRIBETOSTATETRANSITIONSRESPONSE_SUBSCRIBETOSTATETRANSITIONSRESPONSEV0.oneofs_by_name['responses'] +_SUBSCRIBETOSTATETRANSITIONSRESPONSE_SUBSCRIBETOSTATETRANSITIONSRESPONSEV0.oneofs_by_name['responses'].fields.append( + _SUBSCRIBETOSTATETRANSITIONSRESPONSE_SUBSCRIBETOSTATETRANSITIONSRESPONSEV0.fields_by_name['checkpoint']) +_SUBSCRIBETOSTATETRANSITIONSRESPONSE_SUBSCRIBETOSTATETRANSITIONSRESPONSEV0.fields_by_name['checkpoint'].containing_oneof = _SUBSCRIBETOSTATETRANSITIONSRESPONSE_SUBSCRIBETOSTATETRANSITIONSRESPONSEV0.oneofs_by_name['responses'] +_SUBSCRIBETOSTATETRANSITIONSRESPONSE.fields_by_name['v0'].message_type = _SUBSCRIBETOSTATETRANSITIONSRESPONSE_SUBSCRIBETOSTATETRANSITIONSRESPONSEV0 +_SUBSCRIBETOSTATETRANSITIONSRESPONSE.oneofs_by_name['version'].fields.append( + _SUBSCRIBETOSTATETRANSITIONSRESPONSE.fields_by_name['v0']) +_SUBSCRIBETOSTATETRANSITIONSRESPONSE.fields_by_name['v0'].containing_oneof = _SUBSCRIBETOSTATETRANSITIONSRESPONSE.oneofs_by_name['version'] DESCRIPTOR.message_types_by_name['Proof'] = _PROOF DESCRIPTOR.message_types_by_name['ResponseMetadata'] = _RESPONSEMETADATA DESCRIPTOR.message_types_by_name['StateTransitionBroadcastError'] = _STATETRANSITIONBROADCASTERROR @@ -24590,6 +25232,8 @@ DESCRIPTOR.message_types_by_name['GetShieldedNotesCountResponse'] = _GETSHIELDEDNOTESCOUNTRESPONSE DESCRIPTOR.message_types_by_name['GetShieldedNullifiersRequest'] = _GETSHIELDEDNULLIFIERSREQUEST DESCRIPTOR.message_types_by_name['GetShieldedNullifiersResponse'] = _GETSHIELDEDNULLIFIERSRESPONSE +DESCRIPTOR.message_types_by_name['SubscribeToStateTransitionsRequest'] = _SUBSCRIBETOSTATETRANSITIONSREQUEST +DESCRIPTOR.message_types_by_name['SubscribeToStateTransitionsResponse'] = _SUBSCRIBETOSTATETRANSITIONSRESPONSE DESCRIPTOR.enum_types_by_name['KeyPurpose'] = _KEYPURPOSE DESCRIPTOR.enum_types_by_name['ContractModerationList'] = _CONTRACTMODERATIONLIST _sym_db.RegisterFileDescriptor(DESCRIPTOR) @@ -28394,6 +29038,92 @@ _sym_db.RegisterMessage(GetShieldedNullifiersResponse.GetShieldedNullifiersResponseV0.NullifierStatus) _sym_db.RegisterMessage(GetShieldedNullifiersResponse.GetShieldedNullifiersResponseV0.NullifierStatuses) +SubscribeToStateTransitionsRequest = _reflection.GeneratedProtocolMessageType('SubscribeToStateTransitionsRequest', (_message.Message,), { + + 'DocumentFilter' : _reflection.GeneratedProtocolMessageType('DocumentFilter', (_message.Message,), { + + 'PriceClause' : _reflection.GeneratedProtocolMessageType('PriceClause', (_message.Message,), { + 'DESCRIPTOR' : _SUBSCRIBETOSTATETRANSITIONSREQUEST_DOCUMENTFILTER_PRICECLAUSE, + '__module__' : 'platform_pb2' + # @@protoc_insertion_point(class_scope:org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.PriceClause) + }) + , + + 'ActionMatch' : _reflection.GeneratedProtocolMessageType('ActionMatch', (_message.Message,), { + 'DESCRIPTOR' : _SUBSCRIBETOSTATETRANSITIONSREQUEST_DOCUMENTFILTER_ACTIONMATCH, + '__module__' : 'platform_pb2' + # @@protoc_insertion_point(class_scope:org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch) + }) + , + 'DESCRIPTOR' : _SUBSCRIBETOSTATETRANSITIONSREQUEST_DOCUMENTFILTER, + '__module__' : 'platform_pb2' + # @@protoc_insertion_point(class_scope:org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter) + }) + , + + 'AddressFilter' : _reflection.GeneratedProtocolMessageType('AddressFilter', (_message.Message,), { + 'DESCRIPTOR' : _SUBSCRIBETOSTATETRANSITIONSREQUEST_ADDRESSFILTER, + '__module__' : 'platform_pb2' + # @@protoc_insertion_point(class_scope:org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.AddressFilter) + }) + , + + 'StateTransitionFilter' : _reflection.GeneratedProtocolMessageType('StateTransitionFilter', (_message.Message,), { + 'DESCRIPTOR' : _SUBSCRIBETOSTATETRANSITIONSREQUEST_STATETRANSITIONFILTER, + '__module__' : 'platform_pb2' + # @@protoc_insertion_point(class_scope:org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter) + }) + , + + 'SubscribeToStateTransitionsRequestV0' : _reflection.GeneratedProtocolMessageType('SubscribeToStateTransitionsRequestV0', (_message.Message,), { + 'DESCRIPTOR' : _SUBSCRIBETOSTATETRANSITIONSREQUEST_SUBSCRIBETOSTATETRANSITIONSREQUESTV0, + '__module__' : 'platform_pb2' + # @@protoc_insertion_point(class_scope:org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0) + }) + , + 'DESCRIPTOR' : _SUBSCRIBETOSTATETRANSITIONSREQUEST, + '__module__' : 'platform_pb2' + # @@protoc_insertion_point(class_scope:org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest) + }) +_sym_db.RegisterMessage(SubscribeToStateTransitionsRequest) +_sym_db.RegisterMessage(SubscribeToStateTransitionsRequest.DocumentFilter) +_sym_db.RegisterMessage(SubscribeToStateTransitionsRequest.DocumentFilter.PriceClause) +_sym_db.RegisterMessage(SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch) +_sym_db.RegisterMessage(SubscribeToStateTransitionsRequest.AddressFilter) +_sym_db.RegisterMessage(SubscribeToStateTransitionsRequest.StateTransitionFilter) +_sym_db.RegisterMessage(SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0) + +SubscribeToStateTransitionsResponse = _reflection.GeneratedProtocolMessageType('SubscribeToStateTransitionsResponse', (_message.Message,), { + + 'SubscribeToStateTransitionsResponseV0' : _reflection.GeneratedProtocolMessageType('SubscribeToStateTransitionsResponseV0', (_message.Message,), { + + 'StateTransitionMatch' : _reflection.GeneratedProtocolMessageType('StateTransitionMatch', (_message.Message,), { + 'DESCRIPTOR' : _SUBSCRIBETOSTATETRANSITIONSRESPONSE_SUBSCRIBETOSTATETRANSITIONSRESPONSEV0_STATETRANSITIONMATCH, + '__module__' : 'platform_pb2' + # @@protoc_insertion_point(class_scope:org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch) + }) + , + + 'Checkpoint' : _reflection.GeneratedProtocolMessageType('Checkpoint', (_message.Message,), { + 'DESCRIPTOR' : _SUBSCRIBETOSTATETRANSITIONSRESPONSE_SUBSCRIBETOSTATETRANSITIONSRESPONSEV0_CHECKPOINT, + '__module__' : 'platform_pb2' + # @@protoc_insertion_point(class_scope:org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.Checkpoint) + }) + , + 'DESCRIPTOR' : _SUBSCRIBETOSTATETRANSITIONSRESPONSE_SUBSCRIBETOSTATETRANSITIONSRESPONSEV0, + '__module__' : 'platform_pb2' + # @@protoc_insertion_point(class_scope:org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0) + }) + , + 'DESCRIPTOR' : _SUBSCRIBETOSTATETRANSITIONSRESPONSE, + '__module__' : 'platform_pb2' + # @@protoc_insertion_point(class_scope:org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse) + }) +_sym_db.RegisterMessage(SubscribeToStateTransitionsResponse) +_sym_db.RegisterMessage(SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0) +_sym_db.RegisterMessage(SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch) +_sym_db.RegisterMessage(SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.Checkpoint) + _RESPONSEMETADATA.fields_by_name['height']._options = None _RESPONSEMETADATA.fields_by_name['time_ms']._options = None @@ -28477,6 +29207,10 @@ _GETRECENTCOMPACTEDADDRESSBALANCECHANGESREQUEST_GETRECENTCOMPACTEDADDRESSBALANCECHANGESREQUESTV0.fields_by_name['start_block_height']._options = None _GETSHIELDEDPOOLSTATERESPONSE_GETSHIELDEDPOOLSTATERESPONSEV0.fields_by_name['total_balance']._options = None _GETSHIELDEDNOTESCOUNTRESPONSE_GETSHIELDEDNOTESCOUNTRESPONSEV0.fields_by_name['total_notes_count']._options = None +_SUBSCRIBETOSTATETRANSITIONSREQUEST_SUBSCRIBETOSTATETRANSITIONSREQUESTV0.fields_by_name['from_block_height']._options = None +_SUBSCRIBETOSTATETRANSITIONSRESPONSE_SUBSCRIBETOSTATETRANSITIONSRESPONSEV0_STATETRANSITIONMATCH.fields_by_name['block_height']._options = None +_SUBSCRIBETOSTATETRANSITIONSRESPONSE_SUBSCRIBETOSTATETRANSITIONSRESPONSEV0_STATETRANSITIONMATCH.fields_by_name['block_time_ms']._options = None +_SUBSCRIBETOSTATETRANSITIONSRESPONSE_SUBSCRIBETOSTATETRANSITIONSRESPONSEV0_CHECKPOINT.fields_by_name['block_height']._options = None _PLATFORM = _descriptor.ServiceDescriptor( name='Platform', @@ -28485,8 +29219,8 @@ index=0, serialized_options=None, create_key=_descriptor._internal_create_key, - serialized_start=84329, - serialized_end=95132, + serialized_start=86823, + serialized_end=97787, methods=[ _descriptor.MethodDescriptor( name='broadcastStateTransition', @@ -29218,6 +29952,16 @@ serialized_options=None, create_key=_descriptor._internal_create_key, ), + _descriptor.MethodDescriptor( + name='subscribeToStateTransitions', + full_name='org.dash.platform.dapi.v0.Platform.subscribeToStateTransitions', + index=73, + containing_service=None, + input_type=_SUBSCRIBETOSTATETRANSITIONSREQUEST, + output_type=_SUBSCRIBETOSTATETRANSITIONSRESPONSE, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), ]) _sym_db.RegisterServiceDescriptor(_PLATFORM) 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 675f32eab08..4113736545c 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 @@ -379,6 +379,11 @@ def __init__(self, channel): request_serializer=platform__pb2.GetShieldedNullifiersRequest.SerializeToString, response_deserializer=platform__pb2.GetShieldedNullifiersResponse.FromString, ) + self.subscribeToStateTransitions = channel.unary_stream( + '/org.dash.platform.dapi.v0.Platform/subscribeToStateTransitions', + request_serializer=platform__pb2.SubscribeToStateTransitionsRequest.SerializeToString, + response_deserializer=platform__pb2.SubscribeToStateTransitionsResponse.FromString, + ) class PlatformServicer(object): @@ -829,6 +834,16 @@ def getShieldedNullifiers(self, request, context): context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') + def subscribeToStateTransitions(self, request, context): + """Streams every committed, successfully executed state transition that matches + one of the request's filters, block by block, from a chosen height onward. + Served by DAPI from the Tenderdash block store; see + `SubscribeToStateTransitionsResponse` for the stream contract. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + def add_PlatformServicer_to_server(servicer, server): rpc_method_handlers = { @@ -1197,6 +1212,11 @@ def add_PlatformServicer_to_server(servicer, server): request_deserializer=platform__pb2.GetShieldedNullifiersRequest.FromString, response_serializer=platform__pb2.GetShieldedNullifiersResponse.SerializeToString, ), + 'subscribeToStateTransitions': grpc.unary_stream_rpc_method_handler( + servicer.subscribeToStateTransitions, + request_deserializer=platform__pb2.SubscribeToStateTransitionsRequest.FromString, + response_serializer=platform__pb2.SubscribeToStateTransitionsResponse.SerializeToString, + ), } generic_handler = grpc.method_handlers_generic_handler( 'org.dash.platform.dapi.v0.Platform', rpc_method_handlers) @@ -2447,3 +2467,20 @@ def getShieldedNullifiers(request, platform__pb2.GetShieldedNullifiersResponse.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + + @staticmethod + def subscribeToStateTransitions(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_stream(request, target, '/org.dash.platform.dapi.v0.Platform/subscribeToStateTransitions', + platform__pb2.SubscribeToStateTransitionsRequest.SerializeToString, + platform__pb2.SubscribeToStateTransitionsResponse.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) 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 8fd21f90aae..48bbdd9f146 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 @@ -15810,6 +15810,395 @@ export namespace GetShieldedNullifiersResponse { } } +export class SubscribeToStateTransitionsRequest extends jspb.Message { + hasV0(): boolean; + clearV0(): void; + getV0(): SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0 | undefined; + setV0(value?: SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0): void; + + getVersionCase(): SubscribeToStateTransitionsRequest.VersionCase; + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): SubscribeToStateTransitionsRequest.AsObject; + static toObject(includeInstance: boolean, msg: SubscribeToStateTransitionsRequest): SubscribeToStateTransitionsRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: SubscribeToStateTransitionsRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): SubscribeToStateTransitionsRequest; + static deserializeBinaryFromReader(message: SubscribeToStateTransitionsRequest, reader: jspb.BinaryReader): SubscribeToStateTransitionsRequest; +} + +export namespace SubscribeToStateTransitionsRequest { + export type AsObject = { + v0?: SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0.AsObject, + } + + export class DocumentFilter extends jspb.Message { + getDataContractId(): Uint8Array | string; + getDataContractId_asU8(): Uint8Array; + getDataContractId_asB64(): string; + setDataContractId(value: Uint8Array | string): void; + + hasDocumentTypeName(): boolean; + clearDocumentTypeName(): void; + getDocumentTypeName(): string; + setDocumentTypeName(value: string): void; + + clearActionsList(): void; + getActionsList(): Array; + setActionsList(value: Array): void; + addActions(value?: SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch, index?: number): SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch; + + hasBatchOwnerId(): boolean; + clearBatchOwnerId(): void; + getBatchOwnerId(): Uint8Array | string; + getBatchOwnerId_asU8(): Uint8Array; + getBatchOwnerId_asB64(): string; + setBatchOwnerId(value: Uint8Array | string): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): DocumentFilter.AsObject; + static toObject(includeInstance: boolean, msg: DocumentFilter): DocumentFilter.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: DocumentFilter, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): DocumentFilter; + static deserializeBinaryFromReader(message: DocumentFilter, reader: jspb.BinaryReader): DocumentFilter; + } + + export namespace DocumentFilter { + export type AsObject = { + dataContractId: Uint8Array | string, + documentTypeName: string, + actionsList: Array, + batchOwnerId: Uint8Array | string, + } + + export class PriceClause extends jspb.Message { + getOperator(): GetDocumentsRequest.WhereOperatorMap[keyof GetDocumentsRequest.WhereOperatorMap]; + setOperator(value: GetDocumentsRequest.WhereOperatorMap[keyof GetDocumentsRequest.WhereOperatorMap]): void; + + hasValue(): boolean; + clearValue(): void; + getValue(): GetDocumentsRequest.DocumentFieldValue | undefined; + setValue(value?: GetDocumentsRequest.DocumentFieldValue): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): PriceClause.AsObject; + static toObject(includeInstance: boolean, msg: PriceClause): PriceClause.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: PriceClause, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): PriceClause; + static deserializeBinaryFromReader(message: PriceClause, reader: jspb.BinaryReader): PriceClause; + } + + export namespace PriceClause { + export type AsObject = { + operator: GetDocumentsRequest.WhereOperatorMap[keyof GetDocumentsRequest.WhereOperatorMap], + value?: GetDocumentsRequest.DocumentFieldValue.AsObject, + } + } + + export class ActionMatch extends jspb.Message { + hasAction(): boolean; + clearAction(): void; + getAction(): SubscribeToStateTransitionsRequest.DocumentFilter.ActionMap[keyof SubscribeToStateTransitionsRequest.DocumentFilter.ActionMap]; + setAction(value: SubscribeToStateTransitionsRequest.DocumentFilter.ActionMap[keyof SubscribeToStateTransitionsRequest.DocumentFilter.ActionMap]): void; + + clearNewDocumentWhereList(): void; + getNewDocumentWhereList(): Array; + setNewDocumentWhereList(value: Array): void; + addNewDocumentWhere(value?: GetDocumentsRequest.WhereClause, index?: number): GetDocumentsRequest.WhereClause; + + clearOriginalDocumentWhereList(): void; + getOriginalDocumentWhereList(): Array; + setOriginalDocumentWhereList(value: Array): void; + addOriginalDocumentWhere(value?: GetDocumentsRequest.WhereClause, index?: number): GetDocumentsRequest.WhereClause; + + clearOwnerIdsList(): void; + getOwnerIdsList(): Array; + getOwnerIdsList_asU8(): Array; + getOwnerIdsList_asB64(): Array; + setOwnerIdsList(value: Array): void; + addOwnerIds(value: Uint8Array | string, index?: number): Uint8Array | string; + + hasPrice(): boolean; + clearPrice(): void; + getPrice(): SubscribeToStateTransitionsRequest.DocumentFilter.PriceClause | undefined; + setPrice(value?: SubscribeToStateTransitionsRequest.DocumentFilter.PriceClause): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): ActionMatch.AsObject; + static toObject(includeInstance: boolean, msg: ActionMatch): ActionMatch.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: ActionMatch, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): ActionMatch; + static deserializeBinaryFromReader(message: ActionMatch, reader: jspb.BinaryReader): ActionMatch; + } + + export namespace ActionMatch { + export type AsObject = { + action: SubscribeToStateTransitionsRequest.DocumentFilter.ActionMap[keyof SubscribeToStateTransitionsRequest.DocumentFilter.ActionMap], + newDocumentWhereList: Array, + originalDocumentWhereList: Array, + ownerIdsList: Array, + price?: SubscribeToStateTransitionsRequest.DocumentFilter.PriceClause.AsObject, + } + } + + export interface ActionMap { + CREATE: 0; + REPLACE: 1; + DELETE: 2; + TRANSFER: 3; + UPDATE_PRICE: 4; + PURCHASE: 5; + } + + export const Action: ActionMap; + } + + export class AddressFilter extends jspb.Message { + clearAddressesList(): void; + getAddressesList(): Array; + getAddressesList_asU8(): Array; + getAddressesList_asB64(): Array; + setAddressesList(value: Array): void; + addAddresses(value: Uint8Array | string, index?: number): Uint8Array | string; + + getRole(): SubscribeToStateTransitionsRequest.RoleMap[keyof SubscribeToStateTransitionsRequest.RoleMap]; + setRole(value: SubscribeToStateTransitionsRequest.RoleMap[keyof SubscribeToStateTransitionsRequest.RoleMap]): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): AddressFilter.AsObject; + static toObject(includeInstance: boolean, msg: AddressFilter): AddressFilter.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: AddressFilter, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): AddressFilter; + static deserializeBinaryFromReader(message: AddressFilter, reader: jspb.BinaryReader): AddressFilter; + } + + export namespace AddressFilter { + export type AsObject = { + addressesList: Array, + role: SubscribeToStateTransitionsRequest.RoleMap[keyof SubscribeToStateTransitionsRequest.RoleMap], + } + } + + export class StateTransitionFilter extends jspb.Message { + hasDocuments(): boolean; + clearDocuments(): void; + getDocuments(): SubscribeToStateTransitionsRequest.DocumentFilter | undefined; + setDocuments(value?: SubscribeToStateTransitionsRequest.DocumentFilter): void; + + hasAddresses(): boolean; + clearAddresses(): void; + getAddresses(): SubscribeToStateTransitionsRequest.AddressFilter | undefined; + setAddresses(value?: SubscribeToStateTransitionsRequest.AddressFilter): void; + + getFilterCase(): StateTransitionFilter.FilterCase; + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): StateTransitionFilter.AsObject; + static toObject(includeInstance: boolean, msg: StateTransitionFilter): StateTransitionFilter.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: StateTransitionFilter, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): StateTransitionFilter; + static deserializeBinaryFromReader(message: StateTransitionFilter, reader: jspb.BinaryReader): StateTransitionFilter; + } + + export namespace StateTransitionFilter { + export type AsObject = { + documents?: SubscribeToStateTransitionsRequest.DocumentFilter.AsObject, + addresses?: SubscribeToStateTransitionsRequest.AddressFilter.AsObject, + } + + export enum FilterCase { + FILTER_NOT_SET = 0, + DOCUMENTS = 1, + ADDRESSES = 2, + } + } + + export class SubscribeToStateTransitionsRequestV0 extends jspb.Message { + clearFiltersList(): void; + getFiltersList(): Array; + setFiltersList(value: Array): void; + addFilters(value?: SubscribeToStateTransitionsRequest.StateTransitionFilter, index?: number): SubscribeToStateTransitionsRequest.StateTransitionFilter; + + hasFromBlockHeight(): boolean; + clearFromBlockHeight(): void; + getFromBlockHeight(): string; + setFromBlockHeight(value: string): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): SubscribeToStateTransitionsRequestV0.AsObject; + static toObject(includeInstance: boolean, msg: SubscribeToStateTransitionsRequestV0): SubscribeToStateTransitionsRequestV0.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: SubscribeToStateTransitionsRequestV0, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): SubscribeToStateTransitionsRequestV0; + static deserializeBinaryFromReader(message: SubscribeToStateTransitionsRequestV0, reader: jspb.BinaryReader): SubscribeToStateTransitionsRequestV0; + } + + export namespace SubscribeToStateTransitionsRequestV0 { + export type AsObject = { + filtersList: Array, + fromBlockHeight: string, + } + } + + export interface RoleMap { + ANY: 0; + SENDER: 1; + RECIPIENT: 2; + } + + export const Role: RoleMap; + + export enum VersionCase { + VERSION_NOT_SET = 0, + V0 = 1, + } +} + +export class SubscribeToStateTransitionsResponse extends jspb.Message { + hasV0(): boolean; + clearV0(): void; + getV0(): SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0 | undefined; + setV0(value?: SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0): void; + + getVersionCase(): SubscribeToStateTransitionsResponse.VersionCase; + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): SubscribeToStateTransitionsResponse.AsObject; + static toObject(includeInstance: boolean, msg: SubscribeToStateTransitionsResponse): SubscribeToStateTransitionsResponse.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: SubscribeToStateTransitionsResponse, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): SubscribeToStateTransitionsResponse; + static deserializeBinaryFromReader(message: SubscribeToStateTransitionsResponse, reader: jspb.BinaryReader): SubscribeToStateTransitionsResponse; +} + +export namespace SubscribeToStateTransitionsResponse { + export type AsObject = { + v0?: SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.AsObject, + } + + export class SubscribeToStateTransitionsResponseV0 extends jspb.Message { + hasStateTransition(): boolean; + clearStateTransition(): void; + getStateTransition(): SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch | undefined; + setStateTransition(value?: SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch): void; + + hasCheckpoint(): boolean; + clearCheckpoint(): void; + getCheckpoint(): SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.Checkpoint | undefined; + setCheckpoint(value?: SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.Checkpoint): void; + + getResponsesCase(): SubscribeToStateTransitionsResponseV0.ResponsesCase; + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): SubscribeToStateTransitionsResponseV0.AsObject; + static toObject(includeInstance: boolean, msg: SubscribeToStateTransitionsResponseV0): SubscribeToStateTransitionsResponseV0.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: SubscribeToStateTransitionsResponseV0, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): SubscribeToStateTransitionsResponseV0; + static deserializeBinaryFromReader(message: SubscribeToStateTransitionsResponseV0, reader: jspb.BinaryReader): SubscribeToStateTransitionsResponseV0; + } + + export namespace SubscribeToStateTransitionsResponseV0 { + export type AsObject = { + stateTransition?: SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch.AsObject, + checkpoint?: SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.Checkpoint.AsObject, + } + + export class StateTransitionMatch extends jspb.Message { + getBlockHeight(): string; + setBlockHeight(value: string): void; + + getBlockTimeMs(): string; + setBlockTimeMs(value: string): void; + + getProtocolVersion(): number; + setProtocolVersion(value: number): void; + + getStateTransitionHash(): Uint8Array | string; + getStateTransitionHash_asU8(): Uint8Array; + getStateTransitionHash_asB64(): string; + setStateTransitionHash(value: Uint8Array | string): void; + + getStateTransition(): Uint8Array | string; + getStateTransition_asU8(): Uint8Array; + getStateTransition_asB64(): string; + setStateTransition(value: Uint8Array | string): void; + + clearMatchedFiltersList(): void; + getMatchedFiltersList(): Array; + setMatchedFiltersList(value: Array): void; + addMatchedFilters(value: number, index?: number): number; + + clearMatchedBatchPositionsList(): void; + getMatchedBatchPositionsList(): Array; + setMatchedBatchPositionsList(value: Array): void; + addMatchedBatchPositions(value: number, index?: number): number; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): StateTransitionMatch.AsObject; + static toObject(includeInstance: boolean, msg: StateTransitionMatch): StateTransitionMatch.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: StateTransitionMatch, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): StateTransitionMatch; + static deserializeBinaryFromReader(message: StateTransitionMatch, reader: jspb.BinaryReader): StateTransitionMatch; + } + + export namespace StateTransitionMatch { + export type AsObject = { + blockHeight: string, + blockTimeMs: string, + protocolVersion: number, + stateTransitionHash: Uint8Array | string, + stateTransition: Uint8Array | string, + matchedFiltersList: Array, + matchedBatchPositionsList: Array, + } + } + + export class Checkpoint extends jspb.Message { + getBlockHeight(): string; + setBlockHeight(value: string): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): Checkpoint.AsObject; + static toObject(includeInstance: boolean, msg: Checkpoint): Checkpoint.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: Checkpoint, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): Checkpoint; + static deserializeBinaryFromReader(message: Checkpoint, reader: jspb.BinaryReader): Checkpoint; + } + + export namespace Checkpoint { + export type AsObject = { + blockHeight: string, + } + } + + export enum ResponsesCase { + RESPONSES_NOT_SET = 0, + STATE_TRANSITION = 1, + CHECKPOINT = 2, + } + } + + export enum VersionCase { + VERSION_NOT_SET = 0, + V0 = 1, + } +} + export interface KeyPurposeMap { AUTHENTICATION: 0; ENCRYPTION: 1; 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 24d96987cdc..45ba767b102 100644 --- a/packages/dapi-grpc/clients/platform/v0/web/platform_pb.js +++ b/packages/dapi-grpc/clients/platform/v0/web/platform_pb.js @@ -758,6 +758,23 @@ goog.exportSymbol('proto.org.dash.platform.dapi.v0.SecurityLevelMap', null, { pr goog.exportSymbol('proto.org.dash.platform.dapi.v0.SecurityLevelMap.KeyKindRequestType', null, { proto }); goog.exportSymbol('proto.org.dash.platform.dapi.v0.SpecificKeys', null, { proto }); goog.exportSymbol('proto.org.dash.platform.dapi.v0.StateTransitionBroadcastError', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.AddressFilter', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.Action', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.PriceClause', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.Role', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter.FilterCase', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.VersionCase', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.Checkpoint', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.ResponsesCase', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.VersionCase', null, { proto }); goog.exportSymbol('proto.org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest', null, { proto }); goog.exportSymbol('proto.org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.VersionCase', null, { proto }); goog.exportSymbol('proto.org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0', null, { proto }); @@ -11140,6 +11157,237 @@ if (goog.DEBUG && !COMPILED) { */ proto.org.dash.platform.dapi.v0.GetShieldedNullifiersResponse.GetShieldedNullifiersResponseV0.NullifierStatuses.displayName = 'proto.org.dash.platform.dapi.v0.GetShieldedNullifiersResponse.GetShieldedNullifiersResponseV0.NullifierStatuses'; } +/** + * 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.SubscribeToStateTransitionsRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.oneofGroups_); +}; +goog.inherits(proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.displayName = 'proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest'; +} +/** + * 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.SubscribeToStateTransitionsRequest.DocumentFilter = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.repeatedFields_, null); +}; +goog.inherits(proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.displayName = 'proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter'; +} +/** + * 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.SubscribeToStateTransitionsRequest.DocumentFilter.PriceClause = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.PriceClause, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.PriceClause.displayName = 'proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.PriceClause'; +} +/** + * 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.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch.repeatedFields_, null); +}; +goog.inherits(proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch.displayName = 'proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch'; +} +/** + * 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.SubscribeToStateTransitionsRequest.AddressFilter = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.AddressFilter.repeatedFields_, null); +}; +goog.inherits(proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.AddressFilter, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.AddressFilter.displayName = 'proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.AddressFilter'; +} +/** + * 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.SubscribeToStateTransitionsRequest.StateTransitionFilter = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter.oneofGroups_); +}; +goog.inherits(proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter.displayName = 'proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter'; +} +/** + * 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.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0 = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0.repeatedFields_, null); +}; +goog.inherits(proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0.displayName = 'proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0'; +} +/** + * 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.SubscribeToStateTransitionsResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.oneofGroups_); +}; +goog.inherits(proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.displayName = 'proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse'; +} +/** + * 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.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0 = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.oneofGroups_); +}; +goog.inherits(proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.displayName = 'proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0'; +} +/** + * 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.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch.repeatedFields_, null); +}; +goog.inherits(proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch.displayName = 'proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch'; +} +/** + * 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.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.Checkpoint = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.Checkpoint, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.Checkpoint.displayName = 'proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.Checkpoint'; +} @@ -119936,6 +120184,2690 @@ proto.org.dash.platform.dapi.v0.GetShieldedNullifiersResponse.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.SubscribeToStateTransitionsRequest.oneofGroups_ = [[1]]; + +/** + * @enum {number} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.VersionCase = { + VERSION_NOT_SET: 0, + V0: 1 +}; + +/** + * @return {proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.VersionCase} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.prototype.getVersionCase = function() { + return /** @type {proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.VersionCase} */(jspb.Message.computeOneofCase(this, proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.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.SubscribeToStateTransitionsRequest.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.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.SubscribeToStateTransitionsRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.toObject = function(includeInstance, msg) { + var f, obj = { + v0: (f = msg.getV0()) && proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0.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.SubscribeToStateTransitionsRequest} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest; + return proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.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.SubscribeToStateTransitionsRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.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.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0.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.SubscribeToStateTransitionsRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.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.SubscribeToStateTransitionsRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getV0(); + if (f != null) { + writer.writeMessage( + 1, + f, + proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0.serializeBinaryToWriter + ); + } +}; + + +/** + * @enum {number} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.Role = { + ANY: 0, + SENDER: 1, + RECIPIENT: 2 +}; + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.repeatedFields_ = [3]; + + + +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.SubscribeToStateTransitionsRequest.DocumentFilter.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.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.SubscribeToStateTransitionsRequest.DocumentFilter} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.toObject = function(includeInstance, msg) { + var f, obj = { + dataContractId: msg.getDataContractId_asB64(), + documentTypeName: jspb.Message.getFieldWithDefault(msg, 2, ""), + actionsList: jspb.Message.toObjectList(msg.getActionsList(), + proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch.toObject, includeInstance), + batchOwnerId: msg.getBatchOwnerId_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.SubscribeToStateTransitionsRequest.DocumentFilter} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter; + return proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.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.SubscribeToStateTransitionsRequest.DocumentFilter} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.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.setDataContractId(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setDocumentTypeName(value); + break; + case 3: + var value = new proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch.deserializeBinaryFromReader); + msg.addActions(value); + break; + case 4: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setBatchOwnerId(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.SubscribeToStateTransitionsRequest.DocumentFilter.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.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.SubscribeToStateTransitionsRequest.DocumentFilter} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getDataContractId_asU8(); + if (f.length > 0) { + writer.writeBytes( + 1, + f + ); + } + f = /** @type {string} */ (jspb.Message.getField(message, 2)); + if (f != null) { + writer.writeString( + 2, + f + ); + } + f = message.getActionsList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 3, + f, + proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch.serializeBinaryToWriter + ); + } + f = /** @type {!(string|Uint8Array)} */ (jspb.Message.getField(message, 4)); + if (f != null) { + writer.writeBytes( + 4, + f + ); + } +}; + + +/** + * @enum {number} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.Action = { + CREATE: 0, + REPLACE: 1, + DELETE: 2, + TRANSFER: 3, + UPDATE_PRICE: 4, + PURCHASE: 5 +}; + + + + +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.SubscribeToStateTransitionsRequest.DocumentFilter.PriceClause.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.PriceClause.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.SubscribeToStateTransitionsRequest.DocumentFilter.PriceClause} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.PriceClause.toObject = function(includeInstance, msg) { + var f, obj = { + operator: jspb.Message.getFieldWithDefault(msg, 1, 0), + value: (f = msg.getValue()) && proto.org.dash.platform.dapi.v0.GetDocumentsRequest.DocumentFieldValue.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.SubscribeToStateTransitionsRequest.DocumentFilter.PriceClause} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.PriceClause.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.PriceClause; + return proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.PriceClause.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.SubscribeToStateTransitionsRequest.DocumentFilter.PriceClause} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.PriceClause} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.PriceClause.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!proto.org.dash.platform.dapi.v0.GetDocumentsRequest.WhereOperator} */ (reader.readEnum()); + msg.setOperator(value); + break; + case 2: + var value = new proto.org.dash.platform.dapi.v0.GetDocumentsRequest.DocumentFieldValue; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.GetDocumentsRequest.DocumentFieldValue.deserializeBinaryFromReader); + msg.setValue(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.SubscribeToStateTransitionsRequest.DocumentFilter.PriceClause.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.PriceClause.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.SubscribeToStateTransitionsRequest.DocumentFilter.PriceClause} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.PriceClause.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getOperator(); + if (f !== 0.0) { + writer.writeEnum( + 1, + f + ); + } + f = message.getValue(); + if (f != null) { + writer.writeMessage( + 2, + f, + proto.org.dash.platform.dapi.v0.GetDocumentsRequest.DocumentFieldValue.serializeBinaryToWriter + ); + } +}; + + +/** + * optional GetDocumentsRequest.WhereOperator operator = 1; + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsRequest.WhereOperator} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.PriceClause.prototype.getOperator = function() { + return /** @type {!proto.org.dash.platform.dapi.v0.GetDocumentsRequest.WhereOperator} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** + * @param {!proto.org.dash.platform.dapi.v0.GetDocumentsRequest.WhereOperator} value + * @return {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.PriceClause} returns this + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.PriceClause.prototype.setOperator = function(value) { + return jspb.Message.setProto3EnumField(this, 1, value); +}; + + +/** + * optional GetDocumentsRequest.DocumentFieldValue value = 2; + * @return {?proto.org.dash.platform.dapi.v0.GetDocumentsRequest.DocumentFieldValue} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.PriceClause.prototype.getValue = function() { + return /** @type{?proto.org.dash.platform.dapi.v0.GetDocumentsRequest.DocumentFieldValue} */ ( + jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.GetDocumentsRequest.DocumentFieldValue, 2)); +}; + + +/** + * @param {?proto.org.dash.platform.dapi.v0.GetDocumentsRequest.DocumentFieldValue|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.PriceClause} returns this +*/ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.PriceClause.prototype.setValue = function(value) { + return jspb.Message.setWrapperField(this, 2, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.PriceClause} returns this + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.PriceClause.prototype.clearValue = function() { + return this.setValue(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.PriceClause.prototype.hasValue = function() { + return jspb.Message.getField(this, 2) != null; +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch.repeatedFields_ = [2,3,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.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch.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.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch.toObject = function(includeInstance, msg) { + var f, obj = { + action: jspb.Message.getFieldWithDefault(msg, 1, 0), + newDocumentWhereList: jspb.Message.toObjectList(msg.getNewDocumentWhereList(), + proto.org.dash.platform.dapi.v0.GetDocumentsRequest.WhereClause.toObject, includeInstance), + originalDocumentWhereList: jspb.Message.toObjectList(msg.getOriginalDocumentWhereList(), + proto.org.dash.platform.dapi.v0.GetDocumentsRequest.WhereClause.toObject, includeInstance), + ownerIdsList: msg.getOwnerIdsList_asB64(), + price: (f = msg.getPrice()) && proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.PriceClause.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.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch; + return proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch.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.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.Action} */ (reader.readEnum()); + msg.setAction(value); + break; + case 2: + var value = new proto.org.dash.platform.dapi.v0.GetDocumentsRequest.WhereClause; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.GetDocumentsRequest.WhereClause.deserializeBinaryFromReader); + msg.addNewDocumentWhere(value); + break; + case 3: + var value = new proto.org.dash.platform.dapi.v0.GetDocumentsRequest.WhereClause; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.GetDocumentsRequest.WhereClause.deserializeBinaryFromReader); + msg.addOriginalDocumentWhere(value); + break; + case 4: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.addOwnerIds(value); + break; + case 5: + var value = new proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.PriceClause; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.PriceClause.deserializeBinaryFromReader); + msg.setPrice(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.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch.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.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = /** @type {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.Action} */ (jspb.Message.getField(message, 1)); + if (f != null) { + writer.writeEnum( + 1, + f + ); + } + f = message.getNewDocumentWhereList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 2, + f, + proto.org.dash.platform.dapi.v0.GetDocumentsRequest.WhereClause.serializeBinaryToWriter + ); + } + f = message.getOriginalDocumentWhereList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 3, + f, + proto.org.dash.platform.dapi.v0.GetDocumentsRequest.WhereClause.serializeBinaryToWriter + ); + } + f = message.getOwnerIdsList_asU8(); + if (f.length > 0) { + writer.writeRepeatedBytes( + 4, + f + ); + } + f = message.getPrice(); + if (f != null) { + writer.writeMessage( + 5, + f, + proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.PriceClause.serializeBinaryToWriter + ); + } +}; + + +/** + * optional Action action = 1; + * @return {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.Action} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch.prototype.getAction = function() { + return /** @type {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.Action} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** + * @param {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.Action} value + * @return {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch} returns this + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch.prototype.setAction = function(value) { + return jspb.Message.setField(this, 1, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch} returns this + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch.prototype.clearAction = function() { + return jspb.Message.setField(this, 1, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch.prototype.hasAction = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * repeated GetDocumentsRequest.WhereClause new_document_where = 2; + * @return {!Array} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch.prototype.getNewDocumentWhereList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.org.dash.platform.dapi.v0.GetDocumentsRequest.WhereClause, 2)); +}; + + +/** + * @param {!Array} value + * @return {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch} returns this +*/ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch.prototype.setNewDocumentWhereList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 2, value); +}; + + +/** + * @param {!proto.org.dash.platform.dapi.v0.GetDocumentsRequest.WhereClause=} opt_value + * @param {number=} opt_index + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsRequest.WhereClause} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch.prototype.addNewDocumentWhere = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 2, opt_value, proto.org.dash.platform.dapi.v0.GetDocumentsRequest.WhereClause, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch} returns this + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch.prototype.clearNewDocumentWhereList = function() { + return this.setNewDocumentWhereList([]); +}; + + +/** + * repeated GetDocumentsRequest.WhereClause original_document_where = 3; + * @return {!Array} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch.prototype.getOriginalDocumentWhereList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.org.dash.platform.dapi.v0.GetDocumentsRequest.WhereClause, 3)); +}; + + +/** + * @param {!Array} value + * @return {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch} returns this +*/ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch.prototype.setOriginalDocumentWhereList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 3, value); +}; + + +/** + * @param {!proto.org.dash.platform.dapi.v0.GetDocumentsRequest.WhereClause=} opt_value + * @param {number=} opt_index + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsRequest.WhereClause} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch.prototype.addOriginalDocumentWhere = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 3, opt_value, proto.org.dash.platform.dapi.v0.GetDocumentsRequest.WhereClause, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch} returns this + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch.prototype.clearOriginalDocumentWhereList = function() { + return this.setOriginalDocumentWhereList([]); +}; + + +/** + * repeated bytes owner_ids = 4; + * @return {!Array} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch.prototype.getOwnerIdsList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 4)); +}; + + +/** + * repeated bytes owner_ids = 4; + * This is a type-conversion wrapper around `getOwnerIdsList()` + * @return {!Array} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch.prototype.getOwnerIdsList_asB64 = function() { + return /** @type {!Array} */ (jspb.Message.bytesListAsB64( + this.getOwnerIdsList())); +}; + + +/** + * repeated bytes owner_ids = 4; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getOwnerIdsList()` + * @return {!Array} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch.prototype.getOwnerIdsList_asU8 = function() { + return /** @type {!Array} */ (jspb.Message.bytesListAsU8( + this.getOwnerIdsList())); +}; + + +/** + * @param {!(Array|Array)} value + * @return {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch} returns this + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch.prototype.setOwnerIdsList = function(value) { + return jspb.Message.setField(this, 4, value || []); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @param {number=} opt_index + * @return {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch} returns this + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch.prototype.addOwnerIds = 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.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch} returns this + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch.prototype.clearOwnerIdsList = function() { + return this.setOwnerIdsList([]); +}; + + +/** + * optional PriceClause price = 5; + * @return {?proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.PriceClause} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch.prototype.getPrice = function() { + return /** @type{?proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.PriceClause} */ ( + jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.PriceClause, 5)); +}; + + +/** + * @param {?proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.PriceClause|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch} returns this +*/ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch.prototype.setPrice = function(value) { + return jspb.Message.setWrapperField(this, 5, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch} returns this + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch.prototype.clearPrice = function() { + return this.setPrice(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch.prototype.hasPrice = function() { + return jspb.Message.getField(this, 5) != null; +}; + + +/** + * optional bytes data_contract_id = 1; + * @return {string} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.prototype.getDataContractId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * optional bytes data_contract_id = 1; + * This is a type-conversion wrapper around `getDataContractId()` + * @return {string} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.prototype.getDataContractId_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getDataContractId())); +}; + + +/** + * optional bytes data_contract_id = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getDataContractId()` + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.prototype.getDataContractId_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getDataContractId())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter} returns this + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.prototype.setDataContractId = function(value) { + return jspb.Message.setProto3BytesField(this, 1, value); +}; + + +/** + * optional string document_type_name = 2; + * @return {string} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.prototype.getDocumentTypeName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter} returns this + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.prototype.setDocumentTypeName = function(value) { + return jspb.Message.setField(this, 2, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter} returns this + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.prototype.clearDocumentTypeName = function() { + return jspb.Message.setField(this, 2, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.prototype.hasDocumentTypeName = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * repeated ActionMatch actions = 3; + * @return {!Array} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.prototype.getActionsList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch, 3)); +}; + + +/** + * @param {!Array} value + * @return {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter} returns this +*/ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.prototype.setActionsList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 3, value); +}; + + +/** + * @param {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch=} opt_value + * @param {number=} opt_index + * @return {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.prototype.addActions = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 3, opt_value, proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.ActionMatch, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter} returns this + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.prototype.clearActionsList = function() { + return this.setActionsList([]); +}; + + +/** + * optional bytes batch_owner_id = 4; + * @return {string} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.prototype.getBatchOwnerId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")); +}; + + +/** + * optional bytes batch_owner_id = 4; + * This is a type-conversion wrapper around `getBatchOwnerId()` + * @return {string} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.prototype.getBatchOwnerId_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getBatchOwnerId())); +}; + + +/** + * optional bytes batch_owner_id = 4; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getBatchOwnerId()` + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.prototype.getBatchOwnerId_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getBatchOwnerId())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter} returns this + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.prototype.setBatchOwnerId = function(value) { + return jspb.Message.setField(this, 4, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter} returns this + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.prototype.clearBatchOwnerId = function() { + return jspb.Message.setField(this, 4, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.prototype.hasBatchOwnerId = function() { + return jspb.Message.getField(this, 4) != null; +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.AddressFilter.repeatedFields_ = [1]; + + + +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.SubscribeToStateTransitionsRequest.AddressFilter.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.AddressFilter.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.SubscribeToStateTransitionsRequest.AddressFilter} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.AddressFilter.toObject = function(includeInstance, msg) { + var f, obj = { + addressesList: msg.getAddressesList_asB64(), + role: 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.SubscribeToStateTransitionsRequest.AddressFilter} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.AddressFilter.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.AddressFilter; + return proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.AddressFilter.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.SubscribeToStateTransitionsRequest.AddressFilter} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.AddressFilter} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.AddressFilter.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.addAddresses(value); + break; + case 2: + var value = /** @type {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.Role} */ (reader.readEnum()); + msg.setRole(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.SubscribeToStateTransitionsRequest.AddressFilter.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.AddressFilter.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.SubscribeToStateTransitionsRequest.AddressFilter} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.AddressFilter.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getAddressesList_asU8(); + if (f.length > 0) { + writer.writeRepeatedBytes( + 1, + f + ); + } + f = message.getRole(); + if (f !== 0.0) { + writer.writeEnum( + 2, + f + ); + } +}; + + +/** + * repeated bytes addresses = 1; + * @return {!Array} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.AddressFilter.prototype.getAddressesList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 1)); +}; + + +/** + * repeated bytes addresses = 1; + * This is a type-conversion wrapper around `getAddressesList()` + * @return {!Array} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.AddressFilter.prototype.getAddressesList_asB64 = function() { + return /** @type {!Array} */ (jspb.Message.bytesListAsB64( + this.getAddressesList())); +}; + + +/** + * repeated bytes addresses = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getAddressesList()` + * @return {!Array} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.AddressFilter.prototype.getAddressesList_asU8 = function() { + return /** @type {!Array} */ (jspb.Message.bytesListAsU8( + this.getAddressesList())); +}; + + +/** + * @param {!(Array|Array)} value + * @return {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.AddressFilter} returns this + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.AddressFilter.prototype.setAddressesList = function(value) { + return jspb.Message.setField(this, 1, value || []); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @param {number=} opt_index + * @return {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.AddressFilter} returns this + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.AddressFilter.prototype.addAddresses = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 1, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.AddressFilter} returns this + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.AddressFilter.prototype.clearAddressesList = function() { + return this.setAddressesList([]); +}; + + +/** + * optional Role role = 2; + * @return {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.Role} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.AddressFilter.prototype.getRole = function() { + return /** @type {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.Role} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +}; + + +/** + * @param {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.Role} value + * @return {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.AddressFilter} returns this + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.AddressFilter.prototype.setRole = function(value) { + return jspb.Message.setProto3EnumField(this, 2, 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.SubscribeToStateTransitionsRequest.StateTransitionFilter.oneofGroups_ = [[1,2]]; + +/** + * @enum {number} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter.FilterCase = { + FILTER_NOT_SET: 0, + DOCUMENTS: 1, + ADDRESSES: 2 +}; + +/** + * @return {proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter.FilterCase} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter.prototype.getFilterCase = function() { + return /** @type {proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter.FilterCase} */(jspb.Message.computeOneofCase(this, proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter.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.SubscribeToStateTransitionsRequest.StateTransitionFilter.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter.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.SubscribeToStateTransitionsRequest.StateTransitionFilter} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter.toObject = function(includeInstance, msg) { + var f, obj = { + documents: (f = msg.getDocuments()) && proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.toObject(includeInstance, f), + addresses: (f = msg.getAddresses()) && proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.AddressFilter.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.SubscribeToStateTransitionsRequest.StateTransitionFilter} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter; + return proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter.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.SubscribeToStateTransitionsRequest.StateTransitionFilter} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter.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.SubscribeToStateTransitionsRequest.DocumentFilter; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.deserializeBinaryFromReader); + msg.setDocuments(value); + break; + case 2: + var value = new proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.AddressFilter; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.AddressFilter.deserializeBinaryFromReader); + msg.setAddresses(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.SubscribeToStateTransitionsRequest.StateTransitionFilter.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter.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.SubscribeToStateTransitionsRequest.StateTransitionFilter} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getDocuments(); + if (f != null) { + writer.writeMessage( + 1, + f, + proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter.serializeBinaryToWriter + ); + } + f = message.getAddresses(); + if (f != null) { + writer.writeMessage( + 2, + f, + proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.AddressFilter.serializeBinaryToWriter + ); + } +}; + + +/** + * optional DocumentFilter documents = 1; + * @return {?proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter.prototype.getDocuments = function() { + return /** @type{?proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter} */ ( + jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter, 1)); +}; + + +/** + * @param {?proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.DocumentFilter|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter} returns this +*/ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter.prototype.setDocuments = function(value) { + return jspb.Message.setOneofWrapperField(this, 1, proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter} returns this + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter.prototype.clearDocuments = function() { + return this.setDocuments(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter.prototype.hasDocuments = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * optional AddressFilter addresses = 2; + * @return {?proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.AddressFilter} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter.prototype.getAddresses = function() { + return /** @type{?proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.AddressFilter} */ ( + jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.AddressFilter, 2)); +}; + + +/** + * @param {?proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.AddressFilter|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter} returns this +*/ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter.prototype.setAddresses = function(value) { + return jspb.Message.setOneofWrapperField(this, 2, proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter} returns this + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter.prototype.clearAddresses = function() { + return this.setAddresses(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter.prototype.hasAddresses = function() { + return jspb.Message.getField(this, 2) != null; +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0.repeatedFields_ = [1]; + + + +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.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0.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.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0.toObject = function(includeInstance, msg) { + var f, obj = { + filtersList: jspb.Message.toObjectList(msg.getFiltersList(), + proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter.toObject, includeInstance), + fromBlockHeight: 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.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0; + return proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0.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.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0.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.SubscribeToStateTransitionsRequest.StateTransitionFilter; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter.deserializeBinaryFromReader); + msg.addFilters(value); + break; + case 2: + var value = /** @type {string} */ (reader.readUint64String()); + msg.setFromBlockHeight(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.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0.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.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getFiltersList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 1, + f, + proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter.serializeBinaryToWriter + ); + } + f = /** @type {string} */ (jspb.Message.getField(message, 2)); + if (f != null) { + writer.writeUint64String( + 2, + f + ); + } +}; + + +/** + * repeated StateTransitionFilter filters = 1; + * @return {!Array} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0.prototype.getFiltersList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter, 1)); +}; + + +/** + * @param {!Array} value + * @return {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0} returns this +*/ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0.prototype.setFiltersList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 1, value); +}; + + +/** + * @param {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter=} opt_value + * @param {number=} opt_index + * @return {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0.prototype.addFilters = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.StateTransitionFilter, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0} returns this + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0.prototype.clearFiltersList = function() { + return this.setFiltersList([]); +}; + + +/** + * optional uint64 from_block_height = 2; + * @return {string} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0.prototype.getFromBlockHeight = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "0")); +}; + + +/** + * @param {string} value + * @return {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0} returns this + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0.prototype.setFromBlockHeight = function(value) { + return jspb.Message.setField(this, 2, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0} returns this + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0.prototype.clearFromBlockHeight = function() { + return jspb.Message.setField(this, 2, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0.prototype.hasFromBlockHeight = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * optional SubscribeToStateTransitionsRequestV0 v0 = 1; + * @return {?proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.prototype.getV0 = function() { + return /** @type{?proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0} */ ( + jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0, 1)); +}; + + +/** + * @param {?proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.SubscribeToStateTransitionsRequestV0|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest} returns this +*/ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.prototype.setV0 = function(value) { + return jspb.Message.setOneofWrapperField(this, 1, proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest} returns this + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.prototype.clearV0 = function() { + return this.setV0(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsRequest.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.SubscribeToStateTransitionsResponse.oneofGroups_ = [[1]]; + +/** + * @enum {number} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.VersionCase = { + VERSION_NOT_SET: 0, + V0: 1 +}; + +/** + * @return {proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.VersionCase} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.prototype.getVersionCase = function() { + return /** @type {proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.VersionCase} */(jspb.Message.computeOneofCase(this, proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.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.SubscribeToStateTransitionsResponse.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.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.SubscribeToStateTransitionsResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.toObject = function(includeInstance, msg) { + var f, obj = { + v0: (f = msg.getV0()) && proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.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.SubscribeToStateTransitionsResponse} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse; + return proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.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.SubscribeToStateTransitionsResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.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.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.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.SubscribeToStateTransitionsResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.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.SubscribeToStateTransitionsResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getV0(); + if (f != null) { + writer.writeMessage( + 1, + f, + proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.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.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.oneofGroups_ = [[1,2]]; + +/** + * @enum {number} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.ResponsesCase = { + RESPONSES_NOT_SET: 0, + STATE_TRANSITION: 1, + CHECKPOINT: 2 +}; + +/** + * @return {proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.ResponsesCase} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.prototype.getResponsesCase = function() { + return /** @type {proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.ResponsesCase} */(jspb.Message.computeOneofCase(this, proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.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.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.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.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.toObject = function(includeInstance, msg) { + var f, obj = { + stateTransition: (f = msg.getStateTransition()) && proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch.toObject(includeInstance, f), + checkpoint: (f = msg.getCheckpoint()) && proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.Checkpoint.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.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0; + return proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.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.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.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.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch.deserializeBinaryFromReader); + msg.setStateTransition(value); + break; + case 2: + var value = new proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.Checkpoint; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.Checkpoint.deserializeBinaryFromReader); + msg.setCheckpoint(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.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.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.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getStateTransition(); + if (f != null) { + writer.writeMessage( + 1, + f, + proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch.serializeBinaryToWriter + ); + } + f = message.getCheckpoint(); + if (f != null) { + writer.writeMessage( + 2, + f, + proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.Checkpoint.serializeBinaryToWriter + ); + } +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch.repeatedFields_ = [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.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch.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.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch.toObject = function(includeInstance, msg) { + var f, obj = { + blockHeight: jspb.Message.getFieldWithDefault(msg, 1, "0"), + blockTimeMs: jspb.Message.getFieldWithDefault(msg, 2, "0"), + protocolVersion: jspb.Message.getFieldWithDefault(msg, 3, 0), + stateTransitionHash: msg.getStateTransitionHash_asB64(), + stateTransition: msg.getStateTransition_asB64(), + matchedFiltersList: (f = jspb.Message.getRepeatedField(msg, 6)) == null ? undefined : f, + matchedBatchPositionsList: (f = jspb.Message.getRepeatedField(msg, 7)) == null ? undefined : 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.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch; + return proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch.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.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readUint64String()); + msg.setBlockHeight(value); + break; + case 2: + var value = /** @type {string} */ (reader.readUint64String()); + msg.setBlockTimeMs(value); + break; + case 3: + var value = /** @type {number} */ (reader.readUint32()); + msg.setProtocolVersion(value); + break; + case 4: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setStateTransitionHash(value); + break; + case 5: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setStateTransition(value); + break; + case 6: + var values = /** @type {!Array} */ (reader.isDelimited() ? reader.readPackedUint32() : [reader.readUint32()]); + for (var i = 0; i < values.length; i++) { + msg.addMatchedFilters(values[i]); + } + break; + case 7: + var values = /** @type {!Array} */ (reader.isDelimited() ? reader.readPackedUint32() : [reader.readUint32()]); + for (var i = 0; i < values.length; i++) { + msg.addMatchedBatchPositions(values[i]); + } + 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.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch.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.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getBlockHeight(); + if (parseInt(f, 10) !== 0) { + writer.writeUint64String( + 1, + f + ); + } + f = message.getBlockTimeMs(); + if (parseInt(f, 10) !== 0) { + writer.writeUint64String( + 2, + f + ); + } + f = message.getProtocolVersion(); + if (f !== 0) { + writer.writeUint32( + 3, + f + ); + } + f = message.getStateTransitionHash_asU8(); + if (f.length > 0) { + writer.writeBytes( + 4, + f + ); + } + f = message.getStateTransition_asU8(); + if (f.length > 0) { + writer.writeBytes( + 5, + f + ); + } + f = message.getMatchedFiltersList(); + if (f.length > 0) { + writer.writePackedUint32( + 6, + f + ); + } + f = message.getMatchedBatchPositionsList(); + if (f.length > 0) { + writer.writePackedUint32( + 7, + f + ); + } +}; + + +/** + * optional uint64 block_height = 1; + * @return {string} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch.prototype.getBlockHeight = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "0")); +}; + + +/** + * @param {string} value + * @return {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch} returns this + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch.prototype.setBlockHeight = function(value) { + return jspb.Message.setProto3StringIntField(this, 1, value); +}; + + +/** + * optional uint64 block_time_ms = 2; + * @return {string} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch.prototype.getBlockTimeMs = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "0")); +}; + + +/** + * @param {string} value + * @return {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch} returns this + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch.prototype.setBlockTimeMs = function(value) { + return jspb.Message.setProto3StringIntField(this, 2, value); +}; + + +/** + * optional uint32 protocol_version = 3; + * @return {number} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch.prototype.getProtocolVersion = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch} returns this + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch.prototype.setProtocolVersion = function(value) { + return jspb.Message.setProto3IntField(this, 3, value); +}; + + +/** + * optional bytes state_transition_hash = 4; + * @return {string} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch.prototype.getStateTransitionHash = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")); +}; + + +/** + * optional bytes state_transition_hash = 4; + * This is a type-conversion wrapper around `getStateTransitionHash()` + * @return {string} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch.prototype.getStateTransitionHash_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getStateTransitionHash())); +}; + + +/** + * optional bytes state_transition_hash = 4; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getStateTransitionHash()` + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch.prototype.getStateTransitionHash_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getStateTransitionHash())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch} returns this + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch.prototype.setStateTransitionHash = function(value) { + return jspb.Message.setProto3BytesField(this, 4, value); +}; + + +/** + * optional bytes state_transition = 5; + * @return {string} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch.prototype.getStateTransition = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 5, "")); +}; + + +/** + * optional bytes state_transition = 5; + * This is a type-conversion wrapper around `getStateTransition()` + * @return {string} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch.prototype.getStateTransition_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getStateTransition())); +}; + + +/** + * optional bytes state_transition = 5; + * 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.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch.prototype.getStateTransition_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getStateTransition())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch} returns this + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch.prototype.setStateTransition = function(value) { + return jspb.Message.setProto3BytesField(this, 5, value); +}; + + +/** + * repeated uint32 matched_filters = 6; + * @return {!Array} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch.prototype.getMatchedFiltersList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 6)); +}; + + +/** + * @param {!Array} value + * @return {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch} returns this + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch.prototype.setMatchedFiltersList = function(value) { + return jspb.Message.setField(this, 6, value || []); +}; + + +/** + * @param {number} value + * @param {number=} opt_index + * @return {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch} returns this + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch.prototype.addMatchedFilters = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 6, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch} returns this + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch.prototype.clearMatchedFiltersList = function() { + return this.setMatchedFiltersList([]); +}; + + +/** + * repeated uint32 matched_batch_positions = 7; + * @return {!Array} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch.prototype.getMatchedBatchPositionsList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 7)); +}; + + +/** + * @param {!Array} value + * @return {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch} returns this + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch.prototype.setMatchedBatchPositionsList = function(value) { + return jspb.Message.setField(this, 7, value || []); +}; + + +/** + * @param {number} value + * @param {number=} opt_index + * @return {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch} returns this + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch.prototype.addMatchedBatchPositions = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 7, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch} returns this + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch.prototype.clearMatchedBatchPositionsList = function() { + return this.setMatchedBatchPositionsList([]); +}; + + + + + +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.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.Checkpoint.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.Checkpoint.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.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.Checkpoint} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.Checkpoint.toObject = function(includeInstance, msg) { + var f, obj = { + blockHeight: jspb.Message.getFieldWithDefault(msg, 1, "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.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.Checkpoint} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.Checkpoint.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.Checkpoint; + return proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.Checkpoint.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.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.Checkpoint} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.Checkpoint} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.Checkpoint.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readUint64String()); + msg.setBlockHeight(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.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.Checkpoint.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.Checkpoint.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.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.Checkpoint} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.Checkpoint.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getBlockHeight(); + if (parseInt(f, 10) !== 0) { + writer.writeUint64String( + 1, + f + ); + } +}; + + +/** + * optional uint64 block_height = 1; + * @return {string} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.Checkpoint.prototype.getBlockHeight = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "0")); +}; + + +/** + * @param {string} value + * @return {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.Checkpoint} returns this + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.Checkpoint.prototype.setBlockHeight = function(value) { + return jspb.Message.setProto3StringIntField(this, 1, value); +}; + + +/** + * optional StateTransitionMatch state_transition = 1; + * @return {?proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.prototype.getStateTransition = function() { + return /** @type{?proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch} */ ( + jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch, 1)); +}; + + +/** + * @param {?proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.StateTransitionMatch|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0} returns this +*/ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.prototype.setStateTransition = function(value) { + return jspb.Message.setOneofWrapperField(this, 1, proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0} returns this + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.prototype.clearStateTransition = function() { + return this.setStateTransition(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.prototype.hasStateTransition = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * optional Checkpoint checkpoint = 2; + * @return {?proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.Checkpoint} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.prototype.getCheckpoint = function() { + return /** @type{?proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.Checkpoint} */ ( + jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.Checkpoint, 2)); +}; + + +/** + * @param {?proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.Checkpoint|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0} returns this +*/ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.prototype.setCheckpoint = function(value) { + return jspb.Message.setOneofWrapperField(this, 2, proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0} returns this + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.prototype.clearCheckpoint = function() { + return this.setCheckpoint(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0.prototype.hasCheckpoint = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * optional SubscribeToStateTransitionsResponseV0 v0 = 1; + * @return {?proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.prototype.getV0 = function() { + return /** @type{?proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0} */ ( + jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0, 1)); +}; + + +/** + * @param {?proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.SubscribeToStateTransitionsResponseV0|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse} returns this +*/ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.prototype.setV0 = function(value) { + return jspb.Message.setOneofWrapperField(this, 1, proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse} returns this + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.prototype.clearV0 = function() { + return this.setV0(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.SubscribeToStateTransitionsResponse.prototype.hasV0 = function() { + return jspb.Message.getField(this, 1) != null; +}; + + /** * @enum {number} */ 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 860b7d2baec..987e0507582 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 @@ -661,6 +661,15 @@ type PlatformgetShieldedNullifiers = { readonly responseType: typeof platform_pb.GetShieldedNullifiersResponse; }; +type PlatformsubscribeToStateTransitions = { + readonly methodName: string; + readonly service: typeof Platform; + readonly requestStream: false; + readonly responseStream: true; + readonly requestType: typeof platform_pb.SubscribeToStateTransitionsRequest; + readonly responseType: typeof platform_pb.SubscribeToStateTransitionsResponse; +}; + export class Platform { static readonly serviceName: string; static readonly broadcastStateTransition: PlatformbroadcastStateTransition; @@ -736,6 +745,7 @@ export class Platform { static readonly getShieldedPoolState: PlatformgetShieldedPoolState; static readonly getShieldedNotesCount: PlatformgetShieldedNotesCount; static readonly getShieldedNullifiers: PlatformgetShieldedNullifiers; + static readonly subscribeToStateTransitions: PlatformsubscribeToStateTransitions; } export type ServiceError = { message: string, code: number; metadata: grpc.Metadata } @@ -1427,5 +1437,6 @@ export class PlatformClient { requestMessage: platform_pb.GetShieldedNullifiersRequest, callback: (error: ServiceError|null, responseMessage: platform_pb.GetShieldedNullifiersResponse|null) => void ): UnaryResponse; + subscribeToStateTransitions(requestMessage: platform_pb.SubscribeToStateTransitionsRequest, metadata?: grpc.Metadata): ResponseStream; } 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 09e868e58d1..5b870c28843 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 @@ -667,6 +667,15 @@ Platform.getShieldedNullifiers = { responseType: platform_pb.GetShieldedNullifiersResponse }; +Platform.subscribeToStateTransitions = { + methodName: "subscribeToStateTransitions", + service: Platform, + requestStream: false, + responseStream: true, + requestType: platform_pb.SubscribeToStateTransitionsRequest, + responseType: platform_pb.SubscribeToStateTransitionsResponse +}; + exports.Platform = Platform; function PlatformClient(serviceHost, options) { @@ -2937,5 +2946,44 @@ PlatformClient.prototype.getShieldedNullifiers = function getShieldedNullifiers( }; }; +PlatformClient.prototype.subscribeToStateTransitions = function subscribeToStateTransitions(requestMessage, metadata) { + var listeners = { + data: [], + end: [], + status: [] + }; + var client = grpc.invoke(Platform.subscribeToStateTransitions, { + request: requestMessage, + host: this.serviceHost, + metadata: metadata, + transport: this.options.transport, + debug: this.options.debug, + onMessage: function (responseMessage) { + listeners.data.forEach(function (handler) { + handler(responseMessage); + }); + }, + onEnd: function (status, statusMessage, trailers) { + listeners.status.forEach(function (handler) { + handler({ code: status, details: statusMessage, metadata: trailers }); + }); + listeners.end.forEach(function (handler) { + handler({ code: status, details: statusMessage, metadata: trailers }); + }); + listeners = null; + } + }); + return { + on: function (type, handler) { + listeners[type].push(handler); + return this; + }, + cancel: function () { + listeners = null; + client.close(); + } + }; +}; + exports.PlatformClient = PlatformClient; diff --git a/packages/dapi-grpc/protos/platform/v0/platform.proto b/packages/dapi-grpc/protos/platform/v0/platform.proto index e4fcd5b3f54..ef7721f0dd3 100644 --- a/packages/dapi-grpc/protos/platform/v0/platform.proto +++ b/packages/dapi-grpc/protos/platform/v0/platform.proto @@ -159,6 +159,12 @@ service Platform { returns (GetShieldedNotesCountResponse); rpc getShieldedNullifiers(GetShieldedNullifiersRequest) returns (GetShieldedNullifiersResponse); + // Streams every committed, successfully executed state transition that matches + // one of the request's filters, block by block, from a chosen height onward. + // Served by DAPI from the Tenderdash block store; see + // `SubscribeToStateTransitionsResponse` for the stream contract. + rpc subscribeToStateTransitions(SubscribeToStateTransitionsRequest) + returns (stream SubscribeToStateTransitionsResponse); } // Proof message includes cryptographic proofs for validating responses @@ -4231,3 +4237,142 @@ message GetShieldedNullifiersResponse { } oneof version { GetShieldedNullifiersResponseV0 v0 = 1; } } + +// Subscription to committed state transitions. +// +// A transition is delivered when it executed successfully and ANY of the +// filters matches it; within one filter every given constraint must hold. +// Matching reads only the transition itself: what it names, not state it +// changed. Nothing is known about a document before the transition changed it +// beyond its `$id`. +message SubscribeToStateTransitionsRequest { + // Which side of a transition a watched address must be on. + enum Role { + // Either side. + ANY = 0; + // An address input the transition spends from. + SENDER = 1; + // An address the transition credits: an output or change output. + RECIPIENT = 2; + } + + // Document transitions, in batch transitions, on one data contract. + message DocumentFilter { + enum Action { + CREATE = 0; + REPLACE = 1; + // Also matches the delete of an indexOnly document. + DELETE = 2; + TRANSFER = 3; + UPDATE_PRICE = 4; + PURCHASE = 5; + } + + // Constraint on the new price of an UPDATE_PRICE. + message PriceClause { + GetDocumentsRequest.WhereOperator operator = 1; + GetDocumentsRequest.DocumentFieldValue value = 2; + } + + // One action, optionally narrowed by clauses (ANDed together). The clause + // values follow the getDocuments typing rules; the document type's schema + // decides each field's type. + message ActionMatch { + // Required; `optional` so a missing action is rejected rather than read + // as CREATE. + optional Action action = 1; + // CREATE and REPLACE: clauses on the document data the transition + // carries. + repeated GetDocumentsRequest.WhereClause new_document_where = 2; + // Clauses on the document as it was before the transition: only `$id`, + // except for DELETE on an indexOnly document type, whose delete carries + // the document's values. + repeated GetDocumentsRequest.WhereClause original_document_where = 3; + // TRANSFER: the recipient, PURCHASE: the buyer, must be one of these + // identities. + repeated bytes owner_ids = 4; + // UPDATE_PRICE only. + PriceClause price = 5; + } + + bytes data_contract_id = 1; + // Unset: every document type of the contract; `actions` must then carry + // no clauses. + optional string document_type_name = 2; + // Empty: every action. + repeated ActionMatch actions = 3; + // The identity that owns (signs) the batch: the document owner for every + // action but PURCHASE, where it is the buyer. + optional bytes batch_owner_id = 4; + } + + // Transitions that name one of these platform addresses. + message AddressFilter { + // Platform addresses in their 21-byte form: a type byte (0 for P2PKH, 1 for + // P2SH) followed by the 20-byte hash. + repeated bytes addresses = 1; + Role role = 2; + } + + message StateTransitionFilter { + oneof filter { + DocumentFilter documents = 1; + AddressFilter addresses = 2; + } + } + + message SubscribeToStateTransitionsRequestV0 { + repeated StateTransitionFilter filters = 1; + // First block height to scan. Unset: start after the current tip. + optional uint64 from_block_height = 2 [jstype = JS_STRING]; + } + + oneof version { SubscribeToStateTransitionsRequestV0 v0 = 1; } +} + +// One message of a state transition subscription stream. +// +// The first message is a checkpoint at the height before the first scanned +// block. Blocks are then scanned in height order: each matching transition is +// sent in block order, and every block with a match ends with a checkpoint at +// its height. While no block matches, a checkpoint at the last scanned height +// is repeated every few seconds. A checkpoint at height `h` asserts that every +// match from the first scanned block through `h` has been sent: resume from +// `h + 1`. Any end of the stream, including one with status OK (for example +// at the gateway's 600-second limit), means the same: resume from the last +// checkpoint. +// +// The server asserts these; it does not prove them. A client can check a +// delivered transition (its hash, and that it matches the filters) but not +// that nothing was left out. +message SubscribeToStateTransitionsResponse { + message SubscribeToStateTransitionsResponseV0 { + message StateTransitionMatch { + uint64 block_height = 1 [jstype = JS_STRING]; + // Block time, in milliseconds since the Unix epoch. + uint64 block_time_ms = 2 [jstype = JS_STRING]; + // The protocol version the block executed under. + uint32 protocol_version = 3; + // SHA-256 of `state_transition`, which is also its Tenderdash hash. + bytes state_transition_hash = 4; + // The serialized state transition, as included in the block. + bytes state_transition = 5; + // Indexes, in the request's `filters`, of the filters that matched. + repeated uint32 matched_filters = 6; + // For a batch transition: positions, in its transitions, of the + // document transitions that matched. + repeated uint32 matched_batch_positions = 7; + } + + message Checkpoint { + uint64 block_height = 1 [jstype = JS_STRING]; + } + + oneof responses { + StateTransitionMatch state_transition = 1; + Checkpoint checkpoint = 2; + } + } + + oneof version { SubscribeToStateTransitionsResponseV0 v0 = 1; } +} diff --git a/packages/dapi-grpc/src/lib.rs b/packages/dapi-grpc/src/lib.rs index fb0809886bc..f1f8779d74d 100644 --- a/packages/dapi-grpc/src/lib.rs +++ b/packages/dapi-grpc/src/lib.rs @@ -54,6 +54,7 @@ pub mod core { #[cfg(feature = "platform")] pub mod platform { + #![allow(non_camel_case_types)] pub mod v0 { #[cfg(all(feature = "server", not(target_arch = "wasm32")))] include!(concat!( diff --git a/packages/dapi/doc/endpoints/index.md b/packages/dapi/doc/endpoints/index.md index b3653411a89..0453d229588 100644 --- a/packages/dapi/doc/endpoints/index.md +++ b/packages/dapi/doc/endpoints/index.md @@ -85,6 +85,7 @@ These endpoints provide real-time streaming data from the Dash network, includin **Main streaming endpoints:** - [`subscribeToBlockHeadersWithChainLocks`](./streams/subscribeToBlockHeadersWithChainLocks.md) - Stream block headers and chain locks - [`subscribeToTransactionsWithProofs`](./streams/subscribeToTransactionsWithProofs.md) - Stream transactions matching a bloom filter +- [`subscribeToStateTransitions`](./streams/subscribeToStateTransitions.md) - Stream committed Platform state transitions matching document filters (by contract, type, action and clauses) or address filters ### 4. JSON-RPC Endpoints diff --git a/packages/dapi/doc/endpoints/streams/subscribeToStateTransitions.md b/packages/dapi/doc/endpoints/streams/subscribeToStateTransitions.md new file mode 100644 index 00000000000..e1edf454cac --- /dev/null +++ b/packages/dapi/doc/endpoints/streams/subscribeToStateTransitions.md @@ -0,0 +1,105 @@ +# subscribeToStateTransitions + +## Client API + +Streams committed, successfully executed state transitions that match any of the request's +filters, block by block, from a chosen height onward. + +**Request Parameters**: +- `filters`: 1 to 16 filters; a transition is delivered when it matches **any** of them, and + every constraint within one filter must hold. One of: + - `documents`: document transitions (in batch transitions) on one data contract + - `dataContractId` (required) + - `documentTypeName`: unset for every document type (actions may then carry no clauses) + - `actions`: unset for every action, otherwise up to 12 alternatives, each with: + - `action`: `CREATE`, `REPLACE`, `DELETE` (also indexOnly deletes), `TRANSFER`, + `UPDATE_PRICE`, `PURCHASE` + - `newDocumentWhere`: `CREATE`/`REPLACE` clauses on the document data, typed like + `getDocuments` V1 where clauses (up to 16) + - `originalDocumentWhere`: clauses on the document before the transition; only `$id` + (`EQUAL`/`IN`), except `DELETE` of an indexOnly document type, which carries its values + (up to 16) + - `ownerIds`: `TRANSFER` recipient or `PURCHASE` buyer must be one of these (up to 64) + - `price`: `UPDATE_PRICE` constraint on the new price + - `batchOwnerId`: the identity that signs the batch + - `addresses`: up to 256 platform addresses (21 bytes: type byte then 20-byte hash) and a + `role`: `ANY` (default), `SENDER` (an address input the transition spends) or `RECIPIENT` + (an address output or change output it credits) +- `fromBlockHeight`: first height to scan (inclusive); unset to start after the current tip. + At most 50,000 blocks behind or 1,000 ahead of the tip. + +**Response Parameters**: a stream of one of +- `stateTransition`: `blockHeight`, `blockTimeMs`, `protocolVersion`, + `stateTransitionHash` (SHA-256 of the bytes, the Tenderdash hash), `stateTransition` (bytes), + `matchedFilters` (indexes into the request), `matchedBatchPositions` (for batches) +- `checkpoint`: `blockHeight` + +The first message is a checkpoint at the height before the first scanned block. A checkpoint +follows every block with a match and repeats every 10 seconds otherwise. A checkpoint at `h` +means every match from the first scanned block through `h` was sent: resume with +`fromBlockHeight = h + 1`. Any end of the stream, including one with status `OK` (for example +at the gateway's 600-second limit), means the same: resume from the last checkpoint. + +**Example Usage** (Rust SDK): +```rust +use dash_sdk::dash_platform_queries::subscriptions::{ + DocumentAction, DocumentActionMatch, DocumentFilter, StateTransitionFilter, +}; +use dash_sdk::platform::subscriptions::SubscriptionEvent; + +let filter = StateTransitionFilter::Documents( + DocumentFilter::new(contract_id) + .with_document_type("contactRequest") + .with_action(DocumentActionMatch::new(DocumentAction::Create).with_new_document_where( + WhereClause { field: "toUserId".into(), operator: WhereOperator::Equal, value: my_id.into() }, + )), +); +let mut subscription = sdk.subscribe_to_state_transitions(vec![filter], None, None).await?; +loop { + match subscription.next().await? { + SubscriptionEvent::StateTransition(event) => handle(event), + SubscriptionEvent::Checkpoint { block_height } => save_cursor(block_height + 1), + } +} +``` + +## What matching can and cannot see + +Filters are evaluated against what a transition itself names, so: +- of a document before a replace, delete, transfer, price update or purchase only the `$id` is + known, so a query's result set cannot be maintained from transitions alone: track the ids of + matching documents and subscribe to them by `$id`; +- shielded senders and recipients are not public; +- a filter is bound to the contract version current at subscribe time, which later updates + cannot invalidate from protocol 14 on (on earlier protocol versions an update that widens an + integer field may need a resubscribe). + +## Trust + +The stream is the node's assertion. A client can check that a delivered transition's hash +matches its bytes, but not that the transition was committed or that nothing was left out, and +block heights and times are the node's word. Delivery is at least once. Act on a transition by +reading the state it changed with a proved query; catch up after being offline from a proved +read's `metadata.height + 1`. + +## Internal Implementation + +DAPI (`rs-dapi`, `services/platform_service/subscribe_to_state_transitions`) serves the stream +from the Tenderdash block store, not Drive. Every subscription walks committed heights in order +with its own cursor, up to the highest height whose execution results are saved; history and new +blocks are read the same way, and new-block events only wake the scan, so a missed event cannot +lose a block. A height is never skipped: a transaction the node cannot decode, a protocol version +it does not know or a pruned height ends the stream there (resume on an upgraded or archival +node). Filters are resolved once, against the data contracts Drive holds when the subscription +starts, by `dash_platform_queries::subscriptions`. + +**Limits** (per node): 256 subscriptions, 16 per client address (IPv6 per /48), 8 Tenderdash +RPCs in flight across all subscriptions; a client that does not read for 60 seconds is +dropped with `RESOURCE_EXHAUSTED`. The gateway ends every stream after 600 seconds; resume from the last +checkpoint. + +**Errors**: `INVALID_ARGUMENT` (malformed or undecidable filter), `NOT_FOUND` (unknown data +contract), `OUT_OF_RANGE` (start height behind the replay window: catch up with a proved read +instead), `RESOURCE_EXHAUSTED` (limits), `FAILED_PRECONDITION` (this node does not keep or cannot +decode a block; another node may), and `UNAVAILABLE` (Tenderdash unreachable, or the start height +is ahead of this node's tip). diff --git a/packages/dash-platform-queries/src/documents/document_query.rs b/packages/dash-platform-queries/src/documents/document_query.rs index 0ccd12602eb..8e4a5bce92d 100644 --- a/packages/dash-platform-queries/src/documents/document_query.rs +++ b/packages/dash-platform-queries/src/documents/document_query.rs @@ -1479,7 +1479,7 @@ fn having_operator_to_proto(op: HavingOperator) -> having_clause::Operator { } } -fn where_operator_to_proto(op: WhereOperator) -> ProtoWhereOperator { +pub(crate) fn where_operator_to_proto(op: WhereOperator) -> ProtoWhereOperator { match op { WhereOperator::Equal => ProtoWhereOperator::Equal, WhereOperator::GreaterThan => ProtoWhereOperator::GreaterThan, @@ -1534,7 +1534,7 @@ fn where_operator_to_proto(op: WhereOperator) -> ProtoWhereOperator { /// discriminant carries meaning) /// - `Map`/`EnumU8`/`EnumString` → `Error` (no wire-format /// counterpart for these shapes in a WhereClause operand) -fn value_to_proto(value: Value) -> Result { +pub(crate) fn value_to_proto(value: Value) -> Result { value_to_proto_at_depth(value, 0) } diff --git a/packages/dash-platform-queries/src/documents/from_proto.rs b/packages/dash-platform-queries/src/documents/from_proto.rs new file mode 100644 index 00000000000..44c20991e30 --- /dev/null +++ b/packages/dash-platform-queries/src/documents/from_proto.rs @@ -0,0 +1,135 @@ +//! Wire → drive decoding of document where clauses, for state transition subscriptions. Drive +//! ABCI's `query/document_query/v1/conversions.rs` keeps its own copy; the two must stay in +//! sync. Decoding is schema-agnostic, and every error describes malformed wire input. + +use dapi_grpc::platform::v0::get_documents_request::{ + document_field_value, DocumentFieldValue as ProtoDocumentFieldValue, + WhereClause as ProtoWhereClause, WhereOperator as ProtoWhereOperator, +}; +use dpp::platform_value::Value; +use drive::query::{WhereClause, WhereOperator}; + +/// Map a wire [`ProtoWhereOperator`] discriminant onto drive's [`WhereOperator`]. The window +/// selections (`IN_TIME_RANGE`, `IN_INTEGER_RANGE`) are not engine operators and are refused. +pub fn where_operator_from_proto(op: i32) -> Result { + let proto_op = ProtoWhereOperator::try_from(op).map_err(|_| { + format!( + "unknown WhereOperator discriminant: {} (valid values: 0..=14, see \ + `get_documents_request::WhereOperator`)", + op + ) + })?; + Ok(match proto_op { + ProtoWhereOperator::Equal => WhereOperator::Equal, + ProtoWhereOperator::GreaterThan => WhereOperator::GreaterThan, + ProtoWhereOperator::GreaterThanOrEquals => WhereOperator::GreaterThanOrEquals, + ProtoWhereOperator::LessThan => WhereOperator::LessThan, + ProtoWhereOperator::LessThanOrEquals => WhereOperator::LessThanOrEquals, + ProtoWhereOperator::Between => WhereOperator::Between, + ProtoWhereOperator::BetweenExcludeBounds => WhereOperator::BetweenExcludeBounds, + ProtoWhereOperator::BetweenExcludeLeft => WhereOperator::BetweenExcludeLeft, + ProtoWhereOperator::BetweenExcludeRight => WhereOperator::BetweenExcludeRight, + ProtoWhereOperator::In => WhereOperator::In, + ProtoWhereOperator::StartsWith => WhereOperator::StartsWith, + // The elements of a typed array: Drive's grammar, index admissibility + // and lowering judge them (protocol version 14). + ProtoWhereOperator::Contains => WhereOperator::Contains, + ProtoWhereOperator::ContainsAny => WhereOperator::ContainsAny, + // IN_TIME_RANGE is resolved to a concrete equality from authoritative + // block time before clause conversion, so it must never reach here. + ProtoWhereOperator::InTimeRange => { + return Err( + "IN_TIME_RANGE where clauses are resolved from block time before \ + operator conversion and must not be mixed into normal clause decoding" + .to_string(), + ) + } + // IN_INTEGER_RANGE is likewise resolved to a window-start equality + // before clause conversion. + ProtoWhereOperator::InIntegerRange => { + return Err( + "IN_INTEGER_RANGE where clauses are resolved to a window-start equality \ + before operator conversion and must not be mixed into normal clause decoding" + .to_string(), + ) + } + }) +} + +/// Map a wire [`ProtoDocumentFieldValue`] onto a `Value`. A `list` is accepted one level deep +/// only (the `IN` / `BETWEEN*` candidates), so a hostile client cannot nest lists to exhaust +/// the stack before schema validation. +pub fn value_from_proto(value: ProtoDocumentFieldValue) -> Result { + value_from_proto_at_depth(value, 0) +} + +fn value_from_proto_at_depth(value: ProtoDocumentFieldValue, depth: u8) -> Result { + let variant = value.variant.ok_or_else(|| { + "DocumentFieldValue has no variant set; a where-clause operand must \ + be a concrete value" + .to_string() + })?; + Ok(match variant { + document_field_value::Variant::BoolValue(b) => Value::Bool(b), + document_field_value::Variant::Int64Value(i) => Value::I64(i), + document_field_value::Variant::Uint64Value(u) => Value::U64(u), + document_field_value::Variant::DoubleValue(f) => Value::Float(f), + document_field_value::Variant::Text(s) => Value::Text(s), + document_field_value::Variant::BytesValue(b) => Value::Bytes(b), + document_field_value::Variant::List(list) => { + if depth >= 1 { + return Err("nested DocumentFieldValue.list is not supported; the v1 \ + query surface accepts at most one level of nesting \ + (`IN` / `BETWEEN*` candidate lists of scalars)" + .to_string()); + } + Value::Array( + list.values + .into_iter() + .map(|v| value_from_proto_at_depth(v, depth + 1)) + .collect::, _>>()?, + ) + } + // Only the variant carries meaning; its bool payload is a placeholder. + document_field_value::Variant::NullValue(_) => Value::Null, + }) +} + +/// Map a wire [`ProtoWhereClause`] onto drive's [`WhereClause`]. A clause carrying a window +/// selection operand (`time_range`, `integer_range`) is refused. +pub fn where_clause_from_proto(clause: ProtoWhereClause) -> Result { + let operator = where_operator_from_proto(clause.operator)?; + if clause.time_range.is_some() { + return Err(format!( + "WhereClause on field '{}' sets `time_range`, which is only valid with the \ + IN_TIME_RANGE operator", + clause.field + )); + } + if clause.integer_range.is_some() { + return Err(format!( + "WhereClause on field '{}' sets `integer_range`, which is only valid with the \ + IN_INTEGER_RANGE operator", + clause.field + )); + } + let value = clause.value.ok_or_else(|| { + format!( + "WhereClause on field '{}' has no value set; every clause must carry a \ + concrete `DocumentFieldValue`", + clause.field + ) + })?; + Ok(WhereClause { + field: clause.field, + operator, + value: value_from_proto(value)?, + }) +} + +/// [`where_clause_from_proto`] for every clause, failing on the first malformed one. +pub fn where_clauses_from_proto( + clauses: Vec, +) -> Result, String> { + clauses.into_iter().map(where_clause_from_proto).collect() +} diff --git a/packages/dash-platform-queries/src/documents/mod.rs b/packages/dash-platform-queries/src/documents/mod.rs index e74ec8ee695..e6c3567e20b 100644 --- a/packages/dash-platform-queries/src/documents/mod.rs +++ b/packages/dash-platform-queries/src/documents/mod.rs @@ -13,6 +13,7 @@ pub mod document_split_averages; pub mod document_split_counts; pub mod document_split_sums; pub mod document_sum; +pub mod from_proto; pub(crate) mod having_proof_helpers; pub(crate) mod ranked_proof_helpers; pub(crate) mod sum_proof_helpers; diff --git a/packages/dash-platform-queries/src/lib.rs b/packages/dash-platform-queries/src/lib.rs index 9da47cf6435..72588743a8d 100644 --- a/packages/dash-platform-queries/src/lib.rs +++ b/packages/dash-platform-queries/src/lib.rs @@ -17,6 +17,7 @@ pub mod documents; pub mod dpns_usernames; pub mod error; pub mod mock; +pub mod subscriptions; pub mod transition; pub mod types; diff --git a/packages/dash-platform-queries/src/subscriptions/mod.rs b/packages/dash-platform-queries/src/subscriptions/mod.rs new file mode 100644 index 00000000000..cdedf1ea72b --- /dev/null +++ b/packages/dash-platform-queries/src/subscriptions/mod.rs @@ -0,0 +1,237 @@ +//! Filters for the `subscribeToStateTransitions` stream: the SDK builds them, DAPI evaluates +//! them against committed state transitions. +//! +//! [`StateTransitionFilter`] converts to and from its wire message; +//! [`ResolvedFilters::resolve`] validates a request's filters and binds each document filter to +//! its data contract, and [`ResolvedFilters::matches`] tells which filters a transition matches. +//! +//! Matching reads only what a transition says: of a document before the transition only the +//! `$id` is known, except for the delete of an indexOnly document, which carries its values. +//! A filter is bound to the contract version current when it is resolved; from protocol 14 +//! contract updates cannot change what it reads. + +mod participants; +mod proto; +mod resolved; +#[cfg(test)] +mod tests; + +use dpp::address_funds::PlatformAddress; +use dpp::prelude::Identifier; +use drive::query::{ValueClause, WhereClause}; + +pub use proto::subscribe_request; +pub use resolved::{FilterMatch, ResolvedFilters}; + +/// Most filters one subscription may carry. +pub const MAX_FILTERS: usize = 16; +/// Most addresses one address filter may watch. +pub const MAX_ADDRESSES_PER_FILTER: usize = 256; +/// Most owner ids (transfer recipients or buyers) one action match may list. +pub const MAX_OWNER_IDS_PER_ACTION: usize = 64; +/// Most action matches one document filter may carry. +pub const MAX_ACTIONS_PER_DOCUMENT_FILTER: usize = 12; +/// Most where clauses one action match may carry, per document side. +pub const MAX_CLAUSES_PER_ACTION: usize = 16; + +/// Which side of a transition a watched address must be on. +#[derive(Debug, Clone, Copy, PartialEq, Eq, Default, Hash)] +pub enum Role { + /// Either side. + #[default] + Any, + /// An address input the transition spends from. + Sender, + /// An address the transition credits: an output or change output. + Recipient, +} + +impl Role { + /// Whether a party on side `side` satisfies this role. + pub fn admits(self, side: Role) -> bool { + self == Role::Any || self == side + } +} + +/// A document transition's action. +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord)] +pub enum DocumentAction { + /// A document is created. + Create, + /// A document is replaced. + Replace, + /// A document is deleted, including the delete of an indexOnly document. + Delete, + /// A document is transferred to another identity. + Transfer, + /// A document's price is set. + UpdatePrice, + /// A document is purchased. + Purchase, +} + +/// One action of a [`DocumentFilter`], optionally narrowed by clauses (ANDed together). +#[derive(Debug, Clone, PartialEq, Default)] +pub struct DocumentActionMatch { + /// The action; `None` only while building, rejected when resolved. + pub action: Option, + /// Create and replace: clauses on the document data the transition carries. + pub new_document_where: Vec, + /// Clauses on the document as it was before the transition: `$id` only, except for the + /// delete of an indexOnly document. + pub original_document_where: Vec, + /// Transfer: the recipient, purchase: the buyer, must be one of these identities. + pub owner_ids: Vec, + /// Update price: constraint on the new price. + pub price: Option, +} + +impl DocumentActionMatch { + /// Match every transition with `action`. + pub fn new(action: DocumentAction) -> Self { + Self { + action: Some(action), + ..Default::default() + } + } + + /// Add a clause on the new document data. + pub fn with_new_document_where(mut self, clause: WhereClause) -> Self { + self.new_document_where.push(clause); + self + } + + /// Add a clause on the document before the transition. + pub fn with_original_document_where(mut self, clause: WhereClause) -> Self { + self.original_document_where.push(clause); + self + } + + /// Require the transfer recipient or the buyer to be one of `owner_ids`. + pub fn with_owner_ids(mut self, owner_ids: impl IntoIterator) -> Self { + self.owner_ids.extend(owner_ids); + self + } + + /// Constrain the new price of an update-price. + pub fn with_price(mut self, price: ValueClause) -> Self { + self.price = Some(price); + self + } + + fn has_constraints(&self) -> bool { + !self.new_document_where.is_empty() + || !self.original_document_where.is_empty() + || !self.owner_ids.is_empty() + || self.price.is_some() + } +} + +/// Document transitions, in batch transitions, on one data contract. +#[derive(Debug, Clone, PartialEq)] +pub struct DocumentFilter { + /// The data contract. + pub data_contract_id: Identifier, + /// `None`: every document type of the contract; the actions may then carry no clauses. + pub document_type_name: Option, + /// Empty: every action. + pub actions: Vec, + /// The identity that owns (signs) the batch. + pub batch_owner_id: Option, +} + +impl DocumentFilter { + /// Every document transition on `data_contract_id`. + pub fn new(data_contract_id: Identifier) -> Self { + Self { + data_contract_id, + document_type_name: None, + actions: Vec::new(), + batch_owner_id: None, + } + } + + /// Only documents of `document_type_name`. + pub fn with_document_type(mut self, document_type_name: impl Into) -> Self { + self.document_type_name = Some(document_type_name.into()); + self + } + + /// Add an action alternative. + pub fn with_action(mut self, action: DocumentActionMatch) -> Self { + self.actions.push(action); + self + } + + /// Only batches owned (signed) by `batch_owner_id`. + pub fn with_batch_owner(mut self, batch_owner_id: Identifier) -> Self { + self.batch_owner_id = Some(batch_owner_id); + self + } +} + +/// One filter of a state transition subscription. +#[derive(Debug, Clone, PartialEq)] +pub enum StateTransitionFilter { + /// Document transitions on one data contract. + Documents(DocumentFilter), + /// Transitions that name one of these platform addresses on the `role` side. + Addresses { + /// The watched addresses. + addresses: Vec, + /// The side they must be on. + role: Role, + }, +} + +impl StateTransitionFilter { + /// The data contract a document filter names. + pub fn document_data_contract_id(&self) -> Option { + match self { + StateTransitionFilter::Documents(filter) => Some(filter.data_contract_id), + StateTransitionFilter::Addresses { .. } => None, + } + } +} + +/// Why a subscription's filters cannot be served. +#[derive(Debug, Clone, PartialEq, Eq, thiserror::Error)] +pub enum SubscriptionFilterError { + /// The request as a whole is malformed. + #[error("invalid subscription request: {0}")] + InvalidRequest(String), + /// One filter is malformed or cannot be decided from a transition. + #[error("invalid subscription filter {index}: {message}")] + InvalidFilter { + /// Position of the filter in the request. + index: usize, + /// What is wrong. + message: String, + }, + /// A document filter names a data contract that does not exist. + #[error("data contract {0} not found")] + DataContractNotFound(Identifier), +} + +/// Checks that a subscription carries 1 to [`MAX_FILTERS`] filters. +pub fn check_filter_count(count: usize) -> Result<(), SubscriptionFilterError> { + if count == 0 || count > MAX_FILTERS { + return Err(SubscriptionFilterError::InvalidRequest(format!( + "a subscription takes 1 to {MAX_FILTERS} filters, got {count}" + ))); + } + Ok(()) +} + +impl SubscriptionFilterError { + fn filter(index: usize, message: impl Into) -> Self { + Self::InvalidFilter { + index, + message: message.into(), + } + } +} + +fn missing_action() -> String { + "every action match must name its action".to_string() +} diff --git a/packages/dash-platform-queries/src/subscriptions/participants.rs b/packages/dash-platform-queries/src/subscriptions/participants.rs new file mode 100644 index 00000000000..18ec69a123f --- /dev/null +++ b/packages/dash-platform-queries/src/subscriptions/participants.rs @@ -0,0 +1,80 @@ +//! The platform addresses a state transition names, read from the transition alone. + +use super::Role; +use dpp::address_funds::PlatformAddress; +use dpp::state_transition::address_credit_withdrawal_transition::accessors::AddressCreditWithdrawalTransitionAccessorsV0; +use dpp::state_transition::address_funding_from_asset_lock_transition::accessors::AddressFundingFromAssetLockTransitionAccessorsV0; +use dpp::state_transition::address_funds_transfer_transition::accessors::AddressFundsTransferTransitionAccessorsV0; +use dpp::state_transition::identity_create_from_addresses_transition::accessors::IdentityCreateFromAddressesTransitionAccessorsV0; +use dpp::state_transition::identity_credit_transfer_to_addresses_transition::accessors::IdentityCreditTransferToAddressesTransitionAccessorsV0; +use dpp::state_transition::identity_topup_from_addresses_transition::accessors::IdentityTopUpFromAddressesTransitionAccessorsV0; +use dpp::state_transition::shield_from_asset_lock_transition::accessors::ShieldFromAssetLockTransitionAccessorsV0; +use dpp::state_transition::state_transitions::shielded::identity_create_from_shielded_pool_transition::accessors::IdentityCreateFromShieldedPoolTransitionAccessorsV0; +use dpp::state_transition::unshield_transition::accessors::UnshieldTransitionAccessorsV0; +use dpp::state_transition::StateTransition; + +/// The platform addresses `state_transition` names, each with its side: the inputs it spends +/// from are senders, the outputs it credits recipients. +pub(super) fn addresses(state_transition: &StateTransition) -> Vec<(PlatformAddress, Role)> { + // Every variant is listed, so a new one must be classified here. + let recipients: Vec<&PlatformAddress> = match state_transition { + StateTransition::IdentityCreditTransferToAddresses(transition) => { + transition.recipient_addresses().keys().collect() + } + StateTransition::AddressFundsTransfer(transition) => transition.outputs().keys().collect(), + StateTransition::AddressFundingFromAssetLock(transition) => { + transition.outputs().keys().collect() + } + StateTransition::IdentityCreateFromAddresses(transition) => { + transition.output().map(|(address, _)| address).into_iter().collect() + } + StateTransition::IdentityTopUpFromAddresses(transition) => { + transition.output().map(|(address, _)| address).into_iter().collect() + } + StateTransition::AddressCreditWithdrawal(transition) => { + transition.output().map(|(address, _)| address).into_iter().collect() + } + StateTransition::Unshield(transition) => vec![transition.output_address()], + StateTransition::ShieldFromAssetLock(transition) => { + transition.surplus_output().into_iter().collect() + } + // Credited instead when the identity cannot be created. + StateTransition::IdentityCreateFromShieldedPool(transition) => { + vec![transition.send_to_address_on_creation_failure()] + } + // Shield spends address inputs (listed below) but credits the shielded pool. + StateTransition::Shield(_) + | StateTransition::DataContractCreate(_) + | StateTransition::DataContractUpdate(_) + | StateTransition::ContractUserModeration(_) + | StateTransition::ContractFeeClaim(_) + | StateTransition::Batch(_) + | StateTransition::IdentityCreate(_) + | StateTransition::IdentityTopUp(_) + | StateTransition::IdentityCreditWithdrawal(_) + | StateTransition::IdentityUpdate(_) + | StateTransition::IdentityKeyLimitsUpdate(_) + | StateTransition::IdentityCreditTransfer(_) + | StateTransition::MasternodeVote(_) + | StateTransition::ShieldFromIdentity(_) + | StateTransition::IdentityTopUpFromShieldedPool(_) + // Shielded senders and recipients are not public. + | StateTransition::ShieldedTransfer(_) + | StateTransition::ShieldedWithdrawal(_) + | StateTransition::TokenShieldedTransferWithShieldedFee(_) + | StateTransition::TokenPurchaseFromShieldedPool(_) + | StateTransition::TokenUnshieldWithShieldedFee(_) => vec![], + }; + let senders = state_transition + .inputs() + .into_iter() + .flat_map(|inputs| inputs.keys()); + senders + .map(|address| (*address, Role::Sender)) + .chain( + recipients + .into_iter() + .map(|address| (*address, Role::Recipient)), + ) + .collect() +} diff --git a/packages/dash-platform-queries/src/subscriptions/proto.rs b/packages/dash-platform-queries/src/subscriptions/proto.rs new file mode 100644 index 00000000000..b060bb0d29c --- /dev/null +++ b/packages/dash-platform-queries/src/subscriptions/proto.rs @@ -0,0 +1,278 @@ +//! Conversion between [`StateTransitionFilter`] and its wire message. + +use super::{ + check_filter_count, missing_action, DocumentAction, DocumentActionMatch, DocumentFilter, Role, + StateTransitionFilter, SubscriptionFilterError, +}; +use crate::documents::document_query::{ + value_to_proto, where_clause_to_proto, where_operator_to_proto, +}; +use crate::documents::from_proto::{ + value_from_proto, where_clauses_from_proto, where_operator_from_proto, +}; +use crate::error::Error; +use dapi_grpc::platform::v0::get_documents_request::{ + WhereClause as ProtoWhereClause, WhereOperator as ProtoWhereOperator, +}; +use dapi_grpc::platform::v0::subscribe_to_state_transitions_request::{ + self as proto, document_filter, state_transition_filter, SubscribeToStateTransitionsRequestV0, + Version, +}; +use dapi_grpc::platform::v0::SubscribeToStateTransitionsRequest; +use dpp::address_funds::PlatformAddress; +use dpp::platform_value::Value; +use dpp::prelude::Identifier; +use drive::query::{ValueClause, WhereClause}; + +/// Build a subscription request for `filters`, scanning from `from_block_height` (inclusive), +/// or from after the current tip when `None`. +pub fn subscribe_request( + filters: &[StateTransitionFilter], + from_block_height: Option, +) -> Result { + check_filter_count(filters.len()).map_err(|e| Error::Config(e.to_string()))?; + Ok(SubscribeToStateTransitionsRequest { + version: Some(Version::V0(SubscribeToStateTransitionsRequestV0 { + filters: filters + .iter() + .map(StateTransitionFilter::to_proto) + .collect::>()?, + from_block_height, + })), + }) +} + +impl StateTransitionFilter { + /// The filter's wire message. + pub fn to_proto(&self) -> Result { + let filter = match self { + StateTransitionFilter::Documents(filter) => { + state_transition_filter::Filter::Documents(document_filter_to_proto(filter)?) + } + StateTransitionFilter::Addresses { addresses, role } => { + state_transition_filter::Filter::Addresses(proto::AddressFilter { + addresses: addresses.iter().map(PlatformAddress::to_bytes).collect(), + role: role_to_proto(*role) as i32, + }) + } + }; + Ok(proto::StateTransitionFilter { + filter: Some(filter), + }) + } + + /// Decode the filter at position `index` of a request. + pub fn from_proto( + index: usize, + filter: proto::StateTransitionFilter, + ) -> Result { + let invalid = |message: String| SubscriptionFilterError::filter(index, message); + let filter = filter + .filter + .ok_or_else(|| invalid("no filter kind is set".to_string()))?; + Ok(match filter { + state_transition_filter::Filter::Documents(filter) => StateTransitionFilter::Documents( + document_filter_from_proto(filter).map_err(invalid)?, + ), + state_transition_filter::Filter::Addresses(filter) => { + StateTransitionFilter::Addresses { + addresses: filter + .addresses + .iter() + .map(|bytes| { + PlatformAddress::from_bytes(bytes) + .map_err(|e| invalid(format!("invalid platform address: {e}"))) + }) + .collect::>()?, + role: role_from_proto(filter.role).map_err(invalid)?, + } + } + }) + } +} + +fn document_filter_to_proto(filter: &DocumentFilter) -> Result { + Ok(proto::DocumentFilter { + data_contract_id: filter.data_contract_id.to_vec(), + document_type_name: filter.document_type_name.clone(), + actions: filter + .actions + .iter() + .map(action_match_to_proto) + .collect::>()?, + batch_owner_id: filter.batch_owner_id.map(|id| id.to_vec()), + }) +} + +/// A clause operand as sent: 128-bit integers become 64-bit, since the shared encoder sends +/// 128-bit integers as text, which the node reads as text. One that does not fit has no wire form. +fn narrowed(value: &Value) -> Result { + let too_wide = || { + Error::Config(format!( + "the clause value {value:?} does not fit 64 bits, so it cannot be sent" + )) + }; + match value { + Value::U128(n) => u64::try_from(*n).map(Value::U64).map_err(|_| too_wide()), + Value::I128(n) => i64::try_from(*n) + .map(Value::I64) + .or_else(|_| u64::try_from(*n).map(Value::U64)) + .map_err(|_| too_wide()), + Value::Array(values) => values + .iter() + .map(narrowed) + .collect::>() + .map(Value::Array), + _ => Ok(value.clone()), + } +} + +fn where_clauses_to_proto(clauses: &[WhereClause]) -> Result, Error> { + clauses + .iter() + .map(|clause| { + where_clause_to_proto(WhereClause { + field: clause.field.clone(), + operator: clause.operator, + value: narrowed(&clause.value)?, + }) + }) + .collect() +} + +fn action_match_to_proto( + action: &DocumentActionMatch, +) -> Result { + let action_kind = action + .action + .ok_or_else(|| Error::Config("a document action match must name its action".to_string()))?; + Ok(document_filter::ActionMatch { + action: Some(action_to_proto(action_kind) as i32), + new_document_where: where_clauses_to_proto(&action.new_document_where)?, + original_document_where: where_clauses_to_proto(&action.original_document_where)?, + owner_ids: action.owner_ids.iter().map(Identifier::to_vec).collect(), + price: action + .price + .as_ref() + .map(|price| { + Ok::<_, Error>(document_filter::PriceClause { + operator: where_operator_to_proto(price.operator) as i32, + value: Some(value_to_proto(narrowed(&price.value)?)?), + }) + }) + .transpose()?, + }) +} + +fn document_filter_from_proto(filter: proto::DocumentFilter) -> Result { + Ok(DocumentFilter { + data_contract_id: identifier(&filter.data_contract_id)?, + document_type_name: filter.document_type_name, + actions: filter + .actions + .into_iter() + .map(action_match_from_proto) + .collect::>()?, + batch_owner_id: filter + .batch_owner_id + .as_deref() + .map(identifier) + .transpose()?, + }) +} + +fn action_match_from_proto( + action: document_filter::ActionMatch, +) -> Result { + let value = action.action.ok_or_else(missing_action)?; + let action_kind = document_filter::Action::try_from(value) + .map_err(|_| format!("unknown document action {value}"))?; + let where_clauses = |clauses: Vec| { + clauses + .iter() + .try_for_each(|clause| refuse_window_selection(clause.operator))?; + where_clauses_from_proto(clauses) + }; + Ok(DocumentActionMatch { + action: Some(action_from_proto(action_kind)), + new_document_where: where_clauses(action.new_document_where)?, + original_document_where: where_clauses(action.original_document_where)?, + owner_ids: action + .owner_ids + .iter() + .map(|bytes| identifier(bytes)) + .collect::>()?, + price: action + .price + .map(|price| { + refuse_window_selection(price.operator)?; + Ok::<_, String>(ValueClause { + operator: where_operator_from_proto(price.operator)?, + value: value_from_proto( + price + .value + .ok_or_else(|| "the price clause has no value".to_string())?, + )?, + }) + }) + .transpose()?, + }) +} + +/// Time and integer window selections resolve against the documents a query reads; a +/// transition has no window to be in. +fn refuse_window_selection(operator: i32) -> Result<(), String> { + if operator == ProtoWhereOperator::InTimeRange as i32 + || operator == ProtoWhereOperator::InIntegerRange as i32 + { + return Err( + "time and integer range selections are not supported in subscriptions".to_string(), + ); + } + Ok(()) +} + +fn identifier(bytes: &[u8]) -> Result { + Identifier::from_bytes(bytes) + .map_err(|_| format!("expected a 32-byte identifier, got {} bytes", bytes.len())) +} + +fn role_to_proto(role: Role) -> proto::Role { + match role { + Role::Any => proto::Role::Any, + Role::Sender => proto::Role::Sender, + Role::Recipient => proto::Role::Recipient, + } +} + +fn role_from_proto(role: i32) -> Result { + Ok( + match proto::Role::try_from(role).map_err(|_| format!("unknown role {role}"))? { + proto::Role::Any => Role::Any, + proto::Role::Sender => Role::Sender, + proto::Role::Recipient => Role::Recipient, + }, + ) +} + +fn action_to_proto(action: DocumentAction) -> document_filter::Action { + match action { + DocumentAction::Create => document_filter::Action::Create, + DocumentAction::Replace => document_filter::Action::Replace, + DocumentAction::Delete => document_filter::Action::Delete, + DocumentAction::Transfer => document_filter::Action::Transfer, + DocumentAction::UpdatePrice => document_filter::Action::UpdatePrice, + DocumentAction::Purchase => document_filter::Action::Purchase, + } +} + +fn action_from_proto(action: document_filter::Action) -> DocumentAction { + match action { + document_filter::Action::Create => DocumentAction::Create, + document_filter::Action::Replace => DocumentAction::Replace, + document_filter::Action::Delete => DocumentAction::Delete, + document_filter::Action::Transfer => DocumentAction::Transfer, + document_filter::Action::UpdatePrice => DocumentAction::UpdatePrice, + document_filter::Action::Purchase => DocumentAction::Purchase, + } +} diff --git a/packages/dash-platform-queries/src/subscriptions/resolved.rs b/packages/dash-platform-queries/src/subscriptions/resolved.rs new file mode 100644 index 00000000000..a2471d362ee --- /dev/null +++ b/packages/dash-platform-queries/src/subscriptions/resolved.rs @@ -0,0 +1,395 @@ +//! Filters validated and bound to their data contracts, and matching. + +use super::participants::addresses; +use super::{ + check_filter_count, missing_action, DocumentAction, DocumentActionMatch, DocumentFilter, Role, + StateTransitionFilter, SubscriptionFilterError, MAX_ACTIONS_PER_DOCUMENT_FILTER, + MAX_ADDRESSES_PER_FILTER, MAX_CLAUSES_PER_ACTION, MAX_OWNER_IDS_PER_ACTION, +}; +use dpp::address_funds::PlatformAddress; +use dpp::data_contract::accessors::v0::DataContractV0Getters; +use dpp::data_contract::document_type::accessors::DocumentTypeV2Getters; +use dpp::data_contract::DataContract; +use dpp::platform_value::Value; +use dpp::prelude::Identifier; +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::BatchedTransitionRef; +use dpp::state_transition::batch_transition::document_base_transition::v0::v0_methods::DocumentBaseTransitionV0Methods; +use dpp::state_transition::{StateTransition, StateTransitionOwned}; +use dpp::version::PlatformVersion; +use drive::query::filter::{ + canonicalize_where_clause, DocumentActionMatchClauses, DriveDocumentQueryFilter, + TransitionCheckResult, +}; +use drive::query::{InternalClauses, ValueClause, WhereClause, WhereOperator}; +use std::collections::BTreeSet; +use std::sync::Arc; + +/// Why a transition matched: the request filters it matched and, for a batch, the positions of +/// its document transitions that did. +#[derive(Debug, Clone, Default, PartialEq, Eq)] +pub struct FilterMatch { + /// Indexes of the matched filters, in request order. + pub matched_filters: Vec, + /// Positions, in the batch's transitions, of the document transitions that matched. + pub matched_batch_positions: Vec, +} + +/// A subscription's filters, validated and bound to the data contracts their document filters +/// name. +#[derive(Debug, Clone)] +pub struct ResolvedFilters { + filters: Vec, +} + +#[derive(Debug, Clone)] +enum ResolvedFilter { + Documents(ResolvedDocumentFilter), + Addresses { + addresses: BTreeSet, + role: Role, + }, +} + +#[derive(Debug, Clone)] +struct ResolvedDocumentFilter { + data_contract_id: Identifier, + document_type_name: Option, + batch_owner_id: Option, + actions: ResolvedActions, +} + +#[derive(Debug, Clone)] +enum ResolvedActions { + /// Every action. + Any, + /// These actions, on any document type of the contract. + Kinds(BTreeSet), + /// One Drive filter per action alternative, on the filter's document type. + Clauses(Vec>>), +} + +impl ResolvedFilters { + /// The data contracts the document filters among `filters` name; resolving needs them. + pub fn data_contract_ids(filters: &[StateTransitionFilter]) -> BTreeSet { + filters + .iter() + .filter_map(StateTransitionFilter::document_data_contract_id) + .collect() + } + + /// Validate `filters` and bind each document filter to its contract, looked up by + /// `data_contract`; clause values are brought to their fields' types. + pub fn resolve( + filters: Vec, + data_contract: impl Fn(&Identifier) -> Option>, + platform_version: &PlatformVersion, + ) -> Result { + check_filter_count(filters.len())?; + let filters = filters + .into_iter() + .enumerate() + .map(|(index, filter)| resolve_filter(index, filter, &data_contract, platform_version)) + .collect::>()?; + Ok(Self { filters }) + } + + /// Which filters `state_transition` matches, or `None` when it matches none. + /// `platform_version` is the version of the block the transition executed in. + pub fn matches( + &self, + state_transition: &StateTransition, + platform_version: &PlatformVersion, + ) -> Option { + // Read only when an address filter needs them. + let mut named_addresses = None; + let mut matched_filters = Vec::new(); + let mut matched_batch_positions = BTreeSet::new(); + + for (index, filter) in self.filters.iter().enumerate() { + let matched = match filter { + ResolvedFilter::Addresses { + addresses: watched, + role, + } => named_addresses + .get_or_insert_with(|| addresses(state_transition)) + .iter() + .any(|(address, side)| role.admits(*side) && watched.contains(address)), + ResolvedFilter::Documents(filter) => { + let StateTransition::Batch(batch) = state_transition else { + continue; + }; + let batch_owner_id = batch.owner_id(); + let mut matched = false; + for (position, transition) in batch.transitions_iter().enumerate() { + if let BatchedTransitionRef::Document(transition) = transition { + if filter.matches(transition, batch_owner_id, platform_version) { + matched = true; + matched_batch_positions.insert(position as u32); + } + } + } + matched + } + }; + if matched { + matched_filters.push(index as u32); + } + } + + (!matched_filters.is_empty()).then(|| FilterMatch { + matched_filters, + matched_batch_positions: matched_batch_positions.into_iter().collect(), + }) + } +} + +impl ResolvedDocumentFilter { + fn matches( + &self, + transition: &DocumentTransition, + batch_owner_id: Identifier, + platform_version: &PlatformVersion, + ) -> bool { + let base = transition.base(); + if base.data_contract_id() != self.data_contract_id + || self + .document_type_name + .as_ref() + .is_some_and(|name| base.document_type_name() != name) + || self + .batch_owner_id + .is_some_and(|owner| owner != batch_owner_id) + { + return false; + } + match &self.actions { + ResolvedActions::Any => true, + ResolvedActions::Kinds(actions) => actions.contains(&action_of(transition)), + ResolvedActions::Clauses(alternatives) => { + let batch_owner = Value::from(batch_owner_id); + alternatives.iter().any(|filter| { + filter.matches_document_transition( + transition, + Some(&batch_owner), + platform_version, + ) == TransitionCheckResult::Pass + }) + } + } + } +} + +fn action_of(transition: &DocumentTransition) -> DocumentAction { + match transition { + DocumentTransition::Create(_) => DocumentAction::Create, + DocumentTransition::Replace(_) => DocumentAction::Replace, + DocumentTransition::Delete(_) | DocumentTransition::IndexOnlyDelete(_) => { + DocumentAction::Delete + } + DocumentTransition::Transfer(_) => DocumentAction::Transfer, + DocumentTransition::UpdatePrice(_) => DocumentAction::UpdatePrice, + DocumentTransition::Purchase(_) => DocumentAction::Purchase, + } +} + +fn resolve_filter( + index: usize, + filter: StateTransitionFilter, + data_contract: &impl Fn(&Identifier) -> Option>, + platform_version: &PlatformVersion, +) -> Result { + let invalid = |message: String| SubscriptionFilterError::filter(index, message); + Ok(match filter { + StateTransitionFilter::Documents(filter) => { + let contract = data_contract(&filter.data_contract_id).ok_or( + SubscriptionFilterError::DataContractNotFound(filter.data_contract_id), + )?; + ResolvedFilter::Documents( + resolve_document_filter(filter, contract, platform_version).map_err(invalid)?, + ) + } + StateTransitionFilter::Addresses { addresses, role } => { + if addresses.is_empty() || addresses.len() > MAX_ADDRESSES_PER_FILTER { + return Err(invalid(format!( + "an address filter takes 1 to {MAX_ADDRESSES_PER_FILTER} addresses, got {}", + addresses.len() + ))); + } + ResolvedFilter::Addresses { + addresses: addresses.into_iter().collect(), + role, + } + } + }) +} + +fn resolve_document_filter( + filter: DocumentFilter, + contract: Arc, + platform_version: &PlatformVersion, +) -> Result { + if filter.actions.len() > MAX_ACTIONS_PER_DOCUMENT_FILTER { + return Err(format!( + "at most {MAX_ACTIONS_PER_DOCUMENT_FILTER} actions are allowed, got {}", + filter.actions.len() + )); + } + if let Some(document_type_name) = &filter.document_type_name { + if contract + .document_type_optional_for_name(document_type_name) + .is_none() + { + return Err(format!( + "data contract {} has no document type '{document_type_name}'", + contract.id() + )); + } + } + let actions = match &filter.document_type_name { + _ if filter.actions.is_empty() => ResolvedActions::Any, + None => { + if filter + .actions + .iter() + .any(DocumentActionMatch::has_constraints) + { + return Err("action clauses need a document type".to_string()); + } + ResolvedActions::Kinds( + filter + .actions + .iter() + .map(|action| action.action.ok_or_else(missing_action)) + .collect::>()?, + ) + } + Some(document_type_name) => ResolvedActions::Clauses( + filter + .actions + .iter() + .map(|action| drive_filter(action, &contract, document_type_name, platform_version)) + .collect::>()?, + ), + }; + Ok(ResolvedDocumentFilter { + data_contract_id: filter.data_contract_id, + document_type_name: filter.document_type_name, + batch_owner_id: filter.batch_owner_id, + actions, + }) +} + +/// The Drive filter for one action alternative, its clause values canonicalized and validated. +fn drive_filter( + action: &DocumentActionMatch, + contract: &Arc, + document_type_name: &str, + platform_version: &PlatformVersion, +) -> Result>, String> { + let kind = action.action.ok_or_else(missing_action)?; + for (clauses, side) in [ + (&action.new_document_where, "new document"), + (&action.original_document_where, "original document"), + ] { + if clauses.len() > MAX_CLAUSES_PER_ACTION { + return Err(format!( + "at most {MAX_CLAUSES_PER_ACTION} {side} clauses are allowed, got {}", + clauses.len() + )); + } + } + if action.owner_ids.len() > MAX_OWNER_IDS_PER_ACTION { + return Err(format!( + "at most {MAX_OWNER_IDS_PER_ACTION} owner ids are allowed, got {}", + action.owner_ids.len() + )); + } + if !matches!(kind, DocumentAction::Create | DocumentAction::Replace) + && !action.new_document_where.is_empty() + { + return Err("new document clauses apply only to create and replace".to_string()); + } + if kind == DocumentAction::Create && !action.original_document_where.is_empty() { + return Err("a create has no original document".to_string()); + } + if !matches!(kind, DocumentAction::Transfer | DocumentAction::Purchase) + && !action.owner_ids.is_empty() + { + return Err("owner ids apply only to transfer and purchase".to_string()); + } + if kind != DocumentAction::UpdatePrice && action.price.is_some() { + return Err("a price clause applies only to update price".to_string()); + } + + let document_type = contract + .document_type_optional_for_name(document_type_name) + .ok_or_else(|| format!("no document type '{document_type_name}'"))?; + // Canonicalized before grouping, which pairs range bounds of one integer width only. + let extract = |clauses: &[WhereClause]| { + let mut clauses = clauses.to_vec(); + for clause in &mut clauses { + canonicalize_where_clause(document_type, clause).map_err(|e| e.to_string())?; + } + InternalClauses::extract_from_clauses(clauses, platform_version).map_err(|e| e.to_string()) + }; + let new_document_clauses = extract(&action.new_document_where)?; + let original_document_clauses = extract(&action.original_document_where)?; + + // Of a document before the transition, a transition carries only its `$id`, except an + // indexOnly document's delete, which carries its values. + let index_only_delete = kind == DocumentAction::Delete && document_type.index_only(); + let primary_key_only = original_document_clauses.in_clauses.is_empty() + && original_document_clauses.range_clause.is_none() + && original_document_clauses.equal_clauses.is_empty(); + if !index_only_delete && !primary_key_only { + return Err( + "clauses on the document before the transition may only name `$id`".to_string(), + ); + } + + let owner_clause = (!action.owner_ids.is_empty()).then(|| ValueClause { + operator: WhereOperator::In, + value: Value::Array(action.owner_ids.iter().copied().map(Value::from).collect()), + }); + let action_clauses = match kind { + DocumentAction::Create => DocumentActionMatchClauses::Create { + new_document_clauses, + }, + DocumentAction::Replace => DocumentActionMatchClauses::Replace { + original_document_clauses, + new_document_clauses, + }, + DocumentAction::Delete => DocumentActionMatchClauses::Delete { + original_document_clauses, + }, + DocumentAction::Transfer => DocumentActionMatchClauses::Transfer { + original_document_clauses, + owner_clause, + }, + DocumentAction::UpdatePrice => DocumentActionMatchClauses::UpdatePrice { + original_document_clauses, + price_clause: action.price.clone(), + }, + DocumentAction::Purchase => DocumentActionMatchClauses::Purchase { + original_document_clauses, + owner_clause, + }, + }; + + let mut filter = DriveDocumentQueryFilter { + contract: contract.clone(), + document_type_name: document_type_name.to_string(), + action_clauses, + }; + filter + .canonicalize_clause_values() + .map_err(|e| e.to_string())?; + if let Some(error) = filter.validate().errors.first() { + return Err(error.to_string()); + } + Ok(filter) +} diff --git a/packages/dash-platform-queries/src/subscriptions/tests.rs b/packages/dash-platform-queries/src/subscriptions/tests.rs new file mode 100644 index 00000000000..b3efab7245a --- /dev/null +++ b/packages/dash-platform-queries/src/subscriptions/tests.rs @@ -0,0 +1,962 @@ +use super::*; +use dapi_grpc::platform::v0::get_documents_request::{ + DocumentFieldValue as ProtoDocumentFieldValue, WhereClause as ProtoWhereClause, + WhereOperator as ProtoWhereOperator, +}; +use dapi_grpc::platform::v0::subscribe_to_state_transitions_request::{ + document_filter, state_transition_filter, DocumentFilter as ProtoDocumentFilter, + StateTransitionFilter as ProtoStateTransitionFilter, Version, +}; +use dpp::data_contract::accessors::v0::DataContractV0Getters; +use dpp::data_contract::{DataContract, DataContractFactory}; +use dpp::platform_value::platform_value; +use dpp::platform_value::string_encoding::Encoding; +use dpp::platform_value::Value; +use dpp::state_transition::address_credit_withdrawal_transition::v0::AddressCreditWithdrawalTransitionV0; +use dpp::state_transition::address_credit_withdrawal_transition::AddressCreditWithdrawalTransition; +use dpp::state_transition::address_funding_from_asset_lock_transition::v0::AddressFundingFromAssetLockTransitionV0; +use dpp::state_transition::address_funding_from_asset_lock_transition::AddressFundingFromAssetLockTransition; +use dpp::state_transition::address_funds_transfer_transition::v0::AddressFundsTransferTransitionV0; +use dpp::state_transition::address_funds_transfer_transition::AddressFundsTransferTransition; +use dpp::state_transition::batch_transition::batched_transition::document_create_transition::v0::DocumentCreateTransitionV0; +use dpp::state_transition::batch_transition::batched_transition::document_create_transition::DocumentCreateTransition; +use dpp::state_transition::batch_transition::batched_transition::document_delete_transition::v0::DocumentDeleteTransitionV0; +use dpp::state_transition::batch_transition::batched_transition::document_delete_transition::DocumentDeleteTransition; +use dpp::state_transition::batch_transition::batched_transition::document_purchase_transition::v0::DocumentPurchaseTransitionV0; +use dpp::state_transition::batch_transition::batched_transition::document_purchase_transition::DocumentPurchaseTransition; +use dpp::state_transition::batch_transition::batched_transition::document_transfer_transition::v0::DocumentTransferTransitionV0; +use dpp::state_transition::batch_transition::batched_transition::document_transfer_transition::DocumentTransferTransition; +use dpp::state_transition::batch_transition::batched_transition::document_transition::DocumentTransition; +use dpp::state_transition::batch_transition::batched_transition::BatchedTransition; +use dpp::state_transition::batch_transition::document_base_transition::v1::DocumentBaseTransitionV1; +use dpp::state_transition::batch_transition::document_base_transition::DocumentBaseTransition; +use dpp::state_transition::batch_transition::{BatchTransition, BatchTransitionV1}; +use dpp::state_transition::identity_create_from_addresses_transition::v0::IdentityCreateFromAddressesTransitionV0; +use dpp::state_transition::identity_create_from_addresses_transition::IdentityCreateFromAddressesTransition; +use dpp::state_transition::identity_create_from_shielded_pool_transition::v0::IdentityCreateFromShieldedPoolTransitionV0; +use dpp::state_transition::identity_create_from_shielded_pool_transition::IdentityCreateFromShieldedPoolTransition; +use dpp::state_transition::identity_credit_transfer_to_addresses_transition::v0::IdentityCreditTransferToAddressesTransitionV0; +use dpp::state_transition::identity_credit_transfer_to_addresses_transition::IdentityCreditTransferToAddressesTransition; +use dpp::state_transition::identity_topup_from_addresses_transition::v0::IdentityTopUpFromAddressesTransitionV0; +use dpp::state_transition::identity_topup_from_addresses_transition::IdentityTopUpFromAddressesTransition; +use dpp::state_transition::shield_from_asset_lock_transition::v0::ShieldFromAssetLockTransitionV0; +use dpp::state_transition::shield_from_asset_lock_transition::v1::ShieldFromAssetLockTransitionV1; +use dpp::state_transition::shield_from_asset_lock_transition::ShieldFromAssetLockTransition; +use dpp::state_transition::shield_transition::v0::ShieldTransitionV0; +use dpp::state_transition::shield_transition::ShieldTransition; +use dpp::state_transition::unshield_transition::v0::UnshieldTransitionV0; +use dpp::state_transition::unshield_transition::UnshieldTransition; +use dpp::state_transition::StateTransition; +use dpp::tests::fixtures::get_data_contract_fixture; +use dpp::version::PlatformVersion; +use drive::query::{ValueClause, WhereClause, WhereOperator}; +use std::collections::BTreeMap; +use std::sync::Arc; + +fn id(byte: u8) -> Identifier { + Identifier::from([byte; 32]) +} + +fn contract() -> Arc { + Arc::new( + get_data_contract_fixture(None, 0, PlatformVersion::latest().protocol_version) + .data_contract_owned(), + ) +} + +fn resolve( + filters: Vec, + contract: &Arc, +) -> Result { + let contract = contract.clone(); + ResolvedFilters::resolve( + filters, + move |requested| (*requested == contract.id()).then(|| contract.clone()), + PlatformVersion::latest(), + ) +} + +/// `filter` after a round trip through its wire message. +fn over_the_wire(filter: &StateTransitionFilter) -> StateTransitionFilter { + StateTransitionFilter::from_proto(0, filter.to_proto().unwrap()).unwrap() +} + +fn address_transfer(from: PlatformAddress, to: PlatformAddress) -> StateTransition { + StateTransition::AddressFundsTransfer(AddressFundsTransferTransition::V0( + AddressFundsTransferTransitionV0 { + inputs: BTreeMap::from([(from, (1, 5000))]), + outputs: BTreeMap::from([(to, 4000)]), + ..Default::default() + }, + )) +} + +fn batch(owner: Identifier, transitions: Vec) -> StateTransition { + StateTransition::Batch(BatchTransition::V1(BatchTransitionV1 { + owner_id: owner, + transitions, + user_fee_increase: 0, + signature_public_key_id: 0, + signature: Default::default(), + })) +} + +fn document_base(contract: &DataContract, doc: u8) -> DocumentBaseTransition { + DocumentBaseTransition::V1(DocumentBaseTransitionV1 { + id: id(doc), + document_type_name: "niceDocument".to_string(), + data_contract_id: contract.id(), + identity_contract_nonce: 0, + token_payment_info: None, + }) +} + +fn create_document(contract: &DataContract, doc: u8, name: &str) -> BatchedTransition { + BatchedTransition::Document(DocumentTransition::Create(DocumentCreateTransition::V0( + DocumentCreateTransitionV0 { + base: document_base(contract, doc), + entropy: [0u8; 32], + data: BTreeMap::from([("name".to_string(), Value::Text(name.to_string()))]), + prefunded_voting_balance: None, + }, + ))) +} + +fn delete_document(contract: &DataContract, doc: u8) -> BatchedTransition { + BatchedTransition::Document(DocumentTransition::Delete(DocumentDeleteTransition::V0( + DocumentDeleteTransitionV0 { + base: document_base(contract, doc), + }, + ))) +} + +fn transfer_document(contract: &DataContract, doc: u8, recipient: Identifier) -> BatchedTransition { + BatchedTransition::Document(DocumentTransition::Transfer( + DocumentTransferTransition::V0(DocumentTransferTransitionV0 { + base: document_base(contract, doc), + revision: 2, + recipient_owner_id: recipient, + }), + )) +} + +fn purchase_document(contract: &DataContract, doc: u8) -> BatchedTransition { + BatchedTransition::Document(DocumentTransition::Purchase( + DocumentPurchaseTransition::V0(DocumentPurchaseTransitionV0 { + base: document_base(contract, doc), + revision: 2, + price: 100, + }), + )) +} + +fn name_equals(name: &str) -> WhereClause { + WhereClause { + field: "name".to_string(), + operator: WhereOperator::Equal, + value: Value::Text(name.to_string()), + } +} + +/// A filter on `niceDocument` with the one action alternative `action`. +fn nice_documents(contract: &DataContract, action: DocumentActionMatch) -> StateTransitionFilter { + StateTransitionFilter::Documents( + DocumentFilter::new(contract.id()) + .with_document_type("niceDocument") + .with_action(action), + ) +} + +fn matches(filters: &ResolvedFilters, state_transition: &StateTransition) -> Option { + filters.matches(state_transition, PlatformVersion::latest()) +} + +#[test] +fn should_match_address_filters_by_role() { + let contract = contract(); + let from = PlatformAddress::P2pkh([1u8; 20]); + let to = PlatformAddress::P2sh([2u8; 20]); + let transfer = address_transfer(from, to); + + for (address, role, expected) in [ + (to, Role::Recipient, true), + (to, Role::Sender, false), + (from, Role::Sender, true), + (from, Role::Recipient, false), + (to, Role::Any, true), + (PlatformAddress::P2pkh([9u8; 20]), Role::Any, false), + ] { + let filters = resolve( + vec![StateTransitionFilter::Addresses { + addresses: vec![address], + role, + }], + &contract, + ) + .unwrap(); + assert_eq!( + matches(&filters, &transfer).is_some(), + expected, + "{address:?} as {role:?}" + ); + } +} + +fn address(byte: u8) -> PlatformAddress { + PlatformAddress::P2pkh([byte; 20]) +} + +fn funded_by(senders: &[PlatformAddress]) -> BTreeMap { + senders.iter().map(|sender| (*sender, (1, 5000))).collect() +} + +fn change_to(recipients: &[PlatformAddress]) -> Option<(PlatformAddress, u64)> { + recipients.first().map(|recipient| (*recipient, 1000)) +} + +/// Each variant that names addresses, with the senders and recipients it must be classified as. +fn address_role_cases() -> Vec<( + String, + StateTransition, + Vec, + Vec, +)> { + let (s1, s2, r1, r2) = (address(1), address(2), address(3), address(4)); + let mut cases = Vec::new(); + for (change, recipients) in [("with change", vec![r1]), ("without change", vec![])] { + let senders = vec![s1, s2]; + cases.push(( + format!("identity create from addresses {change}"), + StateTransition::IdentityCreateFromAddresses( + IdentityCreateFromAddressesTransition::V0( + IdentityCreateFromAddressesTransitionV0 { + inputs: funded_by(&senders), + output: change_to(&recipients), + ..Default::default() + }, + ), + ), + senders.clone(), + recipients.clone(), + )); + cases.push(( + format!("identity top up from addresses {change}"), + StateTransition::IdentityTopUpFromAddresses(IdentityTopUpFromAddressesTransition::V0( + IdentityTopUpFromAddressesTransitionV0 { + inputs: funded_by(&senders), + output: change_to(&recipients), + ..Default::default() + }, + )), + senders.clone(), + recipients.clone(), + )); + cases.push(( + format!("address credit withdrawal {change}"), + StateTransition::AddressCreditWithdrawal(AddressCreditWithdrawalTransition::V0( + AddressCreditWithdrawalTransitionV0 { + inputs: funded_by(&senders), + output: change_to(&recipients), + ..Default::default() + }, + )), + senders.clone(), + recipients.clone(), + )); + let surplus_output = recipients.first().copied(); + cases.push(( + format!("shield from asset lock v0 {change}"), + StateTransition::ShieldFromAssetLock(ShieldFromAssetLockTransition::V0( + ShieldFromAssetLockTransitionV0 { + asset_lock_proof: Default::default(), + actions: vec![], + value_balance: 1000, + anchor: [0; 32], + proof: vec![], + binding_signature: [0; 64], + surplus_output, + signature: Default::default(), + }, + )), + vec![], + recipients.clone(), + )); + cases.push(( + format!("shield from asset lock v1 {change}"), + StateTransition::ShieldFromAssetLock(ShieldFromAssetLockTransition::V1( + ShieldFromAssetLockTransitionV1 { + asset_lock_proof: Default::default(), + actions: vec![], + value_balance: 1000, + anchor: [0; 32], + proof: vec![], + binding_signature: [0; 64], + surplus_output, + signature: Default::default(), + }, + )), + vec![], + recipients, + )); + } + let name = |name: &str| name.to_string(); + cases.extend([ + ( + name("address funding from asset lock"), + StateTransition::AddressFundingFromAssetLock( + AddressFundingFromAssetLockTransition::V0( + AddressFundingFromAssetLockTransitionV0 { + inputs: funded_by(&[s1, s2]), + outputs: BTreeMap::from([(r1, None), (r2, Some(500))]), + ..Default::default() + }, + ), + ), + vec![s1, s2], + vec![r1, r2], + ), + ( + name("address funding from asset lock without inputs"), + StateTransition::AddressFundingFromAssetLock( + AddressFundingFromAssetLockTransition::V0( + AddressFundingFromAssetLockTransitionV0 { + outputs: BTreeMap::from([(r1, None)]), + ..Default::default() + }, + ), + ), + vec![], + vec![r1], + ), + ( + name("unshield"), + StateTransition::Unshield(UnshieldTransition::V0(UnshieldTransitionV0 { + output_address: r1, + actions: vec![], + unshielding_amount: 1000, + anchor: [0; 32], + proof: vec![], + binding_signature: [0; 64], + })), + vec![], + vec![r1], + ), + ( + name("shield spends address inputs and credits the pool"), + StateTransition::Shield(ShieldTransition::V0(ShieldTransitionV0 { + inputs: funded_by(&[s1, s2]), + actions: vec![], + amount: 1000, + anchor: [0; 32], + proof: vec![], + binding_signature: [0; 64], + fee_strategy: vec![], + user_fee_increase: 0, + input_witnesses: vec![], + })), + vec![s1, s2], + vec![], + ), + ( + name("identity create from shielded pool"), + StateTransition::IdentityCreateFromShieldedPool( + IdentityCreateFromShieldedPoolTransition::V0( + IdentityCreateFromShieldedPoolTransitionV0 { + public_keys: vec![], + denomination: 1000, + actions: vec![], + anchor: [0; 32], + proof: vec![], + binding_signature: [0; 64], + send_to_address_on_creation_failure: r1, + identity_id: id(7), + }, + ), + ), + vec![], + vec![r1], + ), + ( + name("identity credit transfer to addresses"), + StateTransition::IdentityCreditTransferToAddresses( + IdentityCreditTransferToAddressesTransition::V0( + IdentityCreditTransferToAddressesTransitionV0 { + recipient_addresses: BTreeMap::from([(r1, 100), (r2, 200)]), + ..Default::default() + }, + ), + ), + vec![], + vec![r1, r2], + ), + ]); + cases +} + +#[test] +fn should_classify_address_roles_for_every_variant_naming_addresses() { + let contract = contract(); + let stranger = address(99); + for (name, state_transition, senders, recipients) in address_role_cases() { + let matched = |address: PlatformAddress, role: Role| { + let filters = resolve( + vec![StateTransitionFilter::Addresses { + addresses: vec![address], + role, + }], + &contract, + ) + .unwrap(); + matches(&filters, &state_transition).is_some() + }; + for (addresses, own, other) in [ + (&senders, Role::Sender, Role::Recipient), + (&recipients, Role::Recipient, Role::Sender), + ] { + for address in addresses { + assert!(matched(*address, own), "{name}: {address:?} as {own:?}"); + assert!( + !matched(*address, other), + "{name}: {address:?} as {other:?}" + ); + assert!(matched(*address, Role::Any), "{name}: {address:?} as Any"); + } + } + for role in [Role::Sender, Role::Recipient, Role::Any] { + assert!(!matched(stranger, role), "{name}: stranger as {role:?}"); + } + } +} + +#[test] +fn should_report_every_matching_filter_and_batch_position() { + let contract = contract(); + let state_transition = batch( + id(1), + vec![ + create_document(&contract, 10, "alice"), + create_document(&contract, 11, "bob"), + transfer_document(&contract, 12, id(5)), + ], + ); + let filters = resolve( + vec![ + nice_documents( + &contract, + DocumentActionMatch::new(DocumentAction::Create) + .with_new_document_where(name_equals("bob")), + ), + StateTransitionFilter::Addresses { + addresses: vec![PlatformAddress::P2pkh([1u8; 20])], + role: Role::Any, + }, + nice_documents( + &contract, + DocumentActionMatch::new(DocumentAction::Transfer).with_owner_ids([id(5)]), + ), + ], + &contract, + ) + .unwrap(); + + assert_eq!( + matches(&filters, &state_transition), + Some(FilterMatch { + matched_filters: vec![0, 2], + matched_batch_positions: vec![1, 2], + }) + ); +} + +#[test] +fn should_match_document_filters_on_action_and_batch_owner() { + let contract = contract(); + let deleting = batch(id(1), vec![delete_document(&contract, 10)]); + let resolved = |filter: DocumentFilter| { + resolve(vec![StateTransitionFilter::Documents(filter)], &contract).unwrap() + }; + + let deletes = resolved( + DocumentFilter::new(contract.id()) + .with_action(DocumentActionMatch::new(DocumentAction::Delete)), + ); + assert!(matches(&deletes, &deleting).is_some()); + let creates = resolved( + DocumentFilter::new(contract.id()) + .with_action(DocumentActionMatch::new(DocumentAction::Create)), + ); + assert!(matches(&creates, &deleting).is_none()); + let someone_else = resolved(DocumentFilter::new(contract.id()).with_batch_owner(id(2))); + assert!(matches(&someone_else, &deleting).is_none()); + // Not a batch: no document filter matches. + let transfer = address_transfer( + PlatformAddress::P2pkh([1u8; 20]), + PlatformAddress::P2pkh([2u8; 20]), + ); + assert!(matches(&resolved(DocumentFilter::new(contract.id())), &transfer).is_none()); +} + +#[test] +fn should_match_a_specific_document_by_id_before_the_transition() { + let contract = contract(); + let filters = resolve( + vec![nice_documents( + &contract, + DocumentActionMatch::new(DocumentAction::Delete).with_original_document_where( + WhereClause { + field: "$id".to_string(), + operator: WhereOperator::Equal, + value: Value::Text(id(10).to_string(Encoding::Base58)), + }, + ), + )], + &contract, + ) + .unwrap(); + let deleting = |doc| batch(id(1), vec![delete_document(&contract, doc)]); + assert!(matches(&filters, &deleting(10)).is_some()); + assert!(matches(&filters, &deleting(11)).is_none()); +} + +#[test] +fn should_match_a_document_buyer_by_owner_ids() { + let contract = contract(); + let buyer = id(6); + let filters = resolve( + vec![nice_documents( + &contract, + DocumentActionMatch::new(DocumentAction::Purchase).with_owner_ids([buyer]), + )], + &contract, + ) + .unwrap(); + let purchase = |owner| { + batch( + owner, + vec![ + create_document(&contract, 11, "x"), + purchase_document(&contract, 10), + ], + ) + }; + assert_eq!( + matches(&filters, &purchase(buyer)), + Some(FilterMatch { + matched_filters: vec![0], + matched_batch_positions: vec![1], + }) + ); + assert!(matches(&filters, &purchase(id(7))).is_none()); +} + +#[test] +fn should_reject_invalid_document_filters() { + let contract = contract(); + for filter in [ + // Only `$id` is known of the document before a plain delete. + nice_documents( + &contract, + DocumentActionMatch::new(DocumentAction::Delete) + .with_original_document_where(name_equals("bob")), + ), + // Clauses need a document type. + StateTransitionFilter::Documents( + DocumentFilter::new(contract.id()).with_action( + DocumentActionMatch::new(DocumentAction::Create) + .with_new_document_where(name_equals("bob")), + ), + ), + // Owner ids apply only to transfers and purchases. + nice_documents( + &contract, + DocumentActionMatch::new(DocumentAction::Create).with_owner_ids([id(1)]), + ), + StateTransitionFilter::Documents( + DocumentFilter::new(contract.id()).with_document_type("noSuchType"), + ), + ] { + assert!( + matches!( + resolve(vec![filter.clone()], &contract), + Err(SubscriptionFilterError::InvalidFilter { index: 0, .. }) + ), + "{filter:?}" + ); + } + assert_eq!( + resolve( + vec![StateTransitionFilter::Documents(DocumentFilter::new(id( + 99 + )))], + &contract + ) + .unwrap_err(), + SubscriptionFilterError::DataContractNotFound(id(99)) + ); +} + +#[test] +fn should_enforce_filter_limits() { + let contract = contract(); + let addresses = |count: usize| StateTransitionFilter::Addresses { + addresses: (0..count) + .map(|i| { + let mut hash = [0u8; 20]; + hash[..8].copy_from_slice(&(i as u64).to_be_bytes()); + PlatformAddress::P2pkh(hash) + }) + .collect(), + role: Role::Any, + }; + let owners = |count: usize| { + nice_documents( + &contract, + DocumentActionMatch::new(DocumentAction::Transfer) + .with_owner_ids((0..count).map(|i| id(i as u8))), + ) + }; + assert!(resolve(vec![], &contract).is_err()); + assert!(resolve(vec![addresses(1); MAX_FILTERS], &contract).is_ok()); + assert!(resolve(vec![addresses(1); MAX_FILTERS + 1], &contract).is_err()); + assert!(resolve(vec![addresses(0)], &contract).is_err()); + assert!(resolve(vec![addresses(MAX_ADDRESSES_PER_FILTER)], &contract).is_ok()); + assert!(resolve(vec![addresses(MAX_ADDRESSES_PER_FILTER + 1)], &contract).is_err()); + assert!(resolve(vec![owners(MAX_OWNER_IDS_PER_ACTION)], &contract).is_ok()); + assert!(resolve(vec![owners(MAX_OWNER_IDS_PER_ACTION + 1)], &contract).is_err()); +} + +#[test] +fn should_round_trip_filters_through_their_wire_form() { + let contract = contract(); + let filters = vec![ + StateTransitionFilter::Documents( + DocumentFilter::new(contract.id()) + .with_document_type("niceDocument") + .with_batch_owner(id(3)) + .with_action( + DocumentActionMatch::new(DocumentAction::Create) + .with_new_document_where(name_equals("bob")), + ) + .with_action( + DocumentActionMatch::new(DocumentAction::Transfer).with_owner_ids([id(4)]), + ) + .with_action( + DocumentActionMatch::new(DocumentAction::UpdatePrice).with_price(ValueClause { + operator: WhereOperator::GreaterThan, + value: Value::U64(10), + }), + ), + ), + StateTransitionFilter::Addresses { + addresses: vec![ + PlatformAddress::P2pkh([1u8; 20]), + PlatformAddress::P2sh([2u8; 20]), + ], + role: Role::Recipient, + }, + ]; + let request = subscribe_request(&filters, Some(42)).unwrap(); + let Some(Version::V0(v0)) = request.version else { + panic!("expected a v0 request"); + }; + assert_eq!(v0.from_block_height, Some(42)); + let decoded = v0 + .filters + .into_iter() + .enumerate() + .map(|(index, filter)| StateTransitionFilter::from_proto(index, filter)) + .collect::, _>>() + .unwrap(); + assert_eq!(decoded, filters); +} + +#[test] +fn should_reject_malformed_wire_action_matches() { + let time_range = ProtoWhereClause { + field: "$createdAt".to_string(), + operator: ProtoWhereOperator::InTimeRange as i32, + value: Some(ProtoDocumentFieldValue::default()), + ..Default::default() + }; + for action in [ + document_filter::ActionMatch { + action: None, + ..Default::default() + }, + document_filter::ActionMatch { + action: Some(document_filter::Action::Create as i32), + new_document_where: vec![time_range], + ..Default::default() + }, + ] { + let filter = ProtoStateTransitionFilter { + filter: Some(state_transition_filter::Filter::Documents( + ProtoDocumentFilter { + data_contract_id: id(1).to_vec(), + document_type_name: Some("niceDocument".to_string()), + actions: vec![action], + batch_owner_id: None, + }, + )), + }; + assert!(matches!( + StateTransitionFilter::from_proto(3, filter), + Err(SubscriptionFilterError::InvalidFilter { index: 3, .. }) + )); + } +} + +#[test] +fn should_resolve_wide_integer_operands_the_same_after_the_wire() { + let contract = contract(); + for price in [Value::U128(50), Value::I128(1_i128 << 63)] { + let filter = nice_documents( + &contract, + DocumentActionMatch::new(DocumentAction::UpdatePrice).with_price(ValueClause { + operator: WhereOperator::Equal, + value: price, + }), + ); + resolve(vec![filter.clone()], &contract).expect("resolves natively"); + resolve(vec![over_the_wire(&filter)], &contract).expect("resolves after the wire"); + } +} + +#[test] +fn should_bound_price_in_candidates() { + let contract = contract(); + let price_in = |values: Vec| { + nice_documents( + &contract, + DocumentActionMatch::new(DocumentAction::UpdatePrice).with_price(ValueClause { + operator: WhereOperator::In, + value: Value::Array(values), + }), + ) + }; + let too_many = price_in((0..20_000u64).map(|n| Value::U64(n % 3)).collect()); + let duplicates = price_in(vec![Value::U64(1), Value::U64(1)]); + // The same price in two encodings: distinct values, but one price once normalized. + let mixed_duplicates = price_in(vec![Value::I64(1), Value::U64(1)]); + for filter in [too_many, duplicates, mixed_duplicates] { + assert!(resolve(vec![filter.clone()], &contract).is_err()); + assert!(resolve(vec![over_the_wire(&filter)], &contract).is_err()); + } + assert!(resolve( + vec![price_in(vec![Value::U64(1), Value::U64(2)])], + &contract + ) + .is_ok()); +} + +/// A contract with one document type, `rating`: a u8 `stars`, a float `value`, a byte +/// array `blob`, an identifier `author` and a u16 typed array `ranks`. +fn rating_contract() -> Arc { + let documents = platform_value!({ + "rating": { + "type": "object", + "properties": { + "stars": { "type": "integer", "minimum": 0, "maximum": 255, "position": 0 }, + "value": { "type": "number", "position": 1 }, + "blob": { "type": "array", "byteArray": true, "maxItems": 16u32, "position": 2 }, + "author": { + "type": "array", "byteArray": true, "minItems": 32u32, "maxItems": 32u32, + "contentMediaType": "application/x.dash.dpp.identifier", "position": 3 + }, + "ranks": { + "type": "array", "maxItems": 8u32, + "items": { "type": "integer", "minimum": 0, "maximum": 65535 }, + "position": 4 + } + }, + "additionalProperties": false + } + }); + Arc::new( + DataContractFactory::new(PlatformVersion::latest().protocol_version) + .expect("factory") + .create_with_value_config(id(1), 1, documents, None, None) + .expect("the contract parses") + .data_contract_owned(), + ) +} + +/// A filter on creates of `rating` with `clauses`. +fn rating_creates(contract: &DataContract, clauses: Vec) -> StateTransitionFilter { + let action = clauses.into_iter().fold( + DocumentActionMatch::new(DocumentAction::Create), + DocumentActionMatch::with_new_document_where, + ); + StateTransitionFilter::Documents( + DocumentFilter::new(contract.id()) + .with_document_type("rating") + .with_action(action), + ) +} + +/// A batch creating a `rating` whose `field` is `value`. +fn rating_created(contract: &DataContract, field: &str, value: Value) -> StateTransition { + batch( + id(1), + vec![BatchedTransition::Document(DocumentTransition::Create( + DocumentCreateTransition::V0(DocumentCreateTransitionV0 { + base: DocumentBaseTransition::V1(DocumentBaseTransitionV1 { + id: id(10), + document_type_name: "rating".to_string(), + data_contract_id: contract.id(), + identity_contract_nonce: 0, + token_payment_info: None, + }), + entropy: [0u8; 32], + data: BTreeMap::from([(field.to_string(), value)]), + prefunded_voting_balance: None, + }), + ))], + ) +} + +fn clause(field: &str, operator: WhereOperator, value: Value) -> WhereClause { + WhereClause { + field: field.to_string(), + operator, + value, + } +} + +#[test] +fn should_refuse_text_on_an_integer_field_from_the_wire_without_panicking() { + let contract = rating_contract(); + // Its `Display` would split the text inside the final character. + let text = Value::Text("a".repeat(19) + "é"); + let filter = rating_creates(&contract, vec![clause("stars", WhereOperator::Equal, text)]); + assert!(matches!( + resolve(vec![over_the_wire(&filter)], &contract), + Err(SubscriptionFilterError::InvalidFilter { index: 0, .. }) + )); +} + +#[test] +fn should_group_range_bounds_of_different_integer_widths() { + let contract = rating_contract(); + let filter = rating_creates( + &contract, + vec![ + clause("stars", WhereOperator::GreaterThanOrEquals, Value::I64(1)), + clause("stars", WhereOperator::LessThanOrEquals, Value::U64(5)), + ], + ); + for filter in [filter.clone(), over_the_wire(&filter)] { + let filters = resolve(vec![filter], &contract).expect("the bounds group"); + let rated = |stars| rating_created(&contract, "stars", Value::U8(stars)); + assert!(matches(&filters, &rated(3)).is_some()); + assert!(matches(&filters, &rated(7)).is_none()); + } +} + +#[test] +fn should_refuse_to_send_an_integer_wider_than_64_bits() { + let contract = rating_contract(); + let filter = rating_creates( + &contract, + vec![clause("value", WhereOperator::Equal, Value::U128(1 << 64))], + ); + resolve(vec![filter.clone()], &contract).expect("resolves natively, as a float"); + let error = filter.to_proto().expect_err("no wire form"); + assert!(error.to_string().contains("64 bits"), "{error}"); +} + +#[test] +fn should_resolve_a_byte_list_operand_the_same_after_the_wire() { + let contract = rating_contract(); + let filter = rating_creates( + &contract, + vec![clause( + "blob", + WhereOperator::Equal, + Value::Array(vec![Value::U8(1), Value::U8(2)]), + )], + ); + for filter in [filter.clone(), over_the_wire(&filter)] { + let filters = resolve(vec![filter], &contract).expect("a byte list"); + let carrying = |bytes| rating_created(&contract, "blob", Value::Bytes(bytes)); + assert!(matches(&filters, &carrying(vec![1, 2])).is_some()); + assert!(matches(&filters, &carrying(vec![1, 3])).is_none()); + } +} + +/// `byte` 32 times, as a list of `u8`s. +fn identifier_byte_list(byte: u8) -> Value { + Value::Array(vec![Value::U8(byte); 32]) +} + +#[test] +fn should_resolve_an_id_byte_list_operand_the_same_after_the_wire() { + let contract = contract(); + let filter = nice_documents( + &contract, + DocumentActionMatch::new(DocumentAction::Delete).with_original_document_where(clause( + "$id", + WhereOperator::Equal, + identifier_byte_list(10), + )), + ); + for filter in [filter.clone(), over_the_wire(&filter)] { + let filters = resolve(vec![filter], &contract).expect("an identifier byte list"); + let deleting = |doc| batch(id(1), vec![delete_document(&contract, doc)]); + assert!(matches(&filters, &deleting(10)).is_some()); + assert!(matches(&filters, &deleting(11)).is_none()); + } +} + +#[test] +fn should_resolve_an_identifier_byte_list_operand_the_same_after_the_wire() { + let contract = rating_contract(); + let filter = rating_creates( + &contract, + vec![clause( + "author", + WhereOperator::Equal, + identifier_byte_list(5), + )], + ); + for filter in [filter.clone(), over_the_wire(&filter)] { + let filters = resolve(vec![filter], &contract).expect("an identifier byte list"); + let by = |author| rating_created(&contract, "author", id(author).into()); + assert!(matches(&filters, &by(5)).is_some()); + assert!(matches(&filters, &by(6)).is_none()); + } + // Still exactly 32 bytes. + let short = rating_creates( + &contract, + vec![clause( + "author", + WhereOperator::Equal, + Value::Array(vec![Value::U8(5); 31]), + )], + ); + for filter in [short.clone(), over_the_wire(&short)] { + assert!(resolve(vec![filter], &contract).is_err()); + } +} + +#[test] +fn should_match_a_u16_array_against_a_list_given_as_bytes_after_the_wire() { + let contract = rating_contract(); + let filter = rating_creates( + &contract, + vec![clause( + "ranks", + WhereOperator::ContainsAny, + Value::Bytes(vec![1, 2]), + )], + ); + for filter in [filter.clone(), over_the_wire(&filter)] { + let filters = resolve(vec![filter], &contract).expect("u16 candidates given as bytes"); + let ranked = |ranks: &[u16]| { + let ranks = ranks.iter().copied().map(Value::U16).collect(); + rating_created(&contract, "ranks", Value::Array(ranks)) + }; + assert!(matches(&filters, &ranked(&[1, 500])).is_some()); + assert!(matches(&filters, &ranked(&[3])).is_none()); + } +} diff --git a/packages/dashmate/docs/services/gateway.md b/packages/dashmate/docs/services/gateway.md index 5f4f790ebc3..e8c0d462c74 100644 --- a/packages/dashmate/docs/services/gateway.md +++ b/packages/dashmate/docs/services/gateway.md @@ -70,7 +70,7 @@ The Gateway routes requests to different backend services based on URL path: - Core streaming endpoints (`/org.dash.platform.dapi.v0.Core/subscribeTo*`): routed to `rs_dapi` - Other Core endpoints (`/org.dash.platform.dapi.v0.Core*`): routed to `rs_dapi` -- Platform streaming endpoints (`/org.dash.platform.dapi.v0.Platform/subscribePlatformEvents`): routed to `rs_dapi` with extended timeout +- Platform streaming endpoints (`/org.dash.platform.dapi.v0.Platform/subscribeToStateTransitions`): routed to `rs_dapi` with extended timeout - Platform waitForStateTransitionResult (`/org.dash.platform.dapi.v0.Platform/waitForStateTransitionResult`): routed to `rs_dapi` with extended timeout - Other Platform endpoints (`/org.dash.platform.dapi.v0.Platform*`): routed to `rs_dapi` - JSON-RPC endpoints (`/`): routed to `rs_dapi_json_rpc` diff --git a/packages/dashmate/templates/platform/gateway/envoy.yaml.dot b/packages/dashmate/templates/platform/gateway/envoy.yaml.dot index 1c280245da5..9b5dd19693c 100644 --- a/packages/dashmate/templates/platform/gateway/envoy.yaml.dot +++ b/packages/dashmate/templates/platform/gateway/envoy.yaml.dot @@ -188,18 +188,19 @@ cluster: rs_dapi # Upstream response timeout timeout: 15s - # rs-dapi subscribePlatformEvents endpoint with bigger timeout (now exposed directly) + # Platform streaming endpoint: as long-lived as the Core streams. The stream sends + # a checkpoint at least every 10s, well within the idle timeout. - match: - path: "/org.dash.platform.dapi.v0.Platform/subscribePlatformEvents" + path: "/org.dash.platform.dapi.v0.Platform/subscribeToStateTransitions" route: cluster: rs_dapi - idle_timeout: {{= it.platform.gateway.listeners.dapiAndDrive.waitForStResultTimeout }} + idle_timeout: 300s # Upstream response timeout - timeout: {{= it.platform.gateway.listeners.dapiAndDrive.waitForStResultTimeout }} + timeout: 601s max_stream_duration: # Entire stream/request timeout - max_stream_duration: {{= it.platform.gateway.listeners.dapiAndDrive.waitForStResultTimeout }} - grpc_timeout_header_max: {{= it.platform.gateway.listeners.dapiAndDrive.waitForStResultTimeout }} + max_stream_duration: 601s + grpc_timeout_header_max: 600s # rs-dapi waitForStateTransitionResult endpoint with bigger timeout (now exposed directly) - match: path: "/org.dash.platform.dapi.v0.Platform/waitForStateTransitionResult" diff --git a/packages/rs-dapi-client/src/transport/grpc.rs b/packages/rs-dapi-client/src/transport/grpc.rs index 647dcaa8cf5..4ce1004a61f 100644 --- a/packages/rs-dapi-client/src/transport/grpc.rs +++ b/packages/rs-dapi-client/src/transport/grpc.rs @@ -795,6 +795,18 @@ impl_transport_request_grpc!( get_shielded_nullifiers ); +// rpc subscribeToStateTransitions(SubscribeToStateTransitionsRequest) returns (stream SubscribeToStateTransitionsResponse); +impl_transport_request_grpc!( + platform_proto::SubscribeToStateTransitionsRequest, + Streaming, + PlatformGrpcClient, + RequestSettings { + timeout: Some(STREAMING_TIMEOUT), + ..RequestSettings::default() + }, + subscribe_to_state_transitions +); + // Link to each core gRPC request what client and method to use: impl_transport_request_grpc!( diff --git a/packages/rs-dapi/Cargo.toml b/packages/rs-dapi/Cargo.toml index f8bc5b75670..f9a83d9fd7d 100644 --- a/packages/rs-dapi/Cargo.toml +++ b/packages/rs-dapi/Cargo.toml @@ -82,6 +82,7 @@ dpp = { path = "../rs-dpp", default-features = false, features = [ "state-transitions", ] } dapi-grpc = { path = "../dapi-grpc", features = ["server", "client", "serde"] } +dash-platform-queries = { path = "../dash-platform-queries" } quick_cache = "0.6.16" prometheus = "0.14" once_cell = "1.19" @@ -93,10 +94,10 @@ dash-spv = { workspace = true } rs-dash-event-bus = { path = "../rs-dash-event-bus" } zeroize = "1.8" +bytes = "1" [dev-dependencies] -bytes = "1" h2 = "0.4" hyper-util = { version = "0.1", features = ["tokio"] } rs-dapi-client = { path = "../rs-dapi-client", default-features = false } @@ -105,6 +106,8 @@ serial_test = "3.1.1" test-case = "3.3.1" # Decodes dapi-grpc's FILE_DESCRIPTOR_SET in the metrics allowlist test. prost-types = "0.14" +# Paused time in the subscription stream tests. +tokio = { version = "1.47.0", features = ["full", "test-util"] } [package.metadata.cargo-machete] ignored = ["rs-dash-event-bus"] diff --git a/packages/rs-dapi/src/clients/tenderdash_client.rs b/packages/rs-dapi/src/clients/tenderdash_client.rs index d7234906d0e..55203c035a5 100644 --- a/packages/rs-dapi/src/clients/tenderdash_client.rs +++ b/packages/rs-dapi/src/clients/tenderdash_client.rs @@ -3,7 +3,8 @@ use crate::clients::tenderdash_websocket::BlockEvent; use crate::clients::{CONNECT_TIMEOUT, REQUEST_TIMEOUT}; use crate::error::{DAPIResult, DapiError}; use crate::utils::{ - deserialize_string_number_or_null, deserialize_string_or_number, generate_jsonrpc_id, + deserialize_null_as_default, deserialize_string_number_or_null, deserialize_string_or_number, + generate_jsonrpc_id, }; use reqwest::Client; use reqwest_middleware::{ClientBuilder, ClientWithMiddleware}; @@ -311,7 +312,7 @@ pub struct ExecTxResult { pub gas_used: i64, #[serde(default, deserialize_with = "deserialize_string_number_or_null")] pub codespace: String, - #[serde(default)] + #[serde(default, deserialize_with = "deserialize_null_as_default")] pub events: Vec, } @@ -330,6 +331,83 @@ impl ExecTxResult { pub type TxResult = ExecTxResult; +/// Consensus versions carried by a block header; `app` is the Platform protocol version. +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct ConsensusVersion { + #[serde(default, deserialize_with = "deserialize_string_or_number")] + pub app: u64, +} + +/// The block header fields rs-dapi reads. +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct BlockHeader { + #[serde(default)] + pub version: ConsensusVersion, + #[serde(default, deserialize_with = "deserialize_string_or_number")] + pub height: u64, + /// RFC 3339 block time. + #[serde(default)] + pub time: String, +} + +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct BlockData { + /// Base64-encoded transactions, in block order. Tenderdash omits or nulls an empty list. + #[serde(default, deserialize_with = "deserialize_null_as_default")] + pub txs: Vec, +} + +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct Block { + #[serde(default)] + pub header: BlockHeader, + #[serde(default)] + pub data: BlockData, +} + +/// Result of the `block` RPC. +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct ResultBlock { + pub block: Option, +} + +/// Result of the `block_results` RPC: one execution result per transaction, in block order. +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct ResultBlockResults { + #[serde(default, deserialize_with = "deserialize_null_as_default")] + pub txs_results: Vec, +} + +/// Header and transaction count of one block, as listed by the `blockchain` RPC. +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct BlockMeta { + #[serde(default)] + pub header: BlockHeader, + /// `-1` for a header-only meta (state sync), whose transactions the store does not keep. + #[serde(default, deserialize_with = "deserialize_string_or_number")] + pub num_txs: i64, +} + +/// Result of the `blockchain` RPC: block metas in descending height order. +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct ResultBlockchainInfo { + #[serde(default, deserialize_with = "deserialize_null_as_default")] + pub block_metas: Vec, +} + +#[derive(Debug, Serialize)] +struct HeightParams { + height: String, +} + +#[derive(Debug, Serialize)] +struct BlockchainParams { + #[serde(rename = "minHeight")] + min_height: String, + #[serde(rename = "maxHeight")] + max_height: String, +} + impl TenderdashClient { /// Generic POST method for Tenderdash RPC calls /// Serializes the request, performs the call, and maps protocol errors to `DapiError`. @@ -522,6 +600,44 @@ impl TenderdashClient { self.post(&request).await } + + /// Get the committed block at `height`. + pub async fn block(&self, height: u64) -> DAPIResult { + let params = HeightParams { + height: height.to_string(), + }; + let request = JsonRpcRequest::new("block", params); + + self.post(&request).await + } + + /// Get the execution results of the committed block at `height`. + pub async fn block_results(&self, height: u64) -> DAPIResult { + let params = HeightParams { + height: height.to_string(), + }; + let request = JsonRpcRequest::new("block_results", params); + + self.post(&request).await + } + + /// List the block metas of heights `min_height..=max_height`, highest first. + /// + /// Tenderdash returns at most 20 metas per call, keeping the highest heights of the range. + pub async fn blockchain( + &self, + min_height: u64, + max_height: u64, + ) -> DAPIResult { + let params = BlockchainParams { + min_height: min_height.to_string(), + max_height: max_height.to_string(), + }; + let request = JsonRpcRequest::new("blockchain", params); + + self.post(&request).await + } + /// Subscribe to streaming Tenderdash transaction events if WebSocket is available. pub fn subscribe_to_transactions(&self) -> broadcast::Receiver { self.websocket_client.subscribe() @@ -541,3 +657,296 @@ impl TenderdashClient { self.websocket_client.clone() } } + +#[cfg(test)] +mod tests { + use super::*; + + /// A `block` reply carrying two transactions, as Tenderdash writes it. + const BLOCK: &str = r#"{ + "jsonrpc": "2.0", + "id": 7, + "result": { + "block_id": { "hash": "AE99F1ED1207DE4FF456E7FAD694FC160018AD43BF30D40EA1A1D8345D0AD397", "parts": { "total": 1, "hash": "85B14CF1354D01BDB4C402A0A927A485ACDFB8F8D77D200A17C2998D8EB57F89" }, "state_id": "A4A41A407933CE446FB6C943F3E745EE627C6A2275B49B6159A99DA717F254E8" }, + "block": { + "header": { + "version": { "block": 14, "app": 9 }, + "chain_id": "dash-1", + "height": "2183417", + "core_chain_locked_height": 2366051, + "time": "2026-10-14T12:34:56.789123456Z", + "last_block_id": { "hash": "E93CC963D65EE813FE85602AF8FBD1E934801B1F111CE7E5723B5676543F7154", "parts": { "total": 1, "hash": "55F8307240CB7E8BBE67D130E36A7DEFA91818F8F29C624694A08AED97392335" }, "state_id": "CA8763979E21D85FB14C29D9F76E296369DA06C09C12A5BCDEA92B10F371E5D0" }, + "last_commit_hash": "60002321EE6C544A2BA8A9E833E4CD4CA19C4A66B33E6E602BF23529FB16982B", + "data_hash": "924B724AD61D6CDD4FB9ABB09C18BCDB483B398662CDFF75B0D99747492F2C42", + "validators_hash": "1E1DF1DEBD06FBD0E8F012F0DC53EB480A09DA832F053E05879E92266A03FCB8", + "next_validators_hash": "839331694682A13B221ADF02DABE29E79FB323191B235E7E34A9EE94459FE3C0", + "consensus_hash": "FAE4D43D86F8F823022B63D60F4E523FF7C2470E6FFD3D0EBA0AF7CBD49AFE27", + "next_consensus_hash": "189C8551B971FC9DC87EB0BB5C1BE0E32CD72A58C35CEF6A58DAA6DC6D636BE7", + "app_hash": "15AACD0D7986995F962F2E2277295917A0F8B4EA1B962DDA61418B09C9CB04CD", + "results_hash": "C12E92106D929E7735AA5E110ABF86C08370FC6BAE4C5DCE897431F383A0BBB9", + "evidence_hash": "648CAFC7BB4D13900B647C303B0CB7D2DA27B6494791C182160C2E35DA9806CD", + "proposer_pro_tx_hash": "68DE7CA2A3A322C38EE71E068CD6946CAB61AB7452A36118B51044B65A09882B", + "proposed_protocol_version": 9 + }, + "data": { "txs": ["AgEAAQ==", "AwIBAA=="] }, + "core_chain_lock": { + "core_block_height": "2366051", + "core_block_hash": "q2bJ8hT0r6Yb3Nw4K1mS9pV7cX5eZ2aD0fG8hJ4kL6M=", + "signature": "lVqzJ2pXH4k8n0wC5yT3eR7uI1oP9aS6dF2gH8jK4lZ1xC3vB5nM7qW0eR2tY4uI" + }, + "evidence": [], + "last_commit": { + "height": 2183416, + "round": 0, + "block_id": { "hash": "0942EB4DC2774B6A9CB048913C5F9A95FE358075FA76C334BF8EAF7EEB6F48F9", "parts": { "total": 1, "hash": "DC88F1E1D6DEF7C0977411F778163A68606FA4A47EFA5C52A133357F86E33422" }, "state_id": "490B76A8DA6B74C8A3ED3AFBD414F7C718B0360EB0824C50D373A562C9871C44" }, + "quorum_hash": "924B631589E17B6547A9E4B70D49145CCF4192E78E981EA6F32F8FB0D08C85AA", + "threshold_block_signature": "jJ8uK2nX5vB7mQ1wE3rT6yU9iO0pA4sD8fG2hJ5kL7zX1cV3bN6mQ9wE2rT5yU8i", + "threshold_vote_extensions": null + } + } + } +}"#; + + /// A `block` reply for a block without transactions: Tenderdash writes `null`. + const EMPTY_BLOCK: &str = r#"{ + "jsonrpc": "2.0", + "id": 7, + "result": { + "block_id": { "hash": "B1AACF56290EBEC597D08BD03A2A9C908BFD87D2D86EDD2F685E8542ED3F1B2F", "parts": { "total": 1, "hash": "CE1A8F909D565970CE39878EB1CC5145156E7F8C0685490BFE04232C55B45677" }, "state_id": "2A5B91511EBCEB2DDB66C4DD122346D8AFA02888C16B33531FE655F2CB52FA59" }, + "block": { + "header": { + "version": { "block": 14, "app": 9 }, + "chain_id": "dash-1", + "height": "2183418", + "core_chain_locked_height": 2366051, + "time": "2026-10-14T12:34:56.789123456Z", + "last_block_id": { "hash": "490530A13A9563004684D5F437081B7619F131EA15B99963232C5B34882919A3", "parts": { "total": 1, "hash": "0A678A315A235585B2D11281332CE012A50AB39CC0B380D15E3F2FD2047D8703" }, "state_id": "6B2096EE82A7361F6056C3F66FEE2B4E9A8C9FCF21BF5FEBE3A084CAE404523E" }, + "last_commit_hash": "121979739C8038C43F0C83A8E8C5D2BE8BFE090DE09AA0F266E98B90BBDC5955", + "data_hash": "E57BB21BA6BD98A5EF5013765A873F22F1839A25FFE191A73E034F1E1D2BFF82", + "validators_hash": "FB2C779344A463270DB412018723F4C41578EDD6E15E2C449FF2218B94CEB3DC", + "next_validators_hash": "876EE0A3ADECF961992B32CE1B1D742C5AFA5609967BF9ABCBB2110DAF46BDCC", + "consensus_hash": "C665370CA388A34ADF30B97EA2652B813B84595C2B645477B84FF6334EBE2CB5", + "next_consensus_hash": "65282302C41B7D4B8B4D302F3FB228EDBC07E5D2A455275F349B45CC5CFA9C07", + "app_hash": "8838A1F8AA1BE44C4CAA52198A3BDA1239A8319913D68B16F2FE758D156D2B93", + "results_hash": "3115896D7FA65C221ADA18FD6EFF058DBBE26F20F3C5814FB858D5237277F982", + "evidence_hash": "6C188299A2204FD772CE3C43FB512EE2EA6F6A3738D4A1BFE084E2285B9EC275", + "proposer_pro_tx_hash": "436A17C69D04FC75BA60D5827E1FC151A4F8C44F00978B91366F555A77B878EA", + "proposed_protocol_version": 9 + }, + "data": { "txs": null }, + "core_chain_lock": { + "core_block_height": "2366051", + "core_block_hash": "q2bJ8hT0r6Yb3Nw4K1mS9pV7cX5eZ2aD0fG8hJ4kL6M=", + "signature": "lVqzJ2pXH4k8n0wC5yT3eR7uI1oP9aS6dF2gH8jK4lZ1xC3vB5nM7qW0eR2tY4uI" + }, + "evidence": [], + "last_commit": { + "height": 2183417, + "round": 0, + "block_id": { "hash": "9D73DCD82B2B80D622E2355976CAAB36BD292B9830CE11E6596F551CB4427832", "parts": { "total": 1, "hash": "D0753BE31CF5849959E8015B745908AC6DE92C5BE138EC3284E8311AB41F373A" }, "state_id": "BD48DE3214787275A5C64D1E727B86C9D1CAACC9D5780C4AE029E80B219BE1CB" }, + "quorum_hash": "B12054DA58A68590040D936DEB02F98047AD8074DEF28E2EDB1FB6D0D02C594B", + "threshold_block_signature": "jJ8uK2nX5vB7mQ1wE3rT6yU9iO0pA4sD8fG2hJ5kL7zX1cV3bN6mQ9wE2rT5yU8i", + "threshold_vote_extensions": null + } + } + } +}"#; + + /// `block_results` for `BLOCK`: one success (`code` omitted when 0) and one failure, numbers + /// as Tenderdash writes them. + const BLOCK_RESULTS: &str = r#"{ + "jsonrpc": "2.0", + "id": 8, + "result": { + "height": "2183417", + "txs_results": [ + { + "gas_used": 1340, + "events": [{ "type": "app", "attributes": [{ "key": "k", "value": "v", "index": true }] }] + }, + { + "code": 10046, + "info": "AiQBYW5vdGhlciBpZGVudGl0eQ==", + "log": "identity not found", + "codespace": "platform", + "gas_used": 210 + } + ], + "total_gas_used": "1550", + "finalize_block_events": null, + "validator_set_updates": null, + "consensus_param_updates": null + } +}"#; + + /// `block_results` with every number as a string, as Tenderdash's RPC reference shows them. + const STRING_BLOCK_RESULTS: &str = r#"{ + "jsonrpc": "2.0", + "id": "9", + "result": { + "height": "12", + "txs_results": [ + { "code": "0", "data": "", "log": "", "info": "", "gas_used": "100", "events": null, "codespace": "" }, + { "code": "2", "data": "", "log": "not enough gas", "info": "", "gas_used": "100", "events": null, "codespace": "ibc" } + ], + "total_gas_used": "200" + } +}"#; + + /// `block_results` for `EMPTY_BLOCK`. + const EMPTY_BLOCK_RESULTS: &str = r#"{ + "jsonrpc": "2.0", + "id": 10, + "result": { + "height": "2183418", + "txs_results": null, + "total_gas_used": "0", + "finalize_block_events": null, + "validator_set_updates": null, + "consensus_param_updates": null + } +}"#; + + /// A `blockchain` page, highest first: a block with transactions, an empty one and a + /// header-only meta from state sync. + const BLOCKCHAIN: &str = r#"{ + "jsonrpc": "2.0", + "id": 11, + "result": { + "last_height": "2183420", + "block_metas": [ + { + "block_id": { "hash": "6A6A978BDFC07C51B03BD2BE39DB1510C4760CF98FACAD651A55A2666C40E5E9", "parts": { "total": 1, "hash": "F48E03ABDD36B9971AF8EE438FF46606853910AD7B81E409E4B441538E52E742" }, "state_id": "66B028B7F01695EAD949529BBCC1B719C3CAF99EB6D611C608019A9297E3413E" }, + "block_size": "1873", + "header": { + "version": { "block": 14, "app": 9 }, + "chain_id": "dash-1", + "height": "2183417", + "core_chain_locked_height": 2366051, + "time": "2026-10-14T12:35:00.1Z", + "last_block_id": { "hash": "F4C4EEBF89EF9DC0A160E5016345AB1FA761523E5ED7519FA84876DCF62AAAA9", "parts": { "total": 1, "hash": "E5A8549155AFFFBC4A47D393C267EBE61A965637A15451A84B0537EEFB37F3C4" }, "state_id": "F586032C796D45AC313393C7DDC5E55FB0A232AD4A2B1A795E984AB2AA2E211C" }, + "last_commit_hash": "8353A58FF1DCCE44F5FC1138DE59D3A304807DF6300CBF556706A9798D9F3699", + "data_hash": "E2FE7506EEBFC35EF8A56EB3BDDE53A67F0487006687A477EE85075D535FE8EA", + "validators_hash": "1DFA39D519C23334547E07A3DA289B772C0C48DEB60959922C2722AA469BBAA8", + "next_validators_hash": "FB8DAA60E9C5DACB4D9465AA70906D67052CF1D98BEBDDD824C8A85D3D73404D", + "consensus_hash": "F40FD770933471923363349A46B14A7F228E152CE0BC22B9C5302145BCF4EC19", + "next_consensus_hash": "F8ADF09B9A1DFCFB1B81EBF5EED8FC3F7A28414CAA8004A0BE45909FC930208F", + "app_hash": "B3D912C0EF9943254066A75047022BDFD97958463203A9E71B451AABCC8E9897", + "results_hash": "B98834098AE87EFED4889BB483B97DB5A683C3121351957ECA433250B7DE84D3", + "evidence_hash": "6CC32D0725EFE10D1ABD55B2DDF07506EDB4984933448208EC873F833DBB3D62", + "proposer_pro_tx_hash": "665E866A6770156712BA22CB1745D99691CE5A9E88295F63D8BAA0FEC35F527D", + "proposed_protocol_version": 9 + }, + "num_txs": "2", + "round": "0", + "has_core_chain_lock": false + }, + { + "block_id": { "hash": "6F4242D5DDC3A98E6E9DA469304E1384606F30370F4158FD0962861FCAA00559", "parts": { "total": 1, "hash": "D4DF7A3764E9192DA1E243B8143C7950F86FAA0EFBB686F46424E41AD35F0C79" }, "state_id": "2C633A90FDF7563B54880C27B0532CBFD26641D5EDF7D7B7D10E8932167CA2C2" }, + "block_size": "1204", + "header": { + "version": { "block": 14, "app": 9 }, + "chain_id": "dash-1", + "height": "2183416", + "core_chain_locked_height": 2366051, + "time": "2026-10-14T12:35:00.1Z", + "last_block_id": { "hash": "DA337ACA6498EEDB066815C5A02D09ED1E966680ABA6AF372865895E43E92F50", "parts": { "total": 1, "hash": "78FECB5C34FB6BA3D3BB8B1FE3A59EF1AEE4C931CD4991CD95E55B7D862755A3" }, "state_id": "AA5F33FD02EA2DC39576A5B91B5E813A656D1741B9AC33C545AEAA9C0E1A8A47" }, + "last_commit_hash": "E746F29F4F609A588D0EA657FD5F2DFD1CEB8384BE3555EF7F264441C83B9DB6", + "data_hash": "A679063C72A386A05A9CF7E197AB74AAB65A3E2A2DAD155D0673BC9628E227E3", + "validators_hash": "755BA8F755E1D7F9FE09942C1EEB52BA061EC24E762B979E603DC7B3AE945019", + "next_validators_hash": "AF649784CA4ACA169714C13BF05856C9B38C8B5E2A4D3B37DFDB1EE683EFA6E9", + "consensus_hash": "A9B33092AA3ACBB4B3E4A4E48620787B6A0AF9DEA6562027A6BE6DAB3390F39C", + "next_consensus_hash": "7F9F3A4524E819C5787F21C951909DA3E006DDF790177C1B42635880D1B9A306", + "app_hash": "4774559F1C17A95FC7C2A73E378A58EFFE1A48A9B84870DB8C9CFC6A429CC8B7", + "results_hash": "636BC84E0A889DDD5E2225C57A7DF9CCF79BA56A83CDBC38E2CCAA18BD02BF5B", + "evidence_hash": "70BFB71C0F50D97F1E7DBEFF66BDCAFAEBDA10BCFE58E6A4294BB61A0C12D31B", + "proposer_pro_tx_hash": "D73FFBE98E9AB583576CCB12754AF87204C6373D2E8C6610D9DA8771992B6E93", + "proposed_protocol_version": 9 + }, + "num_txs": "0", + "round": "0", + "has_core_chain_lock": false + }, + { + "block_id": { "hash": "D8AB3A5E7398567AB9B20C25B58135CBC91897397E3B61A007FC5AAD2A12AD3F", "parts": { "total": 1, "hash": "3C380C48733E013A3D51F8CED81C426AABB0BBB21EC5EEB084F2A3C1426A8157" }, "state_id": "FC0C12437A63B13D819389F03494D0CA954B8C574AE70211555099C66CB49FE2" }, + "block_size": "0", + "header": { + "version": { "block": 14, "app": 8 }, + "chain_id": "dash-1", + "height": "2183415", + "core_chain_locked_height": 2366051, + "time": "2026-10-14T12:35:00.1Z", + "last_block_id": { "hash": "86051B0796460D8ED173A12CB3764C80DEB6AB6189A0A4980CE5A75DCA2AD268", "parts": { "total": 1, "hash": "BEBDC802C5198A8E8A41F1D2ADE3777348275B8E2B02365D1CC7CD84097416C3" }, "state_id": "4A87DC0D3E584D83426F50157B0204E278B0DBD515652C009F35FF781536474D" }, + "last_commit_hash": "ABEC8FFE122979839BD1D00463F2201A2924FA0FDB7FF8349C42E38D926CE2E4", + "data_hash": "3AB41CC57679955AC35991E3D026E919ED9CF2C2D32699DCBB09FA316A692D8F", + "validators_hash": "8F841CE6E938F0E01651AB79D5706AB745D3469ECCC4BE976259DC461712D76A", + "next_validators_hash": "C05175515E7AB320577EDB84BE80B54FDA27843BF18A2518647273E7CDBF43DC", + "consensus_hash": "672647F3AD2ACEF22E516715C8BDE0158A238B649D2AC3CCC328A9F24A7B9D4C", + "next_consensus_hash": "25B6241A300633C06EB45AD2E2C6B716EF645C8513A33E69E3BEC6F84FA7E1CD", + "app_hash": "10BE26E40ACEC2AB646645753B7C7C3EAAFFE67199E22575B401AE8B6A624089", + "results_hash": "07E6AD19CE639C632F9C3DB615DB3FB01306A9D302898A76A86DD031D1BF88E4", + "evidence_hash": "27FE79F8654B87E50B350FD2B9314CFD5D17CA309E991F0F928A70F10FFDAC3B", + "proposer_pro_tx_hash": "F224EC2CAE37CEF20B4788E024382F0C140060FA0E8439B553D5992DC7D75E5A", + "proposed_protocol_version": 8 + }, + "num_txs": "-1", + "round": "0", + "has_core_chain_lock": false + } + ] + } +}"#; + + fn result(json: &str) -> T { + let response: TenderdashResponse = serde_json::from_str(json).expect("decodes"); + assert!(response.error.is_none()); + response.result.expect("a result") + } + + #[test] + fn should_decode_a_block_with_transactions() { + let block = result::(BLOCK).block.expect("a block"); + assert_eq!(block.header.height, 2183417); + assert_eq!(block.header.version.app, 9); + assert_eq!(block.header.time, "2026-10-14T12:34:56.789123456Z"); + assert_eq!(block.data.txs, vec!["AgEAAQ==", "AwIBAA=="]); + } + + #[test] + fn should_decode_an_empty_block_and_its_null_results() { + let block = result::(EMPTY_BLOCK).block.expect("a block"); + assert_eq!(block.header.height, 2183418); + assert!(block.data.txs.is_empty()); + let results = result::(EMPTY_BLOCK_RESULTS); + assert!(results.txs_results.is_empty()); + } + + #[test] + fn should_decode_successful_and_failed_transaction_results() { + for json in [BLOCK_RESULTS, STRING_BLOCK_RESULTS] { + let results = result::(json).txs_results; + let codes: Vec = results.iter().map(|result| result.code).collect(); + assert_eq!(codes.len(), 2, "{json}"); + assert_eq!(codes[0], 0, "{json}"); + assert_ne!(codes[1], 0, "{json}"); + assert!(results[1].gas_used > 0, "{json}"); + assert!(!results[1].log.is_empty(), "{json}"); + } + let failed = &result::(BLOCK_RESULTS).txs_results[1]; + assert_eq!(failed.code, 10046); + assert_eq!(failed.codespace, "platform"); + } + + #[test] + fn should_decode_a_blockchain_page_of_block_metas() { + let metas = result::(BLOCKCHAIN).block_metas; + let read: Vec<(u64, i64, u64)> = metas + .iter() + .map(|meta| (meta.header.height, meta.num_txs, meta.header.version.app)) + .collect(); + assert_eq!( + read, + vec![(2183417, 2, 9), (2183416, 0, 9), (2183415, -1, 8)] + ); + } +} diff --git a/packages/rs-dapi/src/metrics.rs b/packages/rs-dapi/src/metrics.rs index fd39e310c4b..7a34d0761fa 100644 --- a/packages/rs-dapi/src/metrics.rs +++ b/packages/rs-dapi/src/metrics.rs @@ -618,6 +618,7 @@ fn known_grpc_endpoint(path: &str) -> &'static str { "getShieldedPoolState", "getShieldedNotesCount", "getShieldedNullifiers", + "subscribeToStateTransitions", ] ) }) diff --git a/packages/rs-dapi/src/server/grpc.rs b/packages/rs-dapi/src/server/grpc.rs index 11e7c440dfa..cdfd2f84712 100644 --- a/packages/rs-dapi/src/server/grpc.rs +++ b/packages/rs-dapi/src/server/grpc.rs @@ -118,7 +118,7 @@ impl TimeoutLayer { "/org.dash.platform.dapi.v0.Core/subscribeToTransactionsWithProofs", "/org.dash.platform.dapi.v0.Core/subscribeToMasternodeList", "/org.dash.platform.dapi.v0.Platform/waitForStateTransitionResult", - "/org.dash.platform.dapi.v0.Platform/subscribePlatformEvents", + "/org.dash.platform.dapi.v0.Platform/subscribeToStateTransitions", ]; // Check if this is a known streaming method diff --git a/packages/rs-dapi/src/services/platform_service/mod.rs b/packages/rs-dapi/src/services/platform_service/mod.rs index 77cd8a1294a..d4539768ef1 100644 --- a/packages/rs-dapi/src/services/platform_service/mod.rs +++ b/packages/rs-dapi/src/services/platform_service/mod.rs @@ -5,6 +5,7 @@ mod broadcast_state_transition; mod error_mapping; mod get_status; mod shielded_proof_failure_budget; +mod subscribe_to_state_transitions; mod wait_for_state_transition_result; #[cfg(test)] @@ -15,7 +16,8 @@ use dapi_grpc::platform::v0::platform_server::Platform; use dapi_grpc::platform::v0::{ BroadcastStateTransitionRequest, BroadcastStateTransitionResponse, GetPathElementsRequest, GetPathElementsResponse, GetStatusRequest, GetStatusResponse, - WaitForStateTransitionResultRequest, WaitForStateTransitionResultResponse, + SubscribeToStateTransitionsRequest, WaitForStateTransitionResultRequest, + WaitForStateTransitionResultResponse, }; use dapi_grpc::tonic::{Request, Response, Status}; use dpp::version::PlatformVersion; @@ -31,6 +33,9 @@ use tracing::{info, trace, warn}; pub use error_mapping::TenderdashStatus; pub use shielded_proof_failure_budget::ShieldedProofFailureBudget; +use subscribe_to_state_transitions::{ + BlockSource, SubscriptionLimits, SubscriptionService, TenderdashBlocks, +}; const MAX_PENDING_STATE_TRANSITION_WAITS: usize = 1_024; @@ -157,6 +162,7 @@ pub struct PlatformServiceImpl { pub subscriber_manager: Arc, pub state_transition_wait_permits: Arc, pub shielded_proof_failure_budget: Arc, + pub subscriptions: Arc, #[allow(dead_code)] // workers - dropping will cancel all spawned tasks workers: Workers, @@ -205,6 +211,23 @@ impl PlatformServiceImpl { let platform_cache_bytes = config.dapi.platform_cache_bytes; + // State transition subscriptions read committed blocks from Tenderdash; new-block + // events only make the tip tracker look sooner. + let blocks = Arc::new(BlockSource::new( + tenderdash_client.clone() as Arc + )); + let (tip_sender, tip_receiver) = tokio::sync::watch::channel(0); + let subscriptions = Arc::new(SubscriptionService::new( + blocks.clone(), + tip_receiver, + SubscriptionLimits::default(), + )); + let new_blocks = tenderdash_client.subscribe_to_blocks(); + workers.spawn(async move { + SubscriptionService::track_tip(blocks, tip_sender, new_blocks).await; + Ok::<(), DapiError>(()) + }); + Self { drive_client, tenderdash_client, @@ -220,6 +243,7 @@ impl PlatformServiceImpl { MAX_PENDING_STATE_TRANSITION_WAITS, )), shielded_proof_failure_budget: Arc::new(ShieldedProofFailureBudget::default()), + subscriptions, workers, } } @@ -229,6 +253,29 @@ impl PlatformServiceImpl { impl Platform for PlatformServiceImpl { // Manually implemented methods + type subscribeToStateTransitionsStream = subscribe_to_state_transitions::SubscriptionStream; + + /// Stream committed state transitions matching the request's filters. + /// + /// See [`PlatformServiceImpl::subscribe_to_state_transitions_impl`] for the details. + async fn subscribe_to_state_transitions( + &self, + request: Request, + ) -> Result, Status> { + let method = type_name_of_val(request.get_ref()); + trace!(method, "Received subscribe_to_state_transitions request"); + match self.subscribe_to_state_transitions_impl(request).await { + Ok(stream) => { + info!(method, "subscription started"); + Ok(Response::new(stream)) + } + Err(status) => { + warn!(method, error = %status, "subscription refused"); + Err(status) + } + } + } + /// Get the status of the whole system /// /// This method retrieves the current status of Drive, Tenderdash, and other components. diff --git a/packages/rs-dapi/src/services/platform_service/protobuf_request_errors.rs b/packages/rs-dapi/src/services/platform_service/protobuf_request_errors.rs index cdb1df6b2e3..0434190d742 100644 --- a/packages/rs-dapi/src/services/platform_service/protobuf_request_errors.rs +++ b/packages/rs-dapi/src/services/platform_service/protobuf_request_errors.rs @@ -1,6 +1,9 @@ //! Test the public request decoder and real Drive forwarding without background connections. -use super::{MAX_PENDING_STATE_TRANSITION_WAITS, PlatformServiceImpl, ShieldedProofFailureBudget}; +use super::{ + BlockSource, MAX_PENDING_STATE_TRANSITION_WAITS, PlatformServiceImpl, + ShieldedProofFailureBudget, SubscriptionLimits, SubscriptionService, +}; use crate::cache::LruResponseCache; use crate::clients::TenderdashClient; use crate::clients::drive_client::{DriveChannel, DriveClient}; @@ -37,7 +40,7 @@ use rs_dapi_client::{ use std::marker::PhantomData; use std::sync::{Arc, Mutex}; use std::time::Duration; -use tokio::sync::Semaphore; +use tokio::sync::{Semaphore, watch}; use tokio::task::JoinHandle; use tokio_stream::StreamExt; use tower::ServiceBuilder; @@ -158,6 +161,11 @@ impl Harness { let service = PlatformServiceImpl { drive_client: DriveClient::from_test_channel(traced), websocket_client: tenderdash_client.websocket_client(), + subscriptions: Arc::new(SubscriptionService::new( + Arc::new(BlockSource::new(tenderdash_client.clone())), + watch::channel(0).1, + SubscriptionLimits::default(), + )), tenderdash_client, config: Arc::clone(&config), platform_cache: LruResponseCache::with_capacity( diff --git a/packages/rs-dapi/src/services/platform_service/subscribe_to_state_transitions/block_source.rs b/packages/rs-dapi/src/services/platform_service/subscribe_to_state_transitions/block_source.rs new file mode 100644 index 00000000000..2ef204e1d19 --- /dev/null +++ b/packages/rs-dapi/src/services/platform_service/subscribe_to_state_transitions/block_source.rs @@ -0,0 +1,514 @@ +//! Committed blocks, read from the Tenderdash block store and shared by every subscription: +//! concurrent reads of one height (or metas page) share one Tenderdash call and one decode. + +use crate::DapiError; +use crate::clients::tenderdash_client::{ + BlockMeta, ResultBlock, ResultBlockResults, ResultBlockchainInfo, TenderdashClient, +}; +use crate::error::DAPIResult; +use async_trait::async_trait; +use base64::Engine; +use base64::prelude::BASE64_STANDARD; +use bytes::Bytes; +use dpp::platform_value::Value; +use dpp::state_transition::StateTransition; +use dpp::version::PlatformVersion; +use quick_cache::sync::{Cache, DefaultLifecycle}; +use quick_cache::{DefaultHashBuilder, OptionsBuilder, Weighter}; +use sha2::{Digest, Sha256}; +use std::sync::Arc; +use tokio::sync::{Semaphore, SemaphorePermit}; + +/// Heights per `blockchain` page; Tenderdash's own cap. +pub const META_PAGE: u64 = 20; +/// Bytes of decoded blocks kept, as weighed by [`BlockWeighter`]: a 2 MiB block weighs +/// 2 MiB × (1 + 2 × `size_of::()`, 48) = 194 MiB, so two fit. +const BLOCK_CACHE_BYTES: u64 = 512 * 1024 * 1024; +/// Weight of a cached transaction beyond its decoded values: its hash, its entry, its `Bytes`. +const TX_OVERHEAD_BYTES: usize = 256; +/// One shard: quick_cache only keeps an entry that fits a shard, and a 2 MiB block must fit. +const BLOCK_CACHE_SHARDS: usize = 1; +/// Block metas pages kept. +const META_PAGE_CACHE_PAGES: usize = 256; +/// Tenderdash RPCs in flight at once, across all subscriptions and the tip tracker. +pub const MAX_CONCURRENT_FETCHES: usize = 8; + +/// The Tenderdash RPCs the block source reads. +#[async_trait] +pub trait TenderdashBlocks: Send + Sync + 'static { + async fn latest_height(&self) -> DAPIResult; + async fn block(&self, height: u64) -> DAPIResult; + async fn block_results(&self, height: u64) -> DAPIResult; + async fn blockchain( + &self, + min_height: u64, + max_height: u64, + ) -> DAPIResult; +} + +#[async_trait] +impl TenderdashBlocks for TenderdashClient { + async fn latest_height(&self) -> DAPIResult { + Ok(self.status().await?.sync_info.latest_block_height.max(0) as u64) + } + + async fn block(&self, height: u64) -> DAPIResult { + TenderdashClient::block(self, height).await + } + + async fn block_results(&self, height: u64) -> DAPIResult { + TenderdashClient::block_results(self, height).await + } + + async fn blockchain( + &self, + min_height: u64, + max_height: u64, + ) -> DAPIResult { + TenderdashClient::blockchain(self, min_height, max_height).await + } +} + +/// One successfully executed transaction of a committed block. +#[derive(Debug, Clone)] +pub struct CommittedTx { + /// Position among the block's transactions. + pub index: u32, + /// SHA-256 of `bytes`, the Tenderdash transaction hash. + pub hash: [u8; 32], + /// The serialized state transition, shared with every response that carries it. + pub bytes: Bytes, + /// The decoded transition, or why this build cannot decode it. + pub state_transition: Result, +} + +/// A committed block's header facts and its successfully executed transactions. +#[derive(Debug, Clone)] +pub struct CommittedBlock { + pub height: u64, + pub time_ms: u64, + pub protocol_version: u32, + pub txs: Vec, +} + +/// One height's block meta, as far as the subscription needs it. +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub enum HeightMeta { + /// The block has no transactions. + Empty, + /// The block has transactions. + HasTxs, + /// The store keeps no transactions for this height. + Unavailable, +} + +#[derive(Clone)] +struct BlockWeighter; + +impl Weighter> for BlockWeighter { + fn weight(&self, _height: &u64, block: &Arc) -> u64 { + // The serialized bytes, and at most one decoded `Value` per serialized byte: every + // value takes at least one. Doubled: decoded arrays grow by doubling and keep the slack. + let txs: usize = block + .txs + .iter() + .map(|tx| tx.bytes.len() * (1 + 2 * size_of::()) + TX_OVERHEAD_BYTES) + .sum(); + (txs + TX_OVERHEAD_BYTES) as u64 + } +} + +/// Reads committed blocks for every subscription, sharing what was read. +pub struct BlockSource { + tenderdash: Arc, + blocks: Cache, BlockWeighter>, + /// Metas pages by their exact `(start, end)` range; committed metas never change. + meta_pages: Cache<(u64, u64), Arc>>, + /// One permit per Tenderdash RPC, held only for that call, so a slow client cannot hold it. + fetches: Semaphore, +} + +impl BlockSource { + pub fn new(tenderdash: Arc) -> Self { + Self { + tenderdash, + blocks: Cache::with_options( + OptionsBuilder::new() + .estimated_items_capacity(4096) + .weight_capacity(BLOCK_CACHE_BYTES) + .shards(BLOCK_CACHE_SHARDS) + .build() + .expect("the block cache options are valid"), + BlockWeighter, + DefaultHashBuilder::default(), + DefaultLifecycle::default(), + ), + meta_pages: Cache::new(META_PAGE_CACHE_PAGES), + fetches: Semaphore::new(MAX_CONCURRENT_FETCHES), + } + } + + /// The highest height Tenderdash reports stored. Its results may not be saved yet. + pub async fn latest_height(&self) -> DAPIResult { + let _permit = self.fetch_permit(1).await?; + self.tenderdash.latest_height().await + } + + /// Succeeds once the execution results of `height` are saved, so the height is readable. + pub async fn results_saved(&self, height: u64) -> DAPIResult<()> { + let _permit = self.fetch_permit(1).await?; + self.tenderdash.block_results(height).await.map(|_| ()) + } + + /// The metas of the aligned page holding `height` (heights `page_start..page_start + 20`), + /// up to `tip`. + pub async fn meta_page( + &self, + height: u64, + tip: u64, + ) -> DAPIResult<(u64, Arc>)> { + let page_start = (height.saturating_sub(1) / META_PAGE) * META_PAGE + 1; + let page_end = (page_start + META_PAGE - 1).min(tip); + let page = self + .meta_pages + .get_or_insert_async(&(page_start, page_end), async { + let _permit = self.fetch_permit(1).await?; + let info = self.tenderdash.blockchain(page_start, page_end).await?; + Ok::<_, DapiError>(Arc::new(page_from_metas( + page_start, + page_end, + &info.block_metas, + )?)) + }) + .await?; + Ok((page_start, page)) + } + + /// Read the committed block at `height`, which must be at or below the published tip. + pub async fn read(&self, height: u64) -> DAPIResult> { + self.blocks + .get_or_insert_async(&height, self.fetch(height)) + .await + } + + async fn fetch_permit(&self, calls: u32) -> DAPIResult> { + self.fetches + .acquire_many(calls) + .await + .map_err(|_| DapiError::Internal("the block source is closed".to_string())) + } + + async fn fetch(&self, height: u64) -> DAPIResult> { + let (block, results) = { + let _permit = self.fetch_permit(2).await?; + tokio::join!( + self.tenderdash.block(height), + self.tenderdash.block_results(height) + ) + }; + let block = block? + .block + .ok_or_else(|| DapiError::Internal(format!("block {height} is not stored")))?; + let results = results?; + if block.data.txs.len() != results.txs_results.len() { + return Err(DapiError::Internal(format!( + "block {height} has {} transactions but {} execution results", + block.data.txs.len(), + results.txs_results.len() + ))); + } + + let protocol_version = u32::try_from(block.header.version.app).map_err(|_| { + DapiError::Internal(format!( + "block {height} has protocol version {} out of range", + block.header.version.app + )) + })?; + // Transactions decode under the rules of the version the block executed with, as + // consensus decoded them (older versions put no depth limit on document values). + let platform_version = PlatformVersion::get(protocol_version).ok(); + let mut txs = Vec::new(); + for (index, (tx, result)) in block.data.txs.iter().zip(&results.txs_results).enumerate() { + if result.code != 0 { + continue; + } + let bytes = BASE64_STANDARD.decode(tx).map_err(|e| { + DapiError::Internal(format!( + "block {height} transaction {index} is not valid base64: {e}" + )) + })?; + txs.push(CommittedTx { + index: index as u32, + hash: Sha256::digest(&bytes).into(), + state_transition: decode_state_transition(&bytes, platform_version), + bytes: Bytes::from(bytes), + }); + } + let time_ms = parse_block_time_ms(&block.header.time).ok_or_else(|| { + DapiError::Internal(format!( + "block {height} has an unreadable time '{}'", + block.header.time + )) + })?; + Ok(Arc::new(CommittedBlock { + height, + time_ms, + protocol_version, + txs, + })) + } +} + +/// A committed transaction decoded as the block's protocol version decoded it; `None` for a +/// version this build does not know, whose block the scan refuses anyway. +fn decode_state_transition( + bytes: &[u8], + platform_version: Option<&PlatformVersion>, +) -> Result { + let platform_version = + platform_version.ok_or_else(|| "unknown protocol version".to_string())?; + StateTransition::deserialize_from_bytes_untrusted_in_version(bytes, platform_version) + .map_err(|e| e.to_string()) +} + +/// The page `[page_start, page_end]` from the metas Tenderdash returned, which must cover +/// exactly those heights. Heights below the store's base come back missing: they are +/// unavailable, as are header-only metas (`num_txs` < 0, from state sync). +fn page_from_metas( + page_start: u64, + page_end: u64, + metas: &[BlockMeta], +) -> DAPIResult> { + let mut page = vec![HeightMeta::Unavailable; (page_end - page_start + 1) as usize]; + let mut lowest_returned = None; + for meta in metas { + let height = meta.header.height; + if !(page_start..=page_end).contains(&height) { + return Err(DapiError::Internal(format!( + "Tenderdash returned block meta {height} outside of {page_start}..={page_end}" + ))); + } + lowest_returned = Some(lowest_returned.map_or(height, |lowest: u64| lowest.min(height))); + page[(height - page_start) as usize] = match meta.num_txs { + n if n < 0 => HeightMeta::Unavailable, + 0 => HeightMeta::Empty, + _ => HeightMeta::HasTxs, + }; + } + // Every height from the lowest returned up to the page end must be there: Tenderdash only + // omits heights below its base. + if let Some(lowest) = lowest_returned { + let returned = metas.len() as u64; + if returned != page_end - lowest + 1 { + return Err(DapiError::Internal(format!( + "Tenderdash returned {returned} block metas for heights {lowest}..={page_end}" + ))); + } + } + Ok(page) +} + +/// A Tenderdash RFC 3339 block time in milliseconds since the Unix epoch. +fn parse_block_time_ms(time: &str) -> Option { + let time = chrono::DateTime::parse_from_rfc3339(time).ok()?; + u64::try_from(time.timestamp_millis()).ok() +} + +#[cfg(test)] +mod tests { + use super::*; + use crate::clients::tenderdash_client::{ + Block, BlockData, BlockHeader, ConsensusVersion, ExecTxResult, + }; + use dpp::prelude::Identifier; + use dpp::serialization::PlatformSerializable; + use dpp::state_transition::batch_transition::batched_transition::BatchedTransition; + use dpp::state_transition::batch_transition::batched_transition::document_create_transition::DocumentCreateTransition; + use dpp::state_transition::batch_transition::batched_transition::document_create_transition::v0::DocumentCreateTransitionV0; + use dpp::state_transition::batch_transition::batched_transition::document_transition::DocumentTransition; + use dpp::state_transition::batch_transition::document_base_transition::DocumentBaseTransition; + use dpp::state_transition::batch_transition::document_base_transition::v0::DocumentBaseTransitionV0; + use dpp::state_transition::batch_transition::{BatchTransition, BatchTransitionV1}; + + fn meta(height: u64, num_txs: i64) -> BlockMeta { + BlockMeta { + header: BlockHeader { + height, + ..Default::default() + }, + num_txs, + } + } + + #[test] + fn should_accept_a_complete_page_and_mark_empty_heights() { + let metas: Vec<_> = (1..=20).rev().map(|h| meta(h, (h % 2) as i64)).collect(); + let page = page_from_metas(1, 20, &metas).unwrap(); + assert_eq!(page[0], HeightMeta::HasTxs); + assert_eq!(page[1], HeightMeta::Empty); + } + + #[test] + fn should_treat_heights_below_the_store_base_and_header_only_metas_as_unavailable() { + let metas = vec![meta(40, 1), meta(39, -1), meta(38, 0)]; + let page = page_from_metas(21, 40, &metas).unwrap(); + // Heights 21..=37 are below the store's base. + assert_eq!(page[0], HeightMeta::Unavailable); + assert_eq!(page[16], HeightMeta::Unavailable); + assert_eq!(page[17], HeightMeta::Empty); + // Height 39 keeps only its header. + assert_eq!(page[18], HeightMeta::Unavailable); + assert_eq!(page[19], HeightMeta::HasTxs); + } + + #[test] + fn should_reject_a_page_with_a_gap_above_the_base() { + let metas = vec![meta(40, 1), meta(38, 0)]; + assert!(page_from_metas(21, 40, &metas).is_err()); + } + + #[test] + fn should_reject_metas_outside_the_page() { + assert!(page_from_metas(1, 20, &[meta(21, 0)]).is_err()); + } + + #[test] + fn should_parse_tenderdash_block_times() { + assert_eq!( + parse_block_time_ms("2026-10-05T12:00:00.123456789Z"), + Some(1_791_201_600_123) + ); + assert_eq!(parse_block_time_ms("not a time"), None); + } + + struct OneBlock { + txs: Vec, + results: Option>, + } + + #[async_trait] + impl TenderdashBlocks for OneBlock { + async fn latest_height(&self) -> DAPIResult { + Ok(1) + } + async fn block(&self, height: u64) -> DAPIResult { + Ok(ResultBlock { + block: Some(Block { + header: BlockHeader { + version: ConsensusVersion { app: 12 }, + height, + time: "2026-10-05T12:00:00Z".to_string(), + }, + data: BlockData { + txs: self.txs.clone(), + }, + }), + }) + } + async fn block_results(&self, _: u64) -> DAPIResult { + match &self.results { + Some(results) => Ok(ResultBlockResults { + txs_results: results.clone(), + }), + None => Err(DapiError::Client("no results for height".to_string())), + } + } + async fn blockchain(&self, _: u64, _: u64) -> DAPIResult { + Ok(ResultBlockchainInfo::default()) + } + } + + fn result(code: u32) -> ExecTxResult { + ExecTxResult { + code, + ..Default::default() + } + } + + #[tokio::test] + async fn should_keep_only_successful_transactions_with_their_block_positions() { + let txs = vec![ + BASE64_STANDARD.encode(b"first"), + BASE64_STANDARD.encode(b"second"), + ]; + let source = BlockSource::new(Arc::new(OneBlock { + txs, + results: Some(vec![result(1), result(0)]), + })); + let block = source.read(1).await.unwrap(); + assert_eq!(block.protocol_version, 12); + assert_eq!(block.txs.len(), 1); + assert_eq!(block.txs[0].index, 1); + assert_eq!(&block.txs[0].bytes[..], b"second"); + assert_eq!( + block.txs[0].hash, + <[u8; 32]>::from(Sha256::digest(b"second")) + ); + } + + #[tokio::test] + async fn should_fail_to_read_a_block_without_saved_results() { + let source = BlockSource::new(Arc::new(OneBlock { + txs: vec![BASE64_STANDARD.encode(b"tx")], + results: None, + })); + assert!(source.read(1).await.is_err()); + assert!(source.results_saved(1).await.is_err()); + } + + /// A batch creating a document whose data holds `len` copies of `element`, a compact + /// encoding that decodes to one `Value` each. + fn array_batch(element: Value, len: usize) -> Vec { + StateTransition::Batch(BatchTransition::V1(BatchTransitionV1 { + owner_id: Identifier::from([1u8; 32]), + transitions: vec![BatchedTransition::Document(DocumentTransition::Create( + DocumentCreateTransition::V0(DocumentCreateTransitionV0 { + base: DocumentBaseTransition::V0(DocumentBaseTransitionV0 { + id: Identifier::from([2u8; 32]), + identity_contract_nonce: 1, + document_type_name: "note".to_string(), + data_contract_id: Identifier::from([3u8; 32]), + }), + entropy: [0; 32], + data: [("flags".to_string(), Value::Array(vec![element; len]))].into(), + prefunded_voting_balance: None, + }), + ))], + ..Default::default() + })) + .serialize_to_bytes() + .expect("serializable") + } + + #[tokio::test] + async fn should_weigh_a_decoded_compact_array_at_least_at_its_decoded_size() { + let len = 50_000; + let source = BlockSource::new(Arc::new(OneBlock { + txs: vec![BASE64_STANDARD.encode(array_batch(Value::Bool(true), len))], + results: Some(vec![result(0)]), + })); + let block = source.read(1).await.unwrap(); + assert!( + block.txs[0].state_transition.is_ok(), + "the transaction decodes" + ); + let decoded = len * size_of::(); + assert!(BlockWeighter.weight(&1, &block) >= decoded as u64); + } + + #[tokio::test] + async fn should_weigh_a_decoded_array_at_least_at_its_retained_capacity() { + // One past a power of two: growing one at a time leaves room for 16,384. + let source = BlockSource::new(Arc::new(OneBlock { + txs: vec![BASE64_STANDARD.encode(array_batch(Value::Null, 8_193))], + results: Some(vec![result(0)]), + })); + let block = source.read(1).await.unwrap(); + assert!( + block.txs[0].state_transition.is_ok(), + "the transaction decodes" + ); + let retained = 16_384 * size_of::(); + assert!(BlockWeighter.weight(&1, &block) >= retained as u64); + } +} diff --git a/packages/rs-dapi/src/services/platform_service/subscribe_to_state_transitions/mod.rs b/packages/rs-dapi/src/services/platform_service/subscribe_to_state_transitions/mod.rs new file mode 100644 index 00000000000..768f4e70844 --- /dev/null +++ b/packages/rs-dapi/src/services/platform_service/subscribe_to_state_transitions/mod.rs @@ -0,0 +1,140 @@ +//! `subscribeToStateTransitions`: stream committed state transitions matching a client's +//! filters; see `packages/dapi/doc/endpoints/streams/subscribeToStateTransitions.md`. + +mod block_source; +mod stream; + +pub use block_source::{BlockSource, TenderdashBlocks}; +pub use stream::{SubscriptionLimits, SubscriptionService, SubscriptionStream}; + +use crate::services::platform_service::PlatformServiceImpl; +use crate::services::platform_service::shielded_proof_failure_budget::SourceKey; +use dapi_grpc::platform::v0::SubscribeToStateTransitionsRequest; +use dapi_grpc::platform::v0::subscribe_to_state_transitions_request::Version; +use dapi_grpc::platform::v0::{ + GetDataContractRequest, get_data_contract_request, get_data_contract_response, +}; +use dapi_grpc::tonic::{Request, Status}; +use dash_platform_queries::subscriptions::{ + ResolvedFilters, StateTransitionFilter, SubscriptionFilterError, check_filter_count, +}; +use dpp::data_contract::DataContract; +use dpp::prelude::Identifier; +use dpp::serialization::PlatformDeserializableWithPotentialValidationFromVersionedStructureUntrusted; +use dpp::version::PlatformVersion; +use std::collections::BTreeMap; +use std::sync::Arc; +use std::time::Duration; + +/// How often a checkpoint is sent while no block matches. +pub const CHECKPOINT_INTERVAL: Duration = Duration::from_secs(10); + +impl PlatformServiceImpl { + /// Validate a subscription request and start its stream. + pub async fn subscribe_to_state_transitions_impl( + &self, + request: Request, + ) -> Result { + let source = SourceKey::of_request(&request); + let Some(Version::V0(request)) = request.into_inner().version else { + return Err(Status::invalid_argument("missing request version")); + }; + if request.from_block_height == Some(0) { + return Err(Status::invalid_argument( + "from_block_height starts at 1; leave it unset to start after the current tip", + )); + } + // Bound the filter count before any work is done, Drive lookups included. Per-filter + // limits are checked by `resolve`, after the Drive fetches. + check_filter_count(request.filters.len()) + .map_err(|e| Status::invalid_argument(e.to_string()))?; + let filters = request + .filters + .into_iter() + .enumerate() + .map(|(index, filter)| StateTransitionFilter::from_proto(index, filter)) + .collect::, _>>() + .map_err(filter_error_status)?; + + // Admit before doing any work on the client's behalf. + let admission = self.subscriptions.admit(source)?; + + let mut contracts = BTreeMap::new(); + // Resolve under the version Drive decoded the contracts with, the lowest if they came + // from different blocks. + let mut platform_version: Option<&'static PlatformVersion> = None; + for data_contract_id in ResolvedFilters::data_contract_ids(&filters) { + let (contract, version) = self.fetch_data_contract(data_contract_id).await?; + if platform_version + .is_none_or(|lowest| version.protocol_version < lowest.protocol_version) + { + platform_version = Some(version); + } + if let Some(contract) = contract { + contracts.insert(data_contract_id, Arc::new(contract)); + } + } + // Without document filters no contract is read, and address filters are not versioned. + let platform_version = platform_version.unwrap_or_else(PlatformVersion::latest); + let filters = + ResolvedFilters::resolve(filters, |id| contracts.get(id).cloned(), platform_version) + .map_err(filter_error_status)?; + + self.subscriptions + .start(admission, filters, request.from_block_height) + .await + } + + /// The current version of a data contract, from Drive (unproved), and the platform version + /// Drive reported, which it is decoded with. + async fn fetch_data_contract( + &self, + data_contract_id: Identifier, + ) -> Result<(Option, &'static PlatformVersion), Status> { + let request = GetDataContractRequest { + version: Some(get_data_contract_request::Version::V0( + get_data_contract_request::GetDataContractRequestV0 { + id: data_contract_id.to_vec(), + prove: false, + }, + )), + }; + let response = self + .drive_client + .get_client() + .get_data_contract(request) + .await? + .into_inner(); + let Some(get_data_contract_response::Version::V0(response)) = response.version else { + return Err(Status::internal( + "Drive returned an unversioned data contract", + )); + }; + let protocol_version = response + .metadata + .as_ref() + .map(|metadata| metadata.protocol_version) + .unwrap_or(PlatformVersion::latest().protocol_version); + let platform_version = PlatformVersion::get(protocol_version) + .map_err(|e| Status::failed_precondition(e.to_string()))?; + let contract = match response.result { + Some( + get_data_contract_response::get_data_contract_response_v0::Result::DataContract( + bytes, + ), + ) if !bytes.is_empty() => Some( + DataContract::versioned_deserialize_untrusted(&bytes, false, platform_version) + .map_err(|e| Status::internal(format!("cannot decode data contract: {e}")))?, + ), + _ => None, + }; + Ok((contract, platform_version)) + } +} + +fn filter_error_status(error: SubscriptionFilterError) -> Status { + match error { + SubscriptionFilterError::DataContractNotFound(_) => Status::not_found(error.to_string()), + _ => Status::invalid_argument(error.to_string()), + } +} diff --git a/packages/rs-dapi/src/services/platform_service/subscribe_to_state_transitions/stream.rs b/packages/rs-dapi/src/services/platform_service/subscribe_to_state_transitions/stream.rs new file mode 100644 index 00000000000..acc2613f6eb --- /dev/null +++ b/packages/rs-dapi/src/services/platform_service/subscribe_to_state_transitions/stream.rs @@ -0,0 +1,503 @@ +//! Admission and the per-subscription scan loop. + +use super::CHECKPOINT_INTERVAL; +use super::block_source::{BlockSource, CommittedBlock, HeightMeta}; +use crate::error::DAPIResult; +use crate::services::platform_service::shielded_proof_failure_budget::SourceKey; +use dapi_grpc::platform::v0::SubscribeToStateTransitionsResponse; +use dapi_grpc::platform::v0::subscribe_to_state_transitions_response::subscribe_to_state_transitions_response_v0::{ + Checkpoint, Responses, StateTransitionMatch, +}; +use dapi_grpc::platform::v0::subscribe_to_state_transitions_response::{ + SubscribeToStateTransitionsResponseV0, Version, +}; +use dapi_grpc::tonic::Status; +use dash_platform_queries::subscriptions::{FilterMatch, ResolvedFilters}; +use dpp::version::PlatformVersion; +use futures::Stream; +use std::collections::HashMap; +use std::pin::Pin; +use std::sync::{Arc, Mutex, Weak}; +use std::task::{Context, Poll}; +use std::time::Duration; +use tokio::sync::broadcast::error::RecvError; +use tokio::sync::{OwnedSemaphorePermit, Semaphore, broadcast, mpsc, watch}; +use tokio::time::{Instant, sleep, timeout}; +use tracing::{debug, warn}; + +type Item = Result; + +/// What a subscription's stream reads: the buffered messages, then the status the scan ended +/// with, if any. The scan frees the messages of a client that stopped reading. +#[derive(Debug)] +struct Buffer { + messages: mpsc::Receiver, + end: Option, +} + +/// The response stream of one subscription: the buffered messages, then the status the scan +/// ended with, if any. +#[derive(Debug)] +pub struct SubscriptionStream { + buffer: Arc>, +} + +impl Stream for SubscriptionStream { + type Item = Item; + + fn poll_next(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { + let mut buffer = self.buffer.lock().unwrap_or_else(|e| e.into_inner()); + match buffer.messages.poll_recv(cx) { + // The scan sets the status before dropping the sender, so it is there once the + // channel has ended. + Poll::Ready(None) => Poll::Ready(buffer.end.take().map(Err)), + other => other, + } + } +} + +/// Messages buffered per subscription before the client must read. +const STREAM_BUFFER: usize = 32; +/// How long a full buffer may stay full before the subscription ends. +const SEND_DEADLINE: Duration = Duration::from_secs(60); +/// How often the tip is polled when no new-block event arrives. +const TIP_POLL_INTERVAL: Duration = Duration::from_secs(5); + +/// Bounds on what subscriptions may cost one node. +#[derive(Debug, Clone, Copy)] +pub struct SubscriptionLimits { + /// Concurrent subscriptions on the node. + pub max_subscriptions: usize, + /// Concurrent subscriptions from one source (IPv6: per /48). + pub max_subscriptions_per_source: usize, + /// How far behind the tip a subscription may start. + pub max_replay_blocks: u64, + /// How far ahead of the tip a subscription may start; it waits for those blocks. + pub max_blocks_ahead: u64, +} + +impl Default for SubscriptionLimits { + fn default() -> Self { + Self { + max_subscriptions: 256, + max_subscriptions_per_source: 16, + max_replay_blocks: 50_000, + max_blocks_ahead: 1_000, + } + } +} + +/// A subscription's claim on the node's subscription capacity, released on drop. +pub struct Admission { + _permit: OwnedSemaphorePermit, + _per_source: Option, +} + +struct PerSourceGuard { + key: SourceKey, + counts: Arc>>, +} + +impl Drop for PerSourceGuard { + fn drop(&mut self) { + let mut counts = self.counts.lock().unwrap_or_else(|e| e.into_inner()); + if let Some(count) = counts.get_mut(&self.key) { + *count -= 1; + if *count == 0 { + counts.remove(&self.key); + } + } + } +} + +/// Serves every subscription of the node from one block source. +pub struct SubscriptionService { + blocks: Arc, + tip: watch::Receiver, + limits: SubscriptionLimits, + subscriptions: Arc, + per_source: Arc>>, +} + +impl SubscriptionService { + /// `tip` carries the highest readable height; see [`Self::track_tip`]. + pub fn new( + blocks: Arc, + tip: watch::Receiver, + limits: SubscriptionLimits, + ) -> Self { + Self { + blocks, + tip, + subscriptions: Arc::new(Semaphore::new(limits.max_subscriptions)), + per_source: Arc::new(Mutex::new(HashMap::new())), + limits, + } + } + + /// Keep `tip` at the highest height whose execution results are saved, checking on every + /// `new_blocks` event and every few seconds. Runs until `tip` has no receivers. + pub async fn track_tip( + blocks: Arc, + tip: watch::Sender, + mut new_blocks: broadcast::Receiver, + ) { + let mut events_open = true; + loop { + if let Err(error) = publish_tip(&blocks, &tip).await { + debug!(%error, "cannot advance the state transition subscription tip"); + } + if tip.is_closed() { + return; + } + tokio::select! { + _ = sleep(TIP_POLL_INTERVAL) => {} + // A lagged receiver still means new blocks; a closed one leaves only the poll. + event = new_blocks.recv(), if events_open => { + events_open = !matches!(event, Err(RecvError::Closed)); + } + } + } + } + + /// Claim capacity for a new subscription from `source`, or refuse it. + pub(super) fn admit(&self, source: Option) -> Result { + let permit = self + .subscriptions + .clone() + .try_acquire_owned() + .map_err(|_| { + Status::resource_exhausted("too many state transition subscriptions on this node") + })?; + let per_source = match source { + Some(key) => { + let mut counts = self.per_source.lock().unwrap_or_else(|e| e.into_inner()); + let count = counts.entry(key).or_insert(0); + if *count >= self.limits.max_subscriptions_per_source { + return Err(Status::resource_exhausted(format!( + "at most {} state transition subscriptions per client address", + self.limits.max_subscriptions_per_source + ))); + } + *count += 1; + Some(PerSourceGuard { + key, + counts: self.per_source.clone(), + }) + } + None => None, + }; + Ok(Admission { + _permit: permit, + _per_source: per_source, + }) + } + + /// Start scanning from `from_block_height`, or after the current tip. + pub async fn start( + &self, + admission: Admission, + filters: ResolvedFilters, + from_block_height: Option, + ) -> Result { + let tip = self.current_tip().await?; + let start = match from_block_height { + None => tip + 1, + Some(height) => { + if height.saturating_add(self.limits.max_replay_blocks) < tip { + return Err(Status::out_of_range(format!( + "from_block_height {height} is more than {} blocks behind the tip {tip}", + self.limits.max_replay_blocks + ))); + } + // A node this far behind may still serve the height elsewhere. + if height > tip.saturating_add(self.limits.max_blocks_ahead) { + return Err(Status::unavailable(format!( + "from_block_height {height} is more than {} blocks ahead of the tip {tip}", + self.limits.max_blocks_ahead + ))); + } + height + } + }; + + let (sender, messages) = mpsc::channel(STREAM_BUFFER); + let buffer = Arc::new(Mutex::new(Buffer { + messages, + end: None, + })); + let scan = Scan { + blocks: self.blocks.clone(), + tip: self.tip.clone(), + filters, + sender, + buffer: Arc::downgrade(&buffer), + next_height: start.max(1), + }; + // The task ends once the client drops the stream, which closes `sender`. + tokio::spawn(scan.run(admission)); + Ok(SubscriptionStream { buffer }) + } + + async fn current_tip(&self) -> Result { + let tip = *self.tip.borrow(); + if tip > 0 { + return Ok(tip); + } + // Not published yet: the height the tracker would publish. + readable_tip(&self.blocks, 0) + .await + .map(|height| height.unwrap_or(0)) + .map_err(|e| Status::unavailable(format!("cannot read the Tenderdash tip: {e}"))) + } +} + +/// Publish the readable tip; see [`readable_tip`]. +async fn publish_tip(blocks: &BlockSource, tip: &watch::Sender) -> DAPIResult<()> { + let published = *tip.borrow(); + if let Some(height) = readable_tip(blocks, published).await? { + tip.send_replace(height); + } + Ok(()) +} + +/// The latest stored height once its results are saved, or the one before it while they are +/// not, so fast blocks cannot starve publication: every height at or below it is readable. +/// `None` if it is not above `published`. +async fn readable_tip(blocks: &BlockSource, published: u64) -> DAPIResult> { + let height = blocks.latest_height().await?; + if height <= published { + return Ok(None); + } + match blocks.results_saved(height).await { + Ok(()) => Ok(Some(height)), + Err(error) if height - 1 > published => { + blocks.results_saved(height - 1).await?; + debug!(%error, height, "tip results not saved yet; using the height before it"); + Ok(Some(height - 1)) + } + Err(error) => Err(error), + } +} + +/// Why a scan stopped. +enum Stop { + /// The client went away. + Closed, + /// End the stream with this status. + Fail(Status), + /// The client did not read for `SEND_DEADLINE`. + SlowClient, +} + +struct Scan { + blocks: Arc, + tip: watch::Receiver, + filters: ResolvedFilters, + sender: mpsc::Sender, + /// The stream's buffer, given the status the stream ends with before `sender` is dropped. + /// Weak, so a client dropping the stream still closes the channel. + buffer: Weak>, + /// The next height to scan; every height below it has been fully scanned. + next_height: u64, +} + +impl Scan { + /// Scan until the subscription ends, then leave the status for the stream to end with, after + /// what is buffered if the client reads it within `SEND_DEADLINE`. Capacity is given back + /// only once the buffer is read or discarded, so a stalled client holds both or neither. + async fn run(mut self, admission: Admission) { + let (status, drained) = match self.scan().await { + Ok(()) | Err(Stop::Closed) => return, + // Its buffer already stayed full for the whole deadline. + Err(Stop::SlowClient) => ( + Status::resource_exhausted(format!( + "the client did not read for {}s; resume from the last checkpoint", + SEND_DEADLINE.as_secs() + )), + false, + ), + Err(Stop::Fail(status)) => { + debug!(code = ?status.code(), message = status.message(), "ending state transition subscription"); + // Every slot is free again once the client has read everything buffered. + let drained = timeout(SEND_DEADLINE, self.sender.reserve_many(STREAM_BUFFER)) + .await + .is_ok_and(|reserved| reserved.is_ok()); + (status, drained) + } + }; + if let Some(buffer) = self.buffer.upgrade() { + let mut buffer = buffer.lock().unwrap_or_else(|e| e.into_inner()); + if !drained { + while buffer.messages.try_recv().is_ok() {} + } + buffer.end = Some(status); + } + // Dropping the sender ends the channel; the capacity goes after the buffer. + drop(self); + drop(admission); + } + + async fn scan(&mut self) -> Result<(), Stop> { + self.checkpoint().await?; + let mut last_checkpoint = Instant::now(); + loop { + let tip = *self.tip.borrow(); + if self.next_height > tip { + tokio::select! { + _ = self.sender.closed() => return Err(Stop::Closed), + changed = self.tip.changed() => { + if changed.is_err() { + return Err(Stop::Fail(Status::unavailable("the node is shutting down"))); + } + } + _ = sleep(CHECKPOINT_INTERVAL.saturating_sub(last_checkpoint.elapsed())) => { + self.checkpoint().await?; + last_checkpoint = Instant::now(); + } + } + continue; + } + if self.sender.is_closed() { + return Err(Stop::Closed); + } + + let (page_start, page) = + unless_closed(&self.sender, self.blocks.meta_page(self.next_height, tip)) + .await? + .map_err(|e| { + Stop::Fail(Status::unavailable(format!("cannot read block metas: {e}"))) + })?; + let page_end = page_start + page.len() as u64 - 1; + while self.next_height <= page_end { + let height = self.next_height; + match page[(height - page_start) as usize] { + HeightMeta::Empty => {} + HeightMeta::Unavailable => { + return Err(Stop::Fail(Status::failed_precondition(format!( + "block {height} is not available on this node" + )))); + } + HeightMeta::HasTxs => { + if self.scan_block(height).await? { + last_checkpoint = Instant::now(); + } + } + } + self.next_height += 1; + if last_checkpoint.elapsed() >= CHECKPOINT_INTERVAL { + self.checkpoint().await?; + last_checkpoint = Instant::now(); + } + } + } + } + + /// Send the matches of the block at `height`, then a checkpoint at it. Returns whether + /// anything matched. + async fn scan_block(&mut self, height: u64) -> Result { + let block = unless_closed(&self.sender, self.blocks.read(height)) + .await? + .map_err(|error| { + Stop::Fail(Status::unavailable(format!( + "cannot read block {height}: {error}; resume from {height}" + ))) + })?; + let matches = self.match_block(&block)?; + if matches.is_empty() { + return Ok(false); + } + // Build the responses first, so a stalled client pins no decoded block. + let responses: Vec<_> = matches + .into_iter() + .map(|(position, filter_match)| { + let tx = &block.txs[position]; + Responses::StateTransition(StateTransitionMatch { + block_height: height, + block_time_ms: block.time_ms, + protocol_version: block.protocol_version, + state_transition_hash: tx.hash.to_vec(), + state_transition: tx.bytes.clone(), + matched_filters: filter_match.matched_filters, + matched_batch_positions: filter_match.matched_batch_positions, + }) + }) + .collect(); + drop(block); + for response in responses { + self.send(response).await?; + } + self.checkpoint_at(height).await?; + Ok(true) + } + + /// The positions, in `block.txs`, of the block's transitions that match, in block order, + /// with what they matched. + fn match_block(&self, block: &CommittedBlock) -> Result, Stop> { + let height = block.height; + let platform_version = PlatformVersion::get(block.protocol_version).map_err(|_| { + Stop::Fail(Status::failed_precondition(format!( + "block {height} executed under protocol version {}, which this node does not \ + know; resume from {height} on an upgraded node", + block.protocol_version + ))) + })?; + + let mut matches = Vec::new(); + for (position, tx) in block.txs.iter().enumerate() { + let state_transition = tx.state_transition.as_ref().map_err(|e| { + warn!(height, index = tx.index, error = %e, "cannot decode an executed state transition"); + Stop::Fail(Status::failed_precondition(format!( + "block {height} transaction {} cannot be decoded by this node ({e}); resume \ + from {height} on an upgraded node", + tx.index + ))) + })?; + if let Some(filter_match) = self.filters.matches(state_transition, platform_version) { + matches.push((position, filter_match)); + } + } + Ok(matches) + } + + /// A checkpoint at the highest fully scanned height. + async fn checkpoint(&mut self) -> Result<(), Stop> { + self.checkpoint_at(self.next_height - 1).await + } + + async fn checkpoint_at(&mut self, height: u64) -> Result<(), Stop> { + self.send(Responses::Checkpoint(Checkpoint { + block_height: height, + })) + .await + } + + async fn send(&mut self, message: Responses) -> Result<(), Stop> { + let response = SubscribeToStateTransitionsResponse { + version: Some(Version::V0(SubscribeToStateTransitionsResponseV0 { + responses: Some(message), + })), + }; + match timeout(SEND_DEADLINE, self.sender.send(Ok(response))).await { + Ok(Ok(())) => Ok(()), + Ok(Err(_)) => Err(Stop::Closed), + Err(_) => Err(Stop::SlowClient), + } + } +} + +/// `read`, or [`Stop::Closed`] once the client is gone: a read can queue behind other +/// subscriptions' fetches, and a gone client must not hold its admission meanwhile. +async fn unless_closed( + sender: &mpsc::Sender, + read: impl Future, +) -> Result { + tokio::select! { + biased; + value = read => Ok(value), + _ = sender.closed() => Err(Stop::Closed), + } +} + +#[cfg(test)] +mod tests; diff --git a/packages/rs-dapi/src/services/platform_service/subscribe_to_state_transitions/stream/tests.rs b/packages/rs-dapi/src/services/platform_service/subscribe_to_state_transitions/stream/tests.rs new file mode 100644 index 00000000000..366cba9bee7 --- /dev/null +++ b/packages/rs-dapi/src/services/platform_service/subscribe_to_state_transitions/stream/tests.rs @@ -0,0 +1,694 @@ +use super::*; +use crate::DapiError; +use crate::clients::tenderdash_client::{ + Block, BlockData, BlockHeader, BlockMeta, ConsensusVersion, ExecTxResult, ResultBlock, + ResultBlockResults, ResultBlockchainInfo, +}; +use crate::services::platform_service::subscribe_to_state_transitions::TenderdashBlocks; +use crate::services::platform_service::subscribe_to_state_transitions::block_source::MAX_CONCURRENT_FETCHES; +use async_trait::async_trait; +use base64::Engine; +use base64::prelude::BASE64_STANDARD; +use dash_platform_queries::subscriptions::{Role, StateTransitionFilter}; +use dpp::address_funds::PlatformAddress; +use dpp::serialization::PlatformSerializable; +use dpp::state_transition::StateTransition; +use dpp::state_transition::address_funds_transfer_transition::AddressFundsTransferTransition; +use dpp::state_transition::address_funds_transfer_transition::v0::AddressFundsTransferTransitionV0; +use futures::FutureExt; +use std::collections::BTreeMap; +use std::net::IpAddr; +use std::sync::atomic::{AtomicUsize, Ordering}; +use tokio_stream::StreamExt; + +/// A chain held in memory: height → successful transactions. +#[derive(Default)] +struct FakeChain { + blocks: Mutex>>>, + /// A height whose execution results are not saved yet. + results_withheld: Mutex>, + /// RPCs of any kind in flight, the most seen at once, and the `block` calls made. + reads_in_flight: AtomicUsize, + max_reads_in_flight: AtomicUsize, + block_reads: AtomicUsize, + /// Held by a test to keep `block` calls waiting before they read. + read_gate: tokio::sync::Mutex<()>, +} + +impl FakeChain { + fn push(&self, txs: Vec>) -> u64 { + let mut blocks = self.blocks.lock().unwrap(); + let height = blocks.len() as u64 + 1; + blocks.insert(height, txs); + height + } + + fn txs(&self, height: u64) -> Option>> { + self.blocks.lock().unwrap().get(&height).cloned() + } + + /// Counts an RPC in flight, letting other calls start meanwhile. + async fn in_flight(&self) { + let now = self.reads_in_flight.fetch_add(1, Ordering::SeqCst) + 1; + self.max_reads_in_flight.fetch_max(now, Ordering::SeqCst); + tokio::task::yield_now().await; + self.reads_in_flight.fetch_sub(1, Ordering::SeqCst); + } +} + +#[async_trait] +impl TenderdashBlocks for FakeChain { + async fn latest_height(&self) -> DAPIResult { + self.in_flight().await; + Ok(self.blocks.lock().unwrap().len() as u64) + } + + async fn block(&self, height: u64) -> DAPIResult { + drop(self.read_gate.lock().await); + self.block_reads.fetch_add(1, Ordering::SeqCst); + self.in_flight().await; + Ok(ResultBlock { + block: self.txs(height).map(|txs| Block { + header: BlockHeader { + version: ConsensusVersion { + app: PlatformVersion::latest().protocol_version as u64, + }, + height, + time: "2026-10-05T12:00:00Z".to_string(), + }, + data: BlockData { + txs: txs.iter().map(|tx| BASE64_STANDARD.encode(tx)).collect(), + }, + }), + }) + } + + async fn block_results(&self, height: u64) -> DAPIResult { + self.in_flight().await; + let withheld = *self.results_withheld.lock().unwrap() == Some(height); + let txs = self + .txs(height) + .filter(|_| !withheld) + .ok_or_else(|| DapiError::Client("no results for height".to_string()))?; + Ok(ResultBlockResults { + txs_results: txs.iter().map(|_| ExecTxResult::default()).collect(), + }) + } + + async fn blockchain( + &self, + min_height: u64, + max_height: u64, + ) -> DAPIResult { + self.in_flight().await; + let blocks = self.blocks.lock().unwrap(); + let max_height = max_height.min(blocks.len() as u64); + let min_height = min_height.max(max_height.saturating_sub(19)).max(1); + Ok(ResultBlockchainInfo { + block_metas: (min_height..=max_height) + .rev() + .map(|height| BlockMeta { + header: BlockHeader { + height, + ..Default::default() + }, + num_txs: blocks[&height].len() as i64, + }) + .collect(), + }) + } +} + +fn address(byte: u8) -> PlatformAddress { + PlatformAddress::P2pkh([byte; 20]) +} + +/// A serialized transfer from address 1 to address `recipient`. +fn transfer_to(recipient: u8) -> Vec { + StateTransition::AddressFundsTransfer(AddressFundsTransferTransition::V0( + AddressFundsTransferTransitionV0 { + inputs: BTreeMap::from([(address(1), (1, 5000))]), + outputs: BTreeMap::from([(address(recipient), 4000)]), + ..Default::default() + }, + )) + .serialize_to_bytes() + .unwrap() +} + +fn recipient_filter(recipient: u8) -> ResolvedFilters { + ResolvedFilters::resolve( + vec![StateTransitionFilter::Addresses { + addresses: vec![address(recipient)], + role: Role::Recipient, + }], + |_| None, + PlatformVersion::latest(), + ) + .unwrap() +} + +struct Harness { + chain: Arc, + blocks: Arc, + service: SubscriptionService, + tip: watch::Sender, +} + +fn harness(limits: SubscriptionLimits) -> Harness { + let chain = Arc::new(FakeChain::default()); + let blocks = Arc::new(BlockSource::new(chain.clone())); + let (tip, tip_receiver) = watch::channel(0); + Harness { + service: SubscriptionService::new(blocks.clone(), tip_receiver, limits), + blocks, + chain, + tip, + } +} + +impl Harness { + fn commit(&self, txs: Vec>) -> u64 { + let height = self.chain.push(txs); + self.tip.send_replace(height); + height + } + + async fn subscribe(&self, recipient: u8, from: Option) -> SubscriptionStream { + self.service + .start( + self.service.admit(None).unwrap(), + recipient_filter(recipient), + from, + ) + .await + .unwrap() + } + + /// A subscription from `source` to transfers to 7 from height 1, or its refusal. + async fn subscribe_from( + &self, + source: Option, + ) -> Result { + let admission = self.service.admit(source)?; + self.service + .start(admission, recipient_filter(7), Some(1)) + .await + } +} + +enum Message { + Match { height: u64, tx: Vec }, + Checkpoint(u64), +} + +async fn next(stream: &mut SubscriptionStream) -> Message { + // Longer than a checkpoint interval, so tests on paused time reach the next checkpoint. + let response = timeout(CHECKPOINT_INTERVAL * 3, stream.next()) + .await + .expect("expected a message") + .expect("expected the stream to stay open") + .expect("expected no error"); + let Some(Version::V0(v0)) = response.version else { + panic!("expected a v0 response"); + }; + match v0.responses.unwrap() { + Responses::StateTransition(matched) => Message::Match { + height: matched.block_height, + tx: matched.state_transition.to_vec(), + }, + Responses::Checkpoint(checkpoint) => Message::Checkpoint(checkpoint.block_height), + } +} + +async fn expect_checkpoint(stream: &mut SubscriptionStream, height: u64) { + match next(stream).await { + Message::Checkpoint(at) => assert_eq!(at, height, "checkpoint height"), + Message::Match { height: at, .. } => panic!("expected a checkpoint, got a match at {at}"), + } +} + +async fn expect_match(stream: &mut SubscriptionStream, height: u64, expected: &[u8]) { + match next(stream).await { + Message::Match { height: at, tx } => { + assert_eq!(at, height, "match height"); + assert_eq!(tx, expected, "matched transition"); + } + Message::Checkpoint(at) => panic!("expected a match, got a checkpoint at {at}"), + } +} + +#[tokio::test] +async fn should_replay_history_then_follow_new_blocks_without_gaps() { + let harness = harness(SubscriptionLimits::default()); + // 45 blocks spanning three meta pages; matches at 3 and 30. + for height in 1..=45u64 { + let txs = match height { + 3 => vec![transfer_to(9), transfer_to(7)], + 30 => vec![transfer_to(7)], + h if h % 2 == 0 => vec![transfer_to(9)], + _ => vec![], + }; + harness.commit(txs); + } + let mut stream = harness.subscribe(7, Some(2)).await; + + expect_checkpoint(&mut stream, 1).await; + expect_match(&mut stream, 3, &transfer_to(7)).await; + expect_checkpoint(&mut stream, 3).await; + expect_match(&mut stream, 30, &transfer_to(7)).await; + expect_checkpoint(&mut stream, 30).await; + + let height = harness.commit(vec![transfer_to(9), transfer_to(7)]); + expect_match(&mut stream, height, &transfer_to(7)).await; + expect_checkpoint(&mut stream, height).await; +} + +#[tokio::test] +async fn should_start_after_the_tip_when_no_height_is_given() { + let harness = harness(SubscriptionLimits::default()); + harness.commit(vec![transfer_to(7)]); + let mut stream = harness.subscribe(7, None).await; + expect_checkpoint(&mut stream, 1).await; + let height = harness.commit(vec![transfer_to(7)]); + expect_match(&mut stream, height, &transfer_to(7)).await; +} + +#[tokio::test] +async fn should_checkpoint_just_before_a_start_ahead_of_the_tip() { + let harness = harness(SubscriptionLimits::default()); + harness.commit(vec![]); + let mut stream = harness.subscribe(7, Some(5)).await; + expect_checkpoint(&mut stream, 4).await; + // Matches before the start are not delivered. + for _ in 2..5 { + harness.commit(vec![transfer_to(7)]); + } + let height = harness.commit(vec![transfer_to(7)]); + expect_match(&mut stream, height, &transfer_to(7)).await; + expect_checkpoint(&mut stream, height).await; +} + +#[tokio::test] +async fn should_send_a_match_sharing_the_cached_transaction_bytes() { + let harness = harness(SubscriptionLimits::default()); + let height = harness.commit(vec![transfer_to(7)]); + let mut stream = harness.subscribe(7, Some(height)).await; + expect_checkpoint(&mut stream, height - 1).await; + let response = stream.next().await.unwrap().unwrap(); + let Some(Version::V0(SubscribeToStateTransitionsResponseV0 { + responses: Some(Responses::StateTransition(matched)), + })) = response.version + else { + panic!("expected a match"); + }; + let block = harness.blocks.read(height).await.unwrap(); + assert_eq!( + matched.state_transition.as_ptr(), + block.txs[0].bytes.as_ptr(), + "the response shares the cached bytes" + ); +} + +#[tokio::test(start_paused = true)] +async fn should_send_checkpoints_while_nothing_matches() { + let harness = harness(SubscriptionLimits::default()); + harness.commit(vec![]); + let mut stream = harness.subscribe(7, None).await; + expect_checkpoint(&mut stream, 1).await; + harness.commit(vec![transfer_to(9)]); + expect_checkpoint(&mut stream, 2).await; + expect_checkpoint(&mut stream, 2).await; +} + +#[tokio::test] +async fn should_refuse_starts_too_far_behind_or_ahead_of_the_tip() { + let harness = harness(SubscriptionLimits { + max_replay_blocks: 10, + max_blocks_ahead: 5, + ..Default::default() + }); + for _ in 0..30 { + harness.commit(vec![]); + } + for (from, code) in [(5, tonic::Code::OutOfRange), (40, tonic::Code::Unavailable)] { + let error = harness + .service + .start( + harness.service.admit(None).unwrap(), + recipient_filter(7), + Some(from), + ) + .await + .unwrap_err(); + assert_eq!(error.code(), code, "from {from}"); + } +} + +#[tokio::test] +async fn should_limit_subscriptions_per_source() { + let harness = harness(SubscriptionLimits { + max_subscriptions_per_source: 2, + ..Default::default() + }); + let source = |ip: &str| Some(SourceKey::from(ip.parse::().unwrap())); + let first = harness.service.admit(source("203.0.113.7")).unwrap(); + let _second = harness.service.admit(source("203.0.113.7")).unwrap(); + assert_eq!( + harness + .service + .admit(source("203.0.113.7")) + .err() + .unwrap() + .code(), + tonic::Code::ResourceExhausted + ); + // Another source is not affected; a released slot can be reused. + assert!(harness.service.admit(source("203.0.113.8")).is_ok()); + drop(first); + assert!(harness.service.admit(source("203.0.113.7")).is_ok()); +} + +#[tokio::test] +async fn should_end_the_stream_on_a_transaction_this_node_cannot_decode() { + let harness = harness(SubscriptionLimits::default()); + harness.commit(vec![vec![0xff, 0x00, 0x13]]); + let mut stream = harness.subscribe(7, Some(1)).await; + expect_checkpoint(&mut stream, 0).await; + let status = timeout(Duration::from_secs(5), stream.next()) + .await + .unwrap() + .unwrap() + .unwrap_err(); + assert_eq!(status.code(), tonic::Code::FailedPrecondition); +} + +fn buffered(stream: &SubscriptionStream) -> usize { + stream.buffer.lock().unwrap().messages.len() +} + +#[tokio::test(start_paused = true)] +async fn should_free_a_slow_clients_slot_and_buffer_and_end_its_stream() { + let harness = harness(SubscriptionLimits { + max_subscriptions: 1, + ..Default::default() + }); + // More matches than the stream buffer holds, and a client that stops reading. + for _ in 0..100 { + harness.commit(vec![transfer_to(7)]); + } + let mut stream = harness.subscribe(7, Some(1)).await; + assert!( + harness.service.admit(None).is_err(), + "the only slot is taken" + ); + + // Just past the slow-reader deadline, not a second one, the slot is free again. + sleep(SEND_DEADLINE + Duration::from_secs(5)).await; + assert!( + harness.service.admit(None).is_ok(), + "a slow client's slot is freed at its deadline" + ); + + // What it left buffered is discarded: it resumes from its last received checkpoint. + let status = stream + .next() + .await + .expect("the stream ends with a status") + .expect_err("no buffered message is kept"); + assert_eq!(status.code(), tonic::Code::ResourceExhausted); + assert!(stream.next().await.is_none(), "the status is the last item"); +} + +#[tokio::test(start_paused = true)] +async fn should_drop_the_buffers_of_stalled_streams_while_replacements_are_admitted() { + let harness = harness(SubscriptionLimits { + max_subscriptions: 3, + ..Default::default() + }); + for _ in 0..100 { + harness.commit(vec![transfer_to(7)]); + } + // Batches of stalled streams, each opened once the previous batch timed out, all kept open. + let mut stalled = Vec::new(); + for _ in 0..3 { + let mut batch = Vec::new(); + for _ in 0..3 { + batch.push(harness.subscribe(7, Some(1)).await); + } + sleep(Duration::from_secs(1)).await; + for stream in &batch { + assert_eq!(buffered(stream), STREAM_BUFFER, "the buffer is full"); + } + sleep(SEND_DEADLINE + Duration::from_secs(5)).await; + stalled.extend(batch); + for stream in &stalled { + assert_eq!(buffered(stream), 0, "a stalled stream keeps no messages"); + } + } + for mut stream in stalled { + let status = stream.next().await.unwrap().unwrap_err(); + assert_eq!(status.code(), tonic::Code::ResourceExhausted); + } +} + +#[tokio::test(start_paused = true)] +async fn should_hold_a_failed_streams_slot_until_its_buffer_is_read_or_discarded() { + let harness = harness(SubscriptionLimits { + max_subscriptions_per_source: 2, + ..Default::default() + }); + // A match, then a height this node cannot decode, which ends every scan. + harness.commit(vec![transfer_to(7)]); + harness.commit(vec![vec![0xff, 0x00, 0x13]]); + let source = Some(SourceKey::from("203.0.113.7".parse::().unwrap())); + let subscribe = || harness.subscribe_from(source); + + // Failed streams nobody reads keep their slots until the deadline, then lose their buffers. + let stalled = [subscribe().await.unwrap(), subscribe().await.unwrap()]; + sleep(Duration::from_secs(1)).await; + for stream in &stalled { + assert_eq!(buffered(stream), 3, "checkpoint, match, checkpoint"); + } + assert_eq!( + harness.service.admit(source).err().unwrap().code(), + tonic::Code::ResourceExhausted, + "a failed stream keeps its slot while its buffer may still be read" + ); + sleep(SEND_DEADLINE).await; + for stream in &stalled { + assert_eq!(buffered(stream), 0, "an unread buffer is discarded"); + } + for mut stream in stalled { + let status = stream.next().await.unwrap().unwrap_err(); + assert_eq!(status.code(), tonic::Code::FailedPrecondition); + } + + // A client that reads gets what was buffered, then the failure, then its slot back. + let mut readers = [subscribe().await.unwrap(), subscribe().await.unwrap()]; + for stream in &mut readers { + expect_checkpoint(stream, 0).await; + expect_match(stream, 1, &transfer_to(7)).await; + expect_checkpoint(stream, 1).await; + let status = stream.next().await.unwrap().unwrap_err(); + assert_eq!(status.code(), tonic::Code::FailedPrecondition); + assert!(stream.next().await.is_none(), "the status is the last item"); + } + assert!(subscribe().await.is_ok(), "the readers' slots are free"); +} + +#[tokio::test] +async fn should_start_a_live_subscription_below_a_tip_whose_results_are_not_saved() { + let harness = harness(SubscriptionLimits::default()); + // Stored but not published: the tip watch is still 0. + harness.chain.push(vec![]); + let withheld = harness.chain.push(vec![transfer_to(7)]); + *harness.chain.results_withheld.lock().unwrap() = Some(withheld); + let mut stream = harness.subscribe(7, None).await; + expect_checkpoint(&mut stream, withheld - 1).await; + + *harness.chain.results_withheld.lock().unwrap() = None; + harness.tip.send_replace(withheld); + expect_match(&mut stream, withheld, &transfer_to(7)).await; + expect_checkpoint(&mut stream, withheld).await; +} + +#[tokio::test(start_paused = true)] +async fn should_not_pin_decoded_blocks_while_waiting_on_a_stalled_reader() { + let harness = harness(SubscriptionLimits::default()); + // Several matches a block, many blocks: far more than the stream buffer holds. + for _ in 0..40 { + harness.commit(vec![transfer_to(7), transfer_to(7), transfer_to(7)]); + } + let _stalled = harness.subscribe(7, Some(1)).await; + // On paused time this returns only once the scan is blocked on the full buffer. + sleep(Duration::from_secs(1)).await; + + for height in 1..=40 { + let block = harness.blocks.read(height).await.unwrap(); + // Held by the cache and by this test only, never by the stalled scan. + assert!( + Arc::strong_count(&block) <= 2, + "block {height} is pinned by {} owners", + Arc::strong_count(&block) + ); + } +} + +#[tokio::test(start_paused = true)] +async fn should_free_the_slots_of_dropped_streams_whose_reads_are_queued() { + let harness = harness(SubscriptionLimits { + max_subscriptions: 4, + ..Default::default() + }); + for _ in 0..25 { + harness.commit(vec![transfer_to(7)]); + } + // Heights 1-20 have their metas cached; 21-25 do not. + harness.blocks.meta_page(1, 25).await.unwrap(); + // Every fetch permit is taken by a read held at the gate. + let gate = harness.chain.read_gate.lock().await; + let held: Vec<_> = (1..=MAX_CONCURRENT_FETCHES as u64) + .map(|height| { + let blocks = harness.blocks.clone(); + tokio::spawn(async move { blocks.read(height).await }) + }) + .collect(); + sleep(Duration::from_secs(1)).await; + + // Two scans queue for block 9, two for the metas of 21-25. + let mut streams = Vec::new(); + for from in [9, 9, 21, 21] { + streams.push(harness.subscribe(7, Some(from)).await); + } + sleep(Duration::from_secs(1)).await; + assert!(harness.service.admit(None).is_err(), "every slot is taken"); + + drop(streams); + sleep(Duration::from_secs(1)).await; + let admissions: Vec<_> = (0..4).map(|_| harness.service.admit(None)).collect(); + assert!( + admissions.iter().all(Result::is_ok), + "dropped streams free their slots while their reads are queued" + ); + assert_eq!(harness.chain.block_reads.load(Ordering::SeqCst), 0); + + drop(gate); + for read in held { + read.await.unwrap().unwrap(); + } + sleep(Duration::from_secs(1)).await; + assert_eq!( + harness.chain.block_reads.load(Ordering::SeqCst), + MAX_CONCURRENT_FETCHES, + "no read runs for a dropped stream" + ); +} + +#[tokio::test] +async fn should_bound_concurrent_tenderdash_fetches() { + let harness = harness(SubscriptionLimits::default()); + for _ in 0..MAX_CONCURRENT_FETCHES * 3 { + harness.commit(vec![transfer_to(7)]); + } + let tip = harness.chain.blocks.lock().unwrap().len() as u64; + // Block reads, readiness probes and metas pages all share the budget. + let reads = (1..=tip).map(|height| harness.blocks.read(height).map(|read| read.map(drop))); + let probes = (1..=tip).map(|height| harness.blocks.results_saved(height).boxed()); + let tips = (1..=tip).map(|_| { + harness + .blocks + .latest_height() + .map(|tip| tip.map(drop)) + .boxed() + }); + let pages = (1..=tip).step_by(20).map(|height| { + harness + .blocks + .meta_page(height, tip) + .map(|page| page.map(drop)) + .boxed() + }); + let calls = reads + .map(|read| read.boxed()) + .chain(probes) + .chain(tips) + .chain(pages); + for call in futures::future::join_all(calls).await { + call.unwrap(); + } + assert_eq!( + harness.chain.max_reads_in_flight.load(Ordering::SeqCst), + MAX_CONCURRENT_FETCHES + ); +} + +#[tokio::test(start_paused = true)] +async fn should_publish_a_tip_only_once_its_results_are_saved() { + let chain = Arc::new(FakeChain::default()); + chain.push(vec![]); + let withheld = chain.push(vec![transfer_to(7)]); + *chain.results_withheld.lock().unwrap() = Some(withheld); + let (tip, mut tip_receiver) = watch::channel(0); + let (events, new_blocks) = broadcast::channel(4); + tokio::spawn(SubscriptionService::track_tip( + Arc::new(BlockSource::new(chain.clone())), + tip, + new_blocks, + )); + + sleep(Duration::from_secs(1)).await; + assert_eq!( + *tip_receiver.borrow_and_update(), + withheld - 1, + "height 2 has no results yet; the height before it does" + ); + + // A new-block event publishes it as soon as its results are saved. + *chain.results_withheld.lock().unwrap() = None; + events.send(()).unwrap(); + timeout(Duration::from_secs(1), tip_receiver.changed()) + .await + .unwrap() + .unwrap(); + assert_eq!(*tip_receiver.borrow_and_update(), withheld); + + // Blocks faster than their results: each event still advances the tip to the height + // before the newest. + for _ in 0..3 { + chain.push(vec![]); + let newest = chain.push(vec![]); + *chain.results_withheld.lock().unwrap() = Some(newest); + events.send(()).unwrap(); + timeout(Duration::from_secs(1), tip_receiver.changed()) + .await + .unwrap() + .unwrap(); + assert_eq!(*tip_receiver.borrow_and_update(), newest - 1); + } + + // Without events, the poll still advances the tip. + *chain.results_withheld.lock().unwrap() = None; + drop(events); + sleep(Duration::from_secs(1)).await; + tip_receiver.borrow_and_update(); + let height = chain.push(vec![]); + timeout(TIP_POLL_INTERVAL * 2, tip_receiver.changed()) + .await + .unwrap() + .unwrap(); + assert_eq!(*tip_receiver.borrow(), height); +} + +#[tokio::test] +async fn should_keep_a_two_mib_block_cached() { + let harness = harness(SubscriptionLimits::default()); + let height = harness.commit(vec![vec![0u8; 1024]; 2048]); + let reads = || harness.chain.block_reads.load(Ordering::SeqCst); + + harness.blocks.read(height).await.unwrap(); + assert_eq!(reads(), 1); + // Read again after the first load completed: served from the cache. + harness.blocks.read(height).await.unwrap(); + assert_eq!(reads(), 1, "the block was kept"); +} diff --git a/packages/rs-dapi/src/utils.rs b/packages/rs-dapi/src/utils.rs index 6fa28c65e95..609f9be8caa 100644 --- a/packages/rs-dapi/src/utils.rs +++ b/packages/rs-dapi/src/utils.rs @@ -162,6 +162,15 @@ where } } +/// Deserialize `null` as the type's default; Tenderdash serializes empty lists as `null`. +pub fn deserialize_null_as_default<'de, D, T>(deserializer: D) -> Result +where + D: serde::Deserializer<'de>, + T: Default + Deserialize<'de>, +{ + Ok(Option::::deserialize(deserializer)?.unwrap_or_default()) +} + #[cfg(test)] mod tests { use super::*; diff --git a/packages/rs-drive-abci/src/query/service.rs b/packages/rs-drive-abci/src/query/service.rs index 36bb992a488..48be51ca0da 100644 --- a/packages/rs-drive-abci/src/query/service.rs +++ b/packages/rs-drive-abci/src/query/service.rs @@ -70,8 +70,10 @@ use dapi_grpc::platform::v0::{ GetTokenPreProgrammedDistributionsResponse, GetTokenStatusesRequest, GetTokenStatusesResponse, GetTokenTotalSupplyRequest, GetTokenTotalSupplyResponse, GetTotalCreditsInPlatformRequest, GetTotalCreditsInPlatformResponse, GetVotePollsByEndDateRequest, GetVotePollsByEndDateResponse, + SubscribeToStateTransitionsRequest, SubscribeToStateTransitionsResponse, WaitForStateTransitionResultRequest, WaitForStateTransitionResultResponse, }; +use dapi_grpc::tonic::codegen::BoxStream; use dapi_grpc::tonic::{Code, Request, Response, Status}; use dpp::version::PlatformVersion; use drive::error::Error as DriveError; @@ -271,6 +273,16 @@ fn respond_with_unimplemented(name: &str) -> Result, Status> { #[async_trait] impl PlatformService for QueryService { + // Served by DAPI from the Tenderdash block store, not by Drive. + type subscribeToStateTransitionsStream = BoxStream; + + async fn subscribe_to_state_transitions( + &self, + _request: Request, + ) -> Result, Status> { + respond_with_unimplemented("subscribe_to_state_transitions") + } + async fn broadcast_state_transition( &self, _request: Request, diff --git a/packages/rs-drive/src/query/filter.rs b/packages/rs-drive/src/query/filter.rs index 70b7ec352c1..99bfa190134 100644 --- a/packages/rs-drive/src/query/filter.rs +++ b/packages/rs-drive/src/query/filter.rs @@ -32,14 +32,16 @@ //! - `validate()` performs structural checks: confirms the document type exists for the //! contract, enforces action-specific composition rules (e.g., at least one non-empty //! clause where required), and validates operator/value compatibility for scalar clauses -//! like `owner_clause` and `price_clause`. +//! like `owner_clause` and `price_clause`. It refuses clause values not yet brought to the +//! form the schema stores (`canonicalize_clause_values()`), which matching compares as they are. use std::borrow::Cow; use std::collections::BTreeMap; +use std::ops::Deref; use dpp::data_contract::accessors::v0::DataContractV0Getters; use dpp::data_contract::document_type::accessors::DocumentTypeV0Getters; use dpp::data_contract::document_type::methods::DocumentTypeBasicMethods; -use dpp::data_contract::document_type::typed_array_property; +use dpp::data_contract::document_type::{DocumentPropertyType, DocumentTypeRef}; use dpp::data_contract::DataContract; use dpp::platform_value::Value; use dpp::state_transition::batch_transition::batched_transition::document_transition::DocumentTransitionV0Methods; @@ -66,9 +68,9 @@ use dpp::version::PlatformVersion; /// `validate()` performs structural checks (document type exists, clause composition rules). #[cfg(any(feature = "server", feature = "verify"))] #[derive(Debug, PartialEq, Clone)] -pub struct DriveDocumentQueryFilter<'a> { - /// DataContract - pub contract: &'a DataContract, +pub struct DriveDocumentQueryFilter { + /// The data contract: borrowed, or shared (`Arc`) by a filter that outlives one call. + pub contract: C, /// Document type name pub document_type_name: String, /// Action-specific clauses @@ -140,7 +142,7 @@ pub enum DocumentActionMatchClauses { }, } -impl DriveDocumentQueryFilter<'_> { +impl> DriveDocumentQueryFilter { /// Check a transition using only transition-level constraints. /// /// When to run: @@ -180,6 +182,10 @@ impl DriveDocumentQueryFilter<'_> { new_document_clauses, } = &self.action_clauses { + // No clause reads the document: skip building its stored form. + if new_document_clauses.is_empty() { + return TransitionCheckResult::Pass; + } let Some(data) = self.data_as_stored(create.data(), platform_version) else { return TransitionCheckResult::Fail; }; @@ -432,47 +438,9 @@ impl DriveDocumentQueryFilter<'_> { document_type.data_as_stored(data, platform_version).ok() } - /// Whether `clause` holds for the document's `value` of its field. A clause - /// reading the elements of a typed array (`contains`, `containsAny`) matches - /// an element that keys as one of its values does, as an indexed documents - /// query matches it: an identifier given as bytes or base58 text, or an - /// integer of another width, matches the stored element it keys like. Every - /// other clause compares values as before. - #[cfg(any(feature = "server", feature = "verify"))] - fn clause_matches(&self, clause: &WhereClause, value: &Value) -> bool { - if !clause.operator.reads_array_elements() { - return clause.matches_value(value); - } - let Some(document_type) = self - .contract - .document_type_optional_for_name(&self.document_type_name) - else { - return false; - }; - let Some(typed_array) = - typed_array_property(document_type.flattened_properties(), &clause.field) - else { - return false; - }; - let key = |value: &Value| typed_array.item_type.encode_value_for_tree_keys(value).ok(); - let wanted: Vec> = if clause.operator == WhereOperator::ContainsAny { - match clause.in_values().data { - Some(values) => values.iter().filter_map(key).collect(), - None => return false, - } - } else { - key(&clause.value).into_iter().collect() - }; - let Value::Array(elements) = value else { - return false; - }; - elements - .iter() - .filter_map(key) - .any(|element| wanted.contains(&element)) - } - - /// Single clause evaluator used by both transition and original-document paths. + /// Single clause evaluator used by both transition and original-document paths. Values of + /// schema properties are canonicalized first, as clause values were: a transition keeps its + /// submitter's encoding. #[cfg(any(feature = "server", feature = "verify"))] fn evaluate_clauses( &self, @@ -494,50 +462,78 @@ impl DriveDocumentQueryFilter<'_> { } } - // In clauses - for in_clause in &clauses.in_clauses { - let field_value = get_value_by_path(document_data, &in_clause.field); - if let Some(value) = field_value { - if !self.clause_matches(in_clause, value) { - return false; - } - } else { + let document_type = self + .contract + .document_type_optional_for_name(&self.document_type_name); + let properties = document_type + .as_ref() + .map(|document_type| document_type.flattened_properties()); + let field_matches = |clause: &WhereClause| { + let Some(value) = get_value_by_path(document_data, &clause.field) else { return false; - } - } - - // Range clause - if let Some(range_clause) = &clauses.range_clause { - let field_value = get_value_by_path(document_data, &range_clause.field); - if let Some(value) = field_value { - if !range_clause.matches_value(value) { - return false; - } - } else { + }; + // `Value` orders null after every number, so a null value would satisfy `> n`; an + // ordered comparison never matches null, while equality and IN still can. + if value.is_null() + && !matches!(clause.operator, WhereOperator::Equal | WhereOperator::In) + { return false; } - } - - // Equal clauses - for (field, equal_clause) in &clauses.equal_clauses { - let field_value = get_value_by_path(document_data, field); - if let Some(value) = field_value { - if !self.clause_matches(equal_clause, value) { - return false; - } - } else { - return false; + match properties.and_then(|properties| properties.get(&clause.field)) { + Some(property) => canonical_property_value(&property.property_type, value) + .is_some_and(|value| clause.matches_value(&value)), + None => clause.matches_value(value), } - } + }; - true + clauses.in_clauses.iter().all(field_matches) + && clauses.range_clause.iter().all(field_matches) + && clauses.equal_clauses.values().all(field_matches) } - /// Validate the filter structure and clauses. + /// Bring every clause value to the form the document type stores its field in, so matching + /// compares like with like. Call it before [`Self::validate`], which refuses other forms. + #[cfg(any(feature = "server", feature = "verify"))] + pub fn canonicalize_clause_values(&mut self) -> Result<(), QuerySyntaxError> { + let document_type = self + .contract + .document_type_optional_for_name(&self.document_type_name) + .ok_or(QuerySyntaxError::DocumentTypeNotFound( + "unknown document type", + ))?; + canonicalize_action_clauses(document_type, &mut self.action_clauses)?; + Ok(()) + } + + /// Validate the filter structure and clauses, whose values must already be canonical + /// ([`Self::canonicalize_clause_values`]): matching compares them as they are. /// /// In addition to these validations, the subscription host should check the contract's existence. #[cfg(any(feature = "server", feature = "verify"))] pub fn validate(&self) -> QuerySyntaxSimpleValidationResult { + let result = self.validate_structure(); + if !result.is_valid() { + return result; + } + let Some(document_type) = self + .contract + .document_type_optional_for_name(&self.document_type_name) + else { + return result; + }; + match canonicalize_action_clauses(document_type, &mut self.action_clauses.clone()) { + Ok(false) => result, + Ok(true) => QuerySyntaxSimpleValidationResult::new_with_error( + QuerySyntaxError::InvalidWhereClauseComponents( + "clause values must be canonical: call `canonicalize_clause_values()` first", + ), + ), + Err(error) => QuerySyntaxSimpleValidationResult::new_with_error(error), + } + } + + #[cfg(any(feature = "server", feature = "verify"))] + fn validate_structure(&self) -> QuerySyntaxSimpleValidationResult { // Ensure the document type exists let Some(document_type) = self .contract @@ -614,6 +610,18 @@ impl DriveDocumentQueryFilter<'_> { } } if let Some(price) = price_clause { + // IN candidates are bounded and distinct, like any IN clause's; checked after + // normalization, so the same price given in two encodings is a duplicate. + if price.operator == WhereOperator::In { + let candidates = WhereClause { + field: "$price".to_string(), + operator: WhereOperator::In, + value: price.value.clone(), + }; + if let Some(error) = candidates.in_values().errors.into_iter().next() { + return QuerySyntaxSimpleValidationResult::new_with_error(error); + } + } let ok = match price.operator { WhereOperator::Equal | WhereOperator::GreaterThan @@ -690,6 +698,258 @@ impl DriveDocumentQueryFilter<'_> { } } +/// Canonicalize every operand of `action_clauses` as [`canonicalize_where_clause`] does; whether +/// any operand changed. +#[cfg(any(feature = "server", feature = "verify"))] +fn canonicalize_action_clauses( + document_type: DocumentTypeRef, + action_clauses: &mut DocumentActionMatchClauses, +) -> Result { + // The recipient or buyer is an identifier, the price a `u64`. + let (clause_sets, scalar_clause): (Vec<&mut InternalClauses>, _) = match action_clauses { + DocumentActionMatchClauses::Create { + new_document_clauses, + } => (vec![new_document_clauses], None), + DocumentActionMatchClauses::Replace { + original_document_clauses, + new_document_clauses, + } => (vec![original_document_clauses, new_document_clauses], None), + DocumentActionMatchClauses::Delete { + original_document_clauses, + } => (vec![original_document_clauses], None), + DocumentActionMatchClauses::Transfer { + original_document_clauses, + owner_clause, + } + | DocumentActionMatchClauses::Purchase { + original_document_clauses, + owner_clause, + } => ( + vec![original_document_clauses], + owner_clause + .as_mut() + .map(|clause| ("$ownerId", &IDENTIFIER_PROPERTY, clause)), + ), + DocumentActionMatchClauses::UpdatePrice { + original_document_clauses, + price_clause, + } => ( + vec![original_document_clauses], + price_clause + .as_mut() + .map(|clause| ("$price", &DocumentPropertyType::U64, clause)), + ), + }; + let mut changed = false; + for clauses in clause_sets { + let InternalClauses { + primary_key_in_clause, + primary_key_equal_clause, + in_clauses, + range_clause, + equal_clauses, + } = clauses; + for clause in primary_key_in_clause + .iter_mut() + .chain(primary_key_equal_clause.iter_mut()) + .chain(in_clauses.iter_mut()) + .chain(range_clause.iter_mut()) + .chain(equal_clauses.values_mut()) + { + let before = clause.value.clone(); + canonicalize_where_clause(document_type, clause)?; + changed |= !same_value(&before, &clause.value); + } + } + if let Some((field, property_type, clause)) = scalar_clause { + let canonical = canonical_operand(field, clause.operator, &clause.value, |value| { + canonical_property_value(property_type, value) + })?; + changed |= !same_value(&clause.value, &canonical); + clause.value = canonical; + } + Ok(changed) +} + +/// `Value` equality, except that a NaN equals itself, so a canonical NaN operand stays canonical. +#[cfg(any(feature = "server", feature = "verify"))] +fn same_value(a: &Value, b: &Value) -> bool { + match (a, b) { + (Value::Float(a), Value::Float(b)) => a.to_bits() == b.to_bits(), + (Value::Array(a), Value::Array(b)) => { + a.len() == b.len() && a.iter().zip(b).all(|(a, b)| same_value(a, b)) + } + _ => a == b, + } +} + +/// The type a filter reads `$id` and the transfer recipient or buyer as. +#[cfg(any(feature = "server", feature = "verify"))] +static IDENTIFIER_PROPERTY: DocumentPropertyType = DocumentPropertyType::Identifier; + +/// The longest base58 text of a 32-byte identifier. +#[cfg(any(feature = "server", feature = "verify"))] +const MAX_BASE58_IDENTIFIER_LEN: usize = 44; + +/// Bring a where clause's operand to the form `document_type` stores its field in, refusing a +/// field that is neither one of its properties nor `$id`. +#[cfg(any(feature = "server", feature = "verify"))] +pub fn canonicalize_where_clause( + document_type: DocumentTypeRef, + clause: &mut WhereClause, +) -> Result<(), QuerySyntaxError> { + let property_type = match document_type.flattened_properties().get(&clause.field) { + Some(property) => &property.property_type, + None if clause.field == "$id" => &IDENTIFIER_PROPERTY, + // Nothing else is in a transition's data; refused before a codec decodes the operand. + None => { + return Err(QuerySyntaxError::InvalidWhereClauseComponents( + "filter clauses may only name document properties and `$id`", + )) + } + }; + // A typed array is read by its elements: `contains` names one as an equality does, + // `containsAny` several as an `IN` does. A misused element operator is left for `validate`. + let (operator, property_type) = match property_type { + DocumentPropertyType::TypedArray(typed_array) if clause.operator.reads_array_elements() => { + ( + clause.operator.as_key_operator(), + typed_array.item_type.as_ref(), + ) + } + DocumentPropertyType::TypedArray(_) => return Ok(()), + _ if clause.operator.reads_array_elements() => return Ok(()), + property_type => (clause.operator, property_type), + }; + // IN candidates packed as bytes are `u8`s: kept packed for a `u8` (`validate` refuses them + // on any other scalar field), listed for wider typed-array elements to canonicalize. + if let (WhereOperator::In, Value::Bytes(bytes)) = (operator, &clause.value) { + if matches!(property_type, DocumentPropertyType::U8) + || !clause.operator.reads_array_elements() + { + return Ok(()); + } + clause.value = Value::Array(bytes.iter().copied().map(Value::U8).collect()); + } + clause.value = canonical_operand(&clause.field, operator, &clause.value, |value| { + canonical_property_value(property_type, value) + })?; + Ok(()) +} + +/// `value` as a property of `property_type` stores it, so every accepted encoding of one value +/// compares equal: through the index-key codec, except where that form would lose what a +/// comparison needs. `None` when the value does not encode as the type. +#[cfg(any(feature = "server", feature = "verify"))] +fn canonical_property_value(property_type: &DocumentPropertyType, value: &Value) -> Option { + if value.is_null() { + return Some(Value::Null); + } + match property_type { + // The index-key form conflates `""` with `"\0"`. + DocumentPropertyType::String(_) => matches!(value, Value::Text(_)).then(|| value.clone()), + // The index-key form turns -0.0 into NaN. + DocumentPropertyType::F64 => value.to_float().ok().map(Value::Float), + // The index-key form of an empty byte array decodes as null. + DocumentPropertyType::ByteArray(_) => match value { + Value::Array(_) => byte_list(value).map(Value::Bytes), + _ => value.to_binary_bytes().ok().map(Value::Bytes), + }, + // Refused before the codec reports them: its error message formats the value, which + // can panic on text. + DocumentPropertyType::U128 + | DocumentPropertyType::I128 + | DocumentPropertyType::U64 + | DocumentPropertyType::I64 + | DocumentPropertyType::U32 + | DocumentPropertyType::I32 + | DocumentPropertyType::U16 + | DocumentPropertyType::I16 + | DocumentPropertyType::U8 + | DocumentPropertyType::I8 + | DocumentPropertyType::Date + | DocumentPropertyType::KeyIdWithReference(_) + if !value.is_integer() => + { + None + } + DocumentPropertyType::Boolean if !matches!(value, Value::Bool(_)) => None, + // Base58 decoding takes time quadratic in its (unauthenticated) input. + DocumentPropertyType::Identifier | DocumentPropertyType::IdentifierWithReference(_) if matches!(value, Value::Text(text) if text.len() > MAX_BASE58_IDENTIFIER_LEN) => { + None + } + // Read as bytes, so a list of bytes is accepted whatever width its integers came in. + DocumentPropertyType::Identifier | DocumentPropertyType::IdentifierWithReference(_) + if matches!(value, Value::Array(_)) => + { + canonical_property_value(property_type, &Value::Bytes(byte_list(value)?)) + } + // Compared by its elements; one that does not encode as the element type is skipped, + // as no index keys it. + DocumentPropertyType::TypedArray(typed_array) => match value { + Value::Array(elements) => Some(Value::Array( + elements + .iter() + .filter_map(|element| canonical_property_value(&typed_array.item_type, element)) + .collect(), + )), + _ => None, + }, + _ => property_type + .encode_value_for_tree_keys(value) + .and_then(|key| property_type.decode_value_for_tree_keys(&key)) + .ok(), + } +} + +/// A list of integers that each fit in a byte, as those bytes: a list of bytes may come as +/// wider integers, as every integer does over the wire. `None` for anything else. +#[cfg(any(feature = "server", feature = "verify"))] +fn byte_list(value: &Value) -> Option> { + value + .as_slice() + .ok()? + .iter() + .map(|element| { + element + .is_integer() + .then(|| element.to_integer::().ok()) + .flatten() + }) + .collect() +} + +/// Canonicalize a clause operand with `canonical`: element-wise for the list operands of +/// `IN` and `BETWEEN*`, directly otherwise. +#[cfg(any(feature = "server", feature = "verify"))] +fn canonical_operand( + field: &str, + operator: WhereOperator, + operand: &Value, + canonical: impl Fn(&Value) -> Option, +) -> Result { + let convert = |value: &Value| { + canonical(value).ok_or_else(|| { + QuerySyntaxError::InvalidFormatWhereClause(format!( + "a where clause value on '{field}' does not match the field's type" + )) + }) + }; + match (operator, operand) { + ( + WhereOperator::In + | WhereOperator::Between + | WhereOperator::BetweenExcludeBounds + | WhereOperator::BetweenExcludeLeft + | WhereOperator::BetweenExcludeRight, + Value::Array(values), + ) => Ok(Value::Array( + values.iter().map(convert).collect::>()?, + )), + _ => convert(operand), + } +} + /// Resolve a dot-notated path into a nested `BTreeMap` payload. /// /// Supports dot notation like `meta.status` by walking `Value::Map` entries @@ -2211,6 +2471,31 @@ mod tests { assert!(filter.validate().is_valid()); } + #[test] + fn should_refuse_duplicate_price_in_candidates_once_normalized() { + let fixture = get_data_contract_fixture(None, 0, LATEST_PLATFORM_VERSION.protocol_version); + let contract = fixture.data_contract_owned(); + let price_in = |values: Vec| DriveDocumentQueryFilter { + contract: &contract, + document_type_name: "niceDocument".to_string(), + action_clauses: DocumentActionMatchClauses::UpdatePrice { + original_document_clauses: InternalClauses::default(), + price_clause: Some(ValueClause { + operator: WhereOperator::In, + value: Value::Array(values), + }), + }, + }; + assert!(price_in(vec![Value::U64(1), Value::U64(1)]) + .validate() + .is_err()); + assert!(price_in(vec![Value::U64(1); 101]).validate().is_err()); + // The same price in two encodings is a duplicate once normalized. + let mut mixed = price_in(vec![Value::I64(1), Value::U64(1)]); + mixed.canonicalize_clause_values().expect("both are prices"); + assert!(mixed.validate().is_err()); + } + #[test] fn validate_price_clause_in_with_non_integer_is_invalid() { let fixture = get_data_contract_fixture(None, 0, LATEST_PLATFORM_VERSION.protocol_version); @@ -2973,6 +3258,372 @@ mod tests { assert!(filter.validate().is_err()); } + mod canonical_values { + use super::*; + use dpp::data_contract::DataContractFactory; + use dpp::platform_value::platform_value; + use dpp::platform_value::string_encoding::Encoding; + use dpp::state_transition::batch_transition::batched_transition::document_create_transition::v0::DocumentCreateTransitionV0; + use dpp::state_transition::batch_transition::batched_transition::document_create_transition::DocumentCreateTransition; + use dpp::state_transition::batch_transition::batched_transition::document_transfer_transition::v0::DocumentTransferTransitionV0; + use dpp::state_transition::batch_transition::batched_transition::document_transfer_transition::DocumentTransferTransition; + + fn fixture_contract() -> DataContract { + get_data_contract_fixture(None, 0, LATEST_PLATFORM_VERSION.protocol_version) + .data_contract_owned() + } + + /// A contract with one document type, `rating`, of a u8 `stars` and a float `value`. + fn rating_contract() -> DataContract { + let documents = platform_value!({ + "rating": { + "type": "object", + "properties": { + "stars": { "type": "integer", "minimum": 0, "maximum": 255, "position": 0 }, + "value": { "type": "number", "position": 1 } + }, + "additionalProperties": false + } + }); + DataContractFactory::new(PlatformVersion::latest().protocol_version) + .expect("factory") + .create_with_value_config(Identifier::from([1u8; 32]), 1, documents, None, None) + .expect("the contract parses") + .data_contract_owned() + } + + fn base(contract: &DataContract, document_type_name: &str) -> DocumentBaseTransition { + DocumentBaseTransition::V1(DocumentBaseTransitionV1 { + id: Identifier::from([3u8; 32]), + document_type_name: document_type_name.to_string(), + data_contract_id: contract.id(), + identity_contract_nonce: 0, + token_payment_info: None, + }) + } + + fn create( + contract: &DataContract, + document_type_name: &str, + field: &str, + value: Value, + ) -> DocumentTransition { + DocumentTransition::Create(DocumentCreateTransition::V0(DocumentCreateTransitionV0 { + base: base(contract, document_type_name), + entropy: [0u8; 32], + data: BTreeMap::from([(field.to_string(), value)]), + prefunded_voting_balance: None, + })) + } + + /// The one clause, placed where `InternalClauses` keeps its operator. + fn clauses(field: &str, operator: WhereOperator, value: Value) -> InternalClauses { + let clause = WhereClause { + field: field.to_string(), + operator, + value, + }; + let mut clauses = InternalClauses::default(); + match operator { + WhereOperator::Equal if field == "$id" => { + clauses.primary_key_equal_clause = Some(clause) + } + WhereOperator::Equal => { + clauses.equal_clauses.insert(field.to_string(), clause); + } + WhereOperator::In => clauses.in_clauses.push(clause), + _ => clauses.range_clause = Some(clause), + } + clauses + } + + /// A filter on creates of `document_type_name` with one clause, canonicalized. + fn create_filter<'a>( + contract: &'a DataContract, + document_type_name: &str, + clause: (&str, WhereOperator, Value), + ) -> Result, QuerySyntaxError> { + let mut filter = DriveDocumentQueryFilter { + contract, + document_type_name: document_type_name.to_string(), + action_clauses: DocumentActionMatchClauses::Create { + new_document_clauses: clauses(clause.0, clause.1, clause.2), + }, + }; + filter.canonicalize_clause_values()?; + Ok(filter) + } + + fn passes( + filter: &DriveDocumentQueryFilter<&DataContract>, + transition: &DocumentTransition, + ) -> bool { + filter.matches_document_transition(transition, None, PlatformVersion::latest()) + == TransitionCheckResult::Pass + } + + #[test] + fn should_match_an_identifier_encoded_differently_in_clause_and_transition() { + let contract = fixture_contract(); + let identifier = Identifier::from([7u8; 32]); + for clause_value in [ + Value::Text(identifier.to_string(Encoding::Base58)), + Value::Bytes(identifier.to_vec()), + Value::Identifier(identifier.to_buffer()), + ] { + let filter = create_filter( + &contract, + "withByteArrays", + ("identifierField", WhereOperator::Equal, clause_value), + ) + .expect("an identifier"); + assert!(filter.validate().is_valid()); + let carrying = + |value| create(&contract, "withByteArrays", "identifierField", value); + assert!(passes( + &filter, + &carrying(Value::Bytes(identifier.to_vec())) + )); + assert!(passes(&filter, &carrying(identifier.into()))); + assert!(!passes(&filter, &carrying(Value::Bytes(vec![8u8; 32])))); + } + } + + #[test] + fn should_compare_integers_of_any_width_by_value() { + let contract = rating_contract(); + let filter = create_filter( + &contract, + "rating", + ( + "stars", + WhereOperator::In, + Value::Array(vec![Value::I64(4), Value::U16(5)]), + ), + ) + .expect("integers that fit a u8"); + assert!(filter.validate().is_valid()); + let rated = |stars| create(&contract, "rating", "stars", stars); + assert!(passes(&filter, &rated(Value::U64(5)))); + assert!(passes(&filter, &rated(Value::I32(4)))); + assert!(!passes(&filter, &rated(Value::U8(3)))); + } + + #[test] + fn should_match_a_value_longer_than_an_index_key() { + let contract = fixture_contract(); + let long_name = Value::Text("x".repeat(300)); + let filter = create_filter( + &contract, + "niceDocument", + ("name", WhereOperator::Equal, long_name.clone()), + ) + .expect("text"); + assert!(passes( + &filter, + &create(&contract, "niceDocument", "name", long_name) + )); + } + + #[test] + fn should_reject_a_value_that_does_not_fit_its_field() { + let contract = fixture_contract(); + for (field, value) in [ + ("identifierField", Value::Bytes(vec![1u8; 5])), + // Base58 text longer than any identifier's is refused before it is decoded. + ("identifierField", Value::Text("z".repeat(120_000))), + ("$id", Value::Text("z".repeat(120_000))), + ] { + assert!( + create_filter( + &contract, + "withByteArrays", + (field, WhereOperator::Equal, value) + ) + .is_err(), + "{field}" + ); + } + } + + #[test] + fn should_reject_clauses_on_fields_a_transition_does_not_carry() { + let contract = fixture_contract(); + let owner: Value = Identifier::from([1u8; 32]).into(); + // `$id` aside, system fields are not in a transition's data, nor is a derived index + // property; the latter is refused before a hostile operand is decoded. + for (field, value) in [ + ("$ownerId", owner.clone()), + ("$createdAt", Value::U64(1)), + ("postId.$ownerId", Value::Text("z".repeat(120_000))), + ] { + assert!( + create_filter( + &contract, + "niceDocument", + (field, WhereOperator::Equal, value) + ) + .is_err(), + "{field}" + ); + } + } + + #[test] + fn should_match_a_transfer_recipient_given_as_bytes() { + let contract = fixture_contract(); + let recipient = Identifier::from([9u8; 32]); + let mut filter = DriveDocumentQueryFilter { + contract: &contract, + document_type_name: "niceDocument".to_string(), + action_clauses: DocumentActionMatchClauses::Transfer { + original_document_clauses: InternalClauses::default(), + owner_clause: Some(ValueClause { + operator: WhereOperator::In, + value: Value::Array(vec![Value::Bytes(recipient.to_vec())]), + }), + }, + }; + filter + .canonicalize_clause_values() + .expect("expected the recipient to canonicalize"); + assert!(filter.validate().is_valid()); + let transfer = DocumentTransition::Transfer(DocumentTransferTransition::V0( + DocumentTransferTransitionV0 { + base: base(&contract, "niceDocument"), + revision: 2, + recipient_owner_id: recipient, + }, + )); + assert!(passes(&filter, &transfer)); + } + + #[test] + fn should_keep_empty_byte_array_operands() { + let contract = fixture_contract(); + for (operator, value) in [ + (WhereOperator::Equal, Value::Bytes(vec![])), + ( + WhereOperator::In, + Value::Array(vec![Value::Bytes(vec![]), Value::Bytes(vec![1])]), + ), + ] { + let filter = create_filter( + &contract, + "withByteArrays", + ("byteArrayField", operator, value), + ) + .expect("an empty byte array is a byte array"); + assert!(filter.validate().is_valid(), "{operator:?}"); + let transition = create( + &contract, + "withByteArrays", + "byteArrayField", + Value::Bytes(vec![]), + ); + assert!(passes(&filter, &transition), "{operator:?}"); + } + } + + #[test] + fn should_tell_empty_text_from_a_nul_character() { + let contract = fixture_contract(); + let named = |text: &str| { + create( + &contract, + "niceDocument", + "name", + Value::Text(text.to_string()), + ) + }; + let empty = create_filter( + &contract, + "niceDocument", + ("name", WhereOperator::Equal, Value::Text(String::new())), + ) + .expect("text"); + assert!(passes(&empty, &named(""))); + assert!(!passes(&empty, &named("\0"))); + + let both = create_filter( + &contract, + "niceDocument", + ( + "name", + WhereOperator::In, + Value::Array(vec![ + Value::Text(String::new()), + Value::Text("\0".to_string()), + ]), + ), + ) + .expect("text"); + assert!(both.validate().is_valid(), "two distinct candidates"); + } + + #[test] + fn should_accept_packed_byte_candidates_only_for_a_u8_field() { + let contract = rating_contract(); + let filter = create_filter( + &contract, + "rating", + ("stars", WhereOperator::In, Value::Bytes(vec![4, 5])), + ) + .expect("packed u8 candidates"); + assert!(filter.validate().is_valid()); + let rated = |stars| create(&contract, "rating", "stars", Value::U64(stars)); + assert!(passes(&filter, &rated(5))); + assert!(!passes(&filter, &rated(3))); + let on_a_float = create_filter( + &contract, + "rating", + ("value", WhereOperator::In, Value::Bytes(vec![4, 5])), + ) + .expect("left for validation"); + assert!(!on_a_float.validate().is_valid()); + } + + #[test] + fn should_not_let_null_satisfy_an_ordered_comparison() { + let contract = rating_contract(); + let filter = create_filter( + &contract, + "rating", + ("stars", WhereOperator::GreaterThan, Value::U64(3)), + ) + .expect("an integer"); + let rated = |stars| create(&contract, "rating", "stars", stars); + assert!(!passes(&filter, &rated(Value::Null))); + assert!(passes(&filter, &rated(Value::U64(5)))); + } + + #[test] + fn should_compare_negative_zero_as_zero() { + let contract = rating_contract(); + for (operator, operand, value, expected) in [ + (WhereOperator::Equal, 0.0, -0.0, true), + (WhereOperator::Equal, -0.0, 0.0, true), + (WhereOperator::GreaterThan, -1.0, -0.0, true), + (WhereOperator::LessThan, -1.0, -0.0, false), + ] { + let filter = create_filter( + &contract, + "rating", + ("value", operator, Value::Float(operand)), + ) + .expect("a float"); + assert_eq!( + passes( + &filter, + &create(&contract, "rating", "value", Value::Float(value)) + ), + expected, + "{operator:?} {operand} against {value}" + ); + } + } + } + /// A filter reads a typed array by its elements as a documents query does /// (protocol version 14): with the same operators, judging the same values. mod typed_array_elements { @@ -3016,6 +3667,11 @@ mod tests { "contentMediaType": "application/x.dash.dpp.identifier" }, "position": 5 + }, + "ranks": { + "type": "array", "maxItems": 8, + "items": {"type": "integer", "minimum": 0, "maximum": 65535}, + "position": 6 } }, "additionalProperties": false @@ -3051,7 +3707,7 @@ mod tests { fn create_filter( contract: &DataContract, clause: WhereClause, - ) -> DriveDocumentQueryFilter<'_> { + ) -> DriveDocumentQueryFilter<&DataContract> { DriveDocumentQueryFilter { contract, document_type_name: "post".to_string(), @@ -3093,7 +3749,11 @@ mod tests { clause: WhereClause, document_data: BTreeMap, ) -> bool { - let filter = create_filter(contract, clause); + let mut filter = create_filter(contract, clause); + // As a subscription host does, before the filter is judged or matched. + filter + .canonicalize_clause_values() + .expect("canonical clause values"); let DocumentActionMatchClauses::Create { new_document_clauses, } = &filter.action_clauses @@ -3165,6 +3825,27 @@ mod tests { assert!(!matches(&contract, any_score, unscored)); } + #[test] + fn should_match_a_u16_array_against_a_list_given_as_bytes() { + let contract = element_contract(); + let any_rank = clause( + "ranks", + WhereOperator::ContainsAny, + Value::Bytes(vec![1, 2]), + ); + assert_eq!(query_refusal(&contract, &any_rank), None); + // The bytes are listed as u16 elements first. + let mut filter = create_filter(&contract, any_rank.clone()); + filter + .canonicalize_clause_values() + .expect("canonical clause values"); + assert!(filter.validate().is_valid()); + let ranked = post_data("ranks", Value::Array(vec![Value::U16(1), Value::U16(500)])); + let unranked = post_data("ranks", Value::Array(vec![Value::U16(3)])); + assert!(matches(&contract, any_rank.clone(), ranked)); + assert!(!matches(&contract, any_rank, unranked)); + } + #[test] fn should_match_an_element_given_in_another_representation() { let contract = element_contract(); @@ -3219,6 +3900,160 @@ mod tests { } } + /// The value of the one clause of a created-posts filter once its values are + /// canonicalized. + fn canonical_clause_value(contract: &DataContract, clause: WhereClause) -> Value { + let mut filter = create_filter(contract, clause); + filter + .canonicalize_clause_values() + .expect("canonical clause values"); + let DocumentActionMatchClauses::Create { + new_document_clauses, + } = filter.action_clauses + else { + unreachable!("a create filter"); + }; + new_document_clauses + .equal_clauses + .into_values() + .chain(new_document_clauses.in_clauses) + .next() + .expect("one clause") + .value + } + + #[test] + fn should_canonicalize_element_values_on_both_sides_of_the_match() { + let contract = element_contract(); + let author = [8u8; 32]; + // A clause value is brought to the element type's form once, element by element. + assert_eq!( + canonical_clause_value( + &contract, + clause( + "authors", + WhereOperator::Contains, + Value::Bytes(author.to_vec()) + ) + ), + Value::Identifier(author) + ); + assert_eq!( + canonical_clause_value( + &contract, + clause( + "scores", + WhereOperator::ContainsAny, + Value::Array(vec![Value::U64(5), Value::I16(1)]) + ) + ), + Value::Array(vec![Value::U8(5), Value::U8(1)]) + ); + // A transition's elements keep the encoding their submitter chose, and are + // brought to the same form when matched. + let authored_as_bytes = post_data( + "authors", + Value::Array(vec![ + Value::Bytes([9; 32].to_vec()), + Value::Bytes(author.to_vec()), + ]), + ); + for given in [Value::Identifier(author), Value::Bytes(author.to_vec())] { + assert!( + matches( + &contract, + clause("authors", WhereOperator::Contains, given.clone()), + authored_as_bytes.clone() + ), + "{given:?}" + ); + } + assert!(!matches( + &contract, + clause( + "authors", + WhereOperator::Contains, + Value::Identifier([7; 32]) + ), + authored_as_bytes + )); + let scored_as_u64 = post_data("scores", Value::Array(vec![Value::U64(5)])); + assert!(matches( + &contract, + clause( + "scores", + WhereOperator::ContainsAny, + Value::Array(vec![Value::I64(5)]) + ), + scored_as_u64.clone() + )); + assert!(matches( + &contract, + clause("scores", WhereOperator::ContainsAny, Value::Bytes(vec![5])), + scored_as_u64 + )); + } + + #[test] + fn should_refuse_an_operand_not_yet_canonicalized_until_it_is() { + let contract = element_contract(); + let by_author = clause( + "authors", + WhereOperator::Contains, + Value::Bytes(vec![7u8; 32]), + ); + // Matching compares operands as they are: these bytes never equal an identifier. + let refusal = filter_refusal(&contract, by_author.clone()).expect("not canonical"); + assert!(refusal.contains("canonicalize_clause_values"), "{refusal}"); + + let mut filter = create_filter(&contract, by_author.clone()); + filter + .canonicalize_clause_values() + .expect("canonical clause values"); + assert!(filter.validate().is_valid()); + let authored = post_data("authors", Value::Array(vec![Value::Identifier([7u8; 32])])); + assert!(matches(&contract, by_author, authored)); + } + + #[test] + fn should_refuse_an_element_value_that_does_not_fit_the_element_type() { + let contract = element_contract(); + let mut filter = create_filter( + &contract, + clause( + "authors", + WhereOperator::Contains, + Value::Bytes(vec![1u8; 5]), + ), + ); + assert!(matches!( + filter.canonicalize_clause_values(), + Err(QuerySyntaxError::InvalidFormatWhereClause(_)) + )); + } + + #[test] + fn should_leave_a_misused_element_operator_for_validation_to_refuse() { + let contract = element_contract(); + for refused in [ + clause("hashtags", WhereOperator::Equal, Value::Text("dash".into())), + clause( + "language", + WhereOperator::Contains, + Value::Text("en".into()), + ), + ] { + let mut filter = create_filter(&contract, refused.clone()); + filter + .canonicalize_clause_values() + .expect("left for validation"); + assert_eq!( + filter.validate().first_error().map(ToString::to_string), + query_refusal(&contract, &refused) + ); + } + } + #[test] fn should_refuse_what_documents_queries_refuse_with_the_same_error() { let contract = element_contract(); diff --git a/packages/rs-sdk/Cargo.toml b/packages/rs-sdk/Cargo.toml index 9a6d98b6622..8a36357ee57 100644 --- a/packages/rs-sdk/Cargo.toml +++ b/packages/rs-sdk/Cargo.toml @@ -63,7 +63,8 @@ platform-version = { path = "../rs-platform-version", features = [ rs-dapi-client = { path = "../rs-dapi-client" } drive-proof-verifier = { path = "../rs-drive-proof-verifier" } rs-sdk-trusted-context-provider = { path = "../rs-sdk-trusted-context-provider" } -tokio = { version = "1.40", features = ["macros", "rt-multi-thread"] } +# `test-util`: paused time in the subscription tests. +tokio = { version = "1.40", features = ["macros", "rt-multi-thread", "test-util"] } base64 = { version = "0.22.1" } tracing-subscriber = { version = "0.3.22", features = ["env-filter", "registry"] } dpp = { path = "../rs-dpp", default-features = false, features = [ diff --git a/packages/rs-sdk/src/platform.rs b/packages/rs-sdk/src/platform.rs index 3090558060a..b43058d1094 100644 --- a/packages/rs-sdk/src/platform.rs +++ b/packages/rs-sdk/src/platform.rs @@ -29,6 +29,7 @@ pub mod query; pub mod query_settings; #[cfg(feature = "shielded")] pub mod shielded; +pub mod subscriptions; mod system_data_contract; pub mod tokens; pub mod transition; diff --git a/packages/rs-sdk/src/platform/subscriptions.rs b/packages/rs-sdk/src/platform/subscriptions.rs new file mode 100644 index 00000000000..6c80c6b69ef --- /dev/null +++ b/packages/rs-sdk/src/platform/subscriptions.rs @@ -0,0 +1,1241 @@ +//! Subscriptions to committed state transitions. +//! +//! [`Sdk::subscribe_to_state_transitions`] opens a `subscribeToStateTransitions` stream and +//! returns a [`StateTransitionSubscription`] yielding the transitions that match any of the +//! filters, as the node evaluated them, block by block, plus checkpoints. +//! +//! What a subscription is worth: +//! - delivery is at least once, and may be incomplete: a node can leave a match out; +//! - act on a transition only after reading the state it changed with a proved query; +//! - to catch up after being offline, start from a proved read's `metadata.height + 1`. +//! +//! A broken stream (including the transport's periodic streaming timeout) is resumed from the +//! height after the last checkpoint, possibly on another node, so transitions after it may be +//! delivered again. A node that sends something invalid (a wrong hash, indexes or positions out +//! of range, a checkpoint going backwards) is banned (only moved out of the rotation when +//! `ban_failed_address` is off) and the stream resumed elsewhere. A transition that matches its +//! hash but that this SDK cannot decode ends the subscription: the SDK is likely older than the +//! network. A node whose tip stalls keeps sending the same checkpoint; the SDK does not detect +//! that. +//! +//! ```no_run +//! use dash_sdk::dash_platform_queries::subscriptions::{DocumentFilter, StateTransitionFilter}; +//! use dash_sdk::dpp::prelude::Identifier; +//! use dash_sdk::platform::subscriptions::SubscriptionEvent; +//! use dash_sdk::{Error, Sdk}; +//! +//! async fn watch(sdk: &Sdk, contract_id: Identifier) -> Result<(), Error> { +//! let filter = StateTransitionFilter::Documents( +//! DocumentFilter::new(contract_id).with_document_type("note"), +//! ); +//! let mut subscription = sdk +//! .subscribe_to_state_transitions(vec![filter], None, None) +//! .await?; +//! loop { +//! match subscription.next().await? { +//! SubscriptionEvent::StateTransition(event) => { +//! println!("matched at height {}", event.block_height) +//! } +//! SubscriptionEvent::Checkpoint { block_height } => { +//! let _resume_after_restart_from = block_height + 1; // persist this +//! } +//! } +//! } +//! } +//! ``` + +use crate::{Error, Sdk}; +use dapi_grpc::platform::v0::subscribe_to_state_transitions_response::subscribe_to_state_transitions_response_v0::{ + Responses, StateTransitionMatch, +}; +use dapi_grpc::platform::v0::subscribe_to_state_transitions_response::Version; +use dapi_grpc::platform::v0::{SubscribeToStateTransitionsRequest, SubscribeToStateTransitionsResponse}; +use dapi_grpc::tonic::{Code, Status}; +use dash_platform_queries::subscriptions::{subscribe_request, StateTransitionFilter}; +use dpp::dashcore::hashes::{sha256, Hash}; +use dpp::platform_value::DEFAULT_MAX_VALUE_DECODE_DEPTH; +use dpp::state_transition::batch_transition::accessors::DocumentsBatchTransitionAccessorsV0; +use dpp::state_transition::StateTransition; +use dpp::version::PlatformVersion; +use dpp::ProtocolError; +use futures::{Stream, StreamExt}; +use rs_dapi_client::transport::{sleep, TransportError, TransportRequest}; +use rs_dapi_client::{ + Address, CanRetry, DapiClientError, DapiRequestExecutor, ExecutionError, RequestSettings, +}; +use std::future::Future; +use std::pin::Pin; +use std::time::Duration; + +/// Wait before the first reconnect; doubles per failure in a row, up to the configured cap. +const FIRST_RETRY_DELAY: Duration = Duration::from_secs(1); + +/// Settings of a state transition subscription. +#[derive(Debug, Clone)] +pub struct SubscriptionConfig { + /// Settings for opening each stream. + pub request_settings: RequestSettings, + /// A stream that sends nothing for a whole window of this length is resumed; the node + /// checkpoints every 10 seconds while idle. Default: 60 seconds. + pub idle_timeout: Duration, + /// Longest wait between reconnects. Default: 30 seconds. + pub max_backoff: Duration, +} + +impl Default for SubscriptionConfig { + fn default() -> Self { + Self { + request_settings: RequestSettings::default(), + idle_timeout: Duration::from_secs(60), + max_backoff: Duration::from_secs(30), + } + } +} + +/// A committed state transition that matched the subscription's filters. +#[derive(Debug, Clone)] +pub struct StateTransitionEvent { + /// Height of the block the transition executed in, as the node reports it. + pub block_height: u64, + /// Block time in milliseconds since the Unix epoch, as the node reports it. + pub block_time_ms: u64, + /// The protocol version the block executed under, as the node reports it. + pub protocol_version: u32, + /// SHA-256 of the serialized transition (its Tenderdash hash), computed by the SDK. + pub state_transition_hash: [u8; 32], + /// The transition. + pub state_transition: StateTransition, + /// Indexes, in the subscription's filters, of the filters the node matched. + pub matched_filters: Vec, + /// For a batch: positions of the document transitions the node matched. + pub matched_batch_positions: Vec, +} + +/// One item of a state transition subscription. +#[derive(Debug, Clone)] +pub enum SubscriptionEvent { + /// A matching transition. + StateTransition(Box), + /// Every match through `block_height` was delivered; resume from `block_height + 1`. + Checkpoint { + /// The highest fully scanned height. + block_height: u64, + }, +} + +/// The messages of one stream. +type Messages = + Pin> + Send>>; + +/// The current stream, the node serving it and when it opened. +struct OpenStream { + messages: Messages, + address: Address, + opened: Clock, +} + +impl OpenStream { + fn new(messages: Messages, address: Address) -> Self { + Self { + messages, + address, + opened: Clock::now(), + } + } +} + +/// A point in time, to tell how long a stream lived: tokio's clock (which tests can pause), or +/// on wasm, which has no monotonic `Instant`, the wall clock. +struct Clock( + #[cfg(not(target_arch = "wasm32"))] tokio::time::Instant, + #[cfg(target_arch = "wasm32")] f64, +); + +impl Clock { + #[cfg(not(target_arch = "wasm32"))] + fn now() -> Self { + Self(tokio::time::Instant::now()) + } + + #[cfg(target_arch = "wasm32")] + fn now() -> Self { + Self(js_sys::Date::now()) + } + + #[cfg(not(target_arch = "wasm32"))] + fn elapsed(&self) -> Duration { + self.0.elapsed() + } + + #[cfg(target_arch = "wasm32")] + fn elapsed(&self) -> Duration { + Duration::from_secs_f64((js_sys::Date::now() - self.0).max(0.0) / 1000.0) + } +} + +/// Why a message was not accepted. +enum Refusal { + /// The node sent something invalid: ban it and resume elsewhere. + NodeFault(Error), + /// The node's bytes match their hash, but this SDK cannot decode them: every node would send + /// the same, so the subscription ends. + Undecodable(Error), +} + +impl From for Refusal { + fn from(error: Error) -> Self { + Refusal::NodeFault(error) + } +} + +/// A pending open of a stream, reporting the node serving it. +type Opening = Pin< + Box>> + Send>, +>; +/// Opens a stream for a request. +type Opener = Box Opening + Send>; +/// A pending wait, kept across calls so cancelling `next()` does not restart it. +type Timer = Pin + Send>>; + +/// A running subscription; see the [module documentation](self). +pub struct StateTransitionSubscription { + sdk: Sdk, + filters: Vec, + config: SubscriptionConfig, + open: Opener, + /// The open in progress, kept across calls so cancelling `next()` does not restart it. + opening: Option, + /// Whether a failing node is banned, or only moved out of the rotation. + ban_failed_address: bool, + /// The current stream. + stream: Option, + /// Where the next stream starts; `None` until the first checkpoint of a live start. + resume_from: Option, + /// The wait before the next reconnect, and the one after it. + retry: Option, + retry_delay: Duration, + idle: IdleWatch, + /// Why the subscription ended, once it has. + terminated: Option, +} + +/// Notices a stream that sent nothing for a whole window, with one timer however many messages +/// arrive (on wasm a dropped timer runs until it fires), so silence is noticed after one to two +/// windows. +struct IdleWatch { + window: Option, + /// Whether a message arrived, or a stream opened, during the current window. + heard: bool, +} + +impl IdleWatch { + fn heard(&mut self) { + self.heard = true; + } + + /// Completes once a whole `window` passes in which nothing was heard. + async fn silent(&mut self, window: Duration) { + loop { + self.window + .get_or_insert_with(|| Box::pin(sleep(window))) + .as_mut() + .await; + self.window = None; + if !std::mem::take(&mut self.heard) { + return; + } + } + } +} + +impl Sdk { + /// Subscribe to committed state transitions matching any of `filters` (1 to + /// [`MAX_FILTERS`](dash_platform_queries::subscriptions::MAX_FILTERS)), scanning from + /// `from_block_height` (inclusive), or from after the current tip when `None`. The first + /// stream is opened as a reopen would be: a refused request fails here, a transient failure + /// is retried by [`StateTransitionSubscription::next`]. + pub async fn subscribe_to_state_transitions( + &self, + filters: Vec, + from_block_height: Option, + config: Option, + ) -> Result { + let config = config.unwrap_or_default(); + let sdk = self.clone(); + let settings = config.request_settings; + let open: Opener = Box::new(move |request| { + let sdk = sdk.clone(); + Box::pin(async move { + let response = sdk.execute(request, settings).await?; + Ok((Box::pin(response.inner) as Messages, response.address)) + }) + }); + let mut subscription = StateTransitionSubscription::new( + self.clone(), + filters, + config, + open, + from_block_height, + ); + subscription.reopen().await?; + Ok(subscription) + } +} + +impl StateTransitionSubscription { + fn new( + sdk: Sdk, + filters: Vec, + config: SubscriptionConfig, + open: Opener, + resume_from: Option, + ) -> Self { + // The settings `DapiClient::execute` applies to each open. + let ban_failed_address = sdk + .dapi_client_settings + .override_by(SubscribeToStateTransitionsRequest::SETTINGS_OVERRIDES) + .override_by(config.request_settings) + .finalize() + .ban_failed_address; + Self { + sdk, + filters, + config, + open, + opening: None, + ban_failed_address, + stream: None, + resume_from, + retry: None, + retry_delay: FIRST_RETRY_DELAY, + idle: IdleWatch { + window: None, + heard: true, + }, + terminated: None, + } + } + + /// The next matching transition or checkpoint. Cancel-safe. Broken streams are resumed + /// without limit; an error means the subscription cannot continue (the request was refused, + /// a live start broke before its first checkpoint, or this SDK cannot decode a transition), + /// and every later call fails too. + pub async fn next(&mut self) -> Result { + if let Some(reason) = &self.terminated { + return Err(Error::Cancelled(format!( + "the subscription ended: {reason}" + ))); + } + loop { + match self.step().await { + Ok(Some(event)) => return Ok(event), + Ok(None) => {} + Err(error) => { + self.terminated = Some(error.to_string()); + self.stream = None; + return Err(error); + } + } + } + } + + /// The height a new stream would start from: the last checkpoint + 1. + pub fn resume_height(&self) -> Option { + self.resume_from + } + + /// Consume the subscription as a stream of events, which ends after the first error. + pub fn into_stream(self) -> impl Stream> { + futures::stream::unfold(Some(self), |subscription| async move { + let mut subscription = subscription?; + let item = subscription.next().await; + let next = item.is_ok().then_some(subscription); + Some((item, next)) + }) + } + + /// Read one message, or reopen the stream if it broke; `None` when there is no event yet. + async fn step(&mut self) -> Result, Error> { + let Some(stream) = self.stream.as_mut() else { + self.reopen().await?; + return Ok(None); + }; + let message = { + let message = stream.messages.next(); + let silent = self.idle.silent(self.config.idle_timeout); + futures::pin_mut!(silent); + match futures::future::select(message, silent).await { + futures::future::Either::Left((message, _)) => Some(message), + futures::future::Either::Right(_) => None, + } + }; + let (cause, ban, evict) = match message { + Some(Some(Ok(response))) => { + self.idle.heard(); + match self.accept(response) { + Ok(event) => return Ok(Some(event)), + Err(Refusal::NodeFault(fault)) => (fault, true, false), + Err(Refusal::Undecodable(error)) => return Err(error), + } + } + Some(Some(Err(status))) if is_transient(&status) => { + let ban = lacks_heights(&status); + let evict = is_server_failure(&status); + (status_error(status), ban, evict) + } + Some(Some(Err(status))) => return Err(status_error(status)), + Some(None) => ( + Error::Cancelled("the node ended the stream".to_string()), + false, + false, + ), + // Never a ban nor an eviction: a client that is offline would blame every node. + None => ( + Error::TimeoutReached( + self.config.idle_timeout, + "no message on the state transition stream".to_string(), + ), + false, + false, + ), + }; + let Some(stream) = self.stream.take() else { + return Ok(None); + }; + if ban { + self.blame(Some(&stream.address), &cause); + } else if evict { + // `execute` returned before the failure, so it moved nothing off this node. + self.sdk.address_list().evict_from_rotation(&stream.address); + } + // A stream that lived a whole idle window was not a failure in a row: without this, the + // transport's streaming timeout on a quiet chain (no new checkpoint height) would grow + // the wait before every reconnect up to the cap. + if stream.opened.elapsed() >= self.config.idle_timeout { + self.retry_delay = FIRST_RETRY_DELAY; + } + // A live start has no height to resume from before its first checkpoint: a new live + // start would skip the blocks in between. + if self.resume_from.is_none() { + return Err(Error::Cancelled(format!( + "the stream broke before its first checkpoint ({cause}); subscribe again" + ))); + } + tracing::debug!(%cause, "state transition stream broke; resuming"); + self.schedule_retry(); + Ok(None) + } + + /// Open a new stream once the wait after the last break has passed. A transient failure + /// schedules another attempt. + async fn reopen(&mut self) -> Result<(), Error> { + if let Some(retry) = self.retry.as_mut() { + retry.await; + self.retry = None; + } + let opening = match self.opening.take() { + Some(opening) => opening, + None => (self.open)(subscribe_request(&self.filters, self.resume_from)?), + }; + let opened = self.opening.insert(opening).await; + self.opening = None; + match opened { + Ok((messages, address)) => { + self.stream = Some(OpenStream::new(messages, address)); + self.idle.heard(); + Ok(()) + } + Err(error) => { + // `DapiClient::execute` already blamed the node for retryable failures. + let transient = match &error.inner { + DapiClientError::Transport(TransportError::Grpc(status)) => { + if lacks_heights(status) { + let cause = status_error(status.clone()); + self.blame(error.address.as_ref(), &cause); + } + is_transient(status) + } + other => other.can_retry() || other.is_no_available_addresses(), + }; + if !transient { + return Err(Error::from(error.inner)); + } + tracing::debug!(error = %error.inner, "cannot reopen the state transition stream; retrying"); + self.schedule_retry(); + Ok(()) + } + } + } + + fn schedule_retry(&mut self) { + let delay = self.retry_delay.min(self.config.max_backoff); + self.retry = Some(Box::pin(sleep(delay))); + self.retry_delay = delay.saturating_mul(2); + } + + /// Ban the node, or when banning is disabled, only move the next stream off it. + fn blame(&self, address: Option<&Address>, cause: &Error) { + let Some(address) = address else { + return; + }; + let addresses = self.sdk.address_list(); + if self.ban_failed_address { + addresses.ban_with_reason(address, Some(format!("state transition stream: {cause}"))); + } else { + addresses.evict_from_rotation(address); + } + } + + /// The event a response carries. + fn accept( + &mut self, + response: SubscribeToStateTransitionsResponse, + ) -> Result { + let Some(Version::V0(response)) = response.version else { + return Err(node_fault("unknown response version").into()); + }; + match response.responses { + Some(Responses::Checkpoint(checkpoint)) => { + let resume_from = checkpoint + .block_height + .checked_add(1) + .ok_or_else(|| node_fault("checkpoint at the maximum height"))?; + if self + .resume_from + .is_some_and(|current| resume_from < current) + { + return Err(node_fault("checkpoint before the previous one").into()); + } + if self.resume_from != Some(resume_from) { + self.retry_delay = FIRST_RETRY_DELAY; + } + self.resume_from = Some(resume_from); + Ok(SubscriptionEvent::Checkpoint { + block_height: checkpoint.block_height, + }) + } + Some(Responses::StateTransition(matched)) => self.accept_transition(matched), + None => Err(node_fault("unknown response kind").into()), + } + } + + fn accept_transition( + &self, + matched: StateTransitionMatch, + ) -> Result { + let state_transition_hash = sha256::Hash::hash(&matched.state_transition).to_byte_array(); + if matched.state_transition_hash != state_transition_hash { + return Err(node_fault("state transition hash does not match its bytes").into()); + } + if matched.matched_filters.is_empty() + || matched + .matched_filters + .iter() + .any(|&index| index as usize >= self.filters.len()) + { + return Err(node_fault("matched filter indexes out of range").into()); + } + let state_transition = decode(&matched.state_transition, matched.protocol_version) + .map_err(|cause| { + Refusal::Undecodable(Error::Protocol(ProtocolError::DecodingError(format!( + "cannot decode the state transition at height {} (protocol version {}): \ + {cause}; the node's bytes match their hash, so this SDK is likely older \ + than the network: upgrade it", + matched.block_height, matched.protocol_version + )))) + })?; + // Positions index the batch's transitions; any other transition has none. + let transitions = match &state_transition { + StateTransition::Batch(batch) => batch.transitions_len(), + _ => 0, + }; + if matched + .matched_batch_positions + .iter() + .any(|&position| position as usize >= transitions) + { + return Err(node_fault("matched batch positions out of range").into()); + } + Ok(SubscriptionEvent::StateTransition(Box::new( + StateTransitionEvent { + block_height: matched.block_height, + block_time_ms: matched.block_time_ms, + protocol_version: matched.protocol_version, + state_transition_hash, + state_transition, + matched_filters: matched.matched_filters, + matched_batch_positions: matched.matched_batch_positions, + }, + ))) + } +} + +/// Decode `bytes` as the node did, under the protocol version the block executed with, except +/// that values are never nested deeper than the default bound, even under a version that set +/// none: the version is the node's word, and a deeper tree could exhaust the stack. +fn decode(bytes: &[u8], protocol_version: u32) -> Result { + let platform_version = PlatformVersion::get(protocol_version) + .map_err(|_| format!("protocol version {protocol_version} is unknown to this SDK"))?; + let decoded = if platform_version + .system_limits + .max_document_value_depth + .is_some() + { + StateTransition::deserialize_from_bytes_untrusted_in_version(bytes, platform_version) + } else { + let mut bounded = platform_version.clone(); + bounded.system_limits.max_document_value_depth = + u16::try_from(DEFAULT_MAX_VALUE_DECODE_DEPTH).ok(); + StateTransition::deserialize_from_bytes_untrusted_in_version(bytes, &bounded) + }; + decoded.map_err(|error| error.to_string()) +} + +/// Whether another stream may get past a stream or open failing with `status`. +fn is_transient(status: &Status) -> bool { + status.can_retry() || lacks_heights(status) +} + +/// Whether this node cannot serve the requested heights (it lacks or cannot decode a block). +/// `OutOfRange`, a start behind every node's replay window, ends the subscription instead. +fn lacks_heights(status: &Status) -> bool { + status.code() == Code::FailedPrecondition +} + +/// Whether the node failed an open stream itself: the next stream should go to another node, +/// though this one is not banned. +fn is_server_failure(status: &Status) -> bool { + matches!( + status.code(), + Code::Unavailable | Code::Internal | Code::Unknown + ) +} + +fn status_error(status: Status) -> Error { + Error::from(DapiClientError::Transport(TransportError::Grpc(status))) +} + +fn node_fault(message: &str) -> Error { + Error::Protocol(ProtocolError::DecodingError(format!( + "invalid state transition stream message: {message}" + ))) +} + +#[cfg(test)] +mod tests { + use super::*; + use dapi_grpc::platform::v0::subscribe_to_state_transitions_request::Version as RequestVersion; + use dapi_grpc::platform::v0::subscribe_to_state_transitions_response::subscribe_to_state_transitions_response_v0::Checkpoint; + use dapi_grpc::platform::v0::subscribe_to_state_transitions_response::SubscribeToStateTransitionsResponseV0; + use dash_platform_queries::subscriptions::Role; + use dpp::address_funds::PlatformAddress; + use dpp::platform_value::Value; + use dpp::prelude::Identifier; + use dpp::serialization::PlatformSerializable; + use dpp::state_transition::batch_transition::batched_transition::document_create_transition::v0::DocumentCreateTransitionV0; + use dpp::state_transition::batch_transition::batched_transition::document_create_transition::DocumentCreateTransition; + use dpp::state_transition::batch_transition::batched_transition::document_transition::DocumentTransition; + use dpp::state_transition::batch_transition::batched_transition::BatchedTransition; + use dpp::state_transition::batch_transition::document_base_transition::v0::DocumentBaseTransitionV0; + use dpp::state_transition::batch_transition::document_base_transition::DocumentBaseTransition; + use dpp::state_transition::batch_transition::{BatchTransition, BatchTransitionV1}; + use dpp::state_transition::identity_credit_transfer_transition::v0::IdentityCreditTransferTransitionV0; + use dpp::state_transition::identity_credit_transfer_transition::IdentityCreditTransferTransition; + use std::collections::VecDeque; + use std::sync::{Arc, Mutex}; + + type Opens = Arc>>>; + + fn node() -> Address { + "https://127.0.0.1:1".parse().expect("address") + } + + /// A subscription with two filters and no stream yet, whose opens yield `opens` in turn + /// (then are refused), recording the height each open asks for. + fn unopened( + resume_from: Option, + opens: Vec>, + ) -> (StateTransitionSubscription, Opens) { + unopened_with( + Duration::ZERO, + SubscriptionConfig::default(), + resume_from, + opens, + ) + } + + /// As [`unopened`], with each open taking `delay` and the subscription using `config`. + fn unopened_with( + delay: Duration, + config: SubscriptionConfig, + resume_from: Option, + opens: Vec>, + ) -> (StateTransitionSubscription, Opens) { + let recorded = Opens::default(); + let heights = recorded.clone(); + let mut opens = VecDeque::from(opens); + let open: Opener = Box::new(move |request: SubscribeToStateTransitionsRequest| { + let Some(RequestVersion::V0(request)) = request.version else { + panic!("v0 request"); + }; + heights.lock().unwrap().push(request.from_block_height); + let result = opens + .pop_front() + .unwrap_or_else(|| Err(Status::invalid_argument("no more streams"))) + .map(|messages| (messages, node())) + .map_err(|status| ExecutionError { + inner: DapiClientError::Transport(TransportError::Grpc(status)), + retries: 0, + address: Some(node()), + }); + Box::pin(async move { + if !delay.is_zero() { + tokio::time::sleep(delay).await; + } + result + }) + }); + let address = |byte| StateTransitionFilter::Addresses { + addresses: vec![PlatformAddress::P2pkh([byte; 20])], + role: Role::Any, + }; + let subscription = StateTransitionSubscription::new( + Sdk::new_mock(), + vec![address(1), address(2)], + config, + open, + resume_from, + ); + (subscription, recorded) + } + + /// A subscription with two filters whose first stream yields `first` and whose reopens yield + /// `next` in turn (then are refused), recording the height each reopen asks for. + fn subscription( + resume_from: Option, + first: Messages, + next: Vec, + ) -> (StateTransitionSubscription, Opens) { + let (mut subscription, opens) = unopened(resume_from, next.into_iter().map(Ok).collect()); + subscription.stream = Some(OpenStream::new(first, node())); + (subscription, opens) + } + + fn response(message: Responses) -> SubscribeToStateTransitionsResponse { + SubscribeToStateTransitionsResponse { + version: Some(Version::V0(SubscribeToStateTransitionsResponseV0 { + responses: Some(message), + })), + } + } + + /// A stream sending `messages` and then ending. + fn ending(messages: Vec>) -> Messages { + Box::pin(futures::stream::iter( + messages.into_iter().map(|message| message.map(response)), + )) + } + + /// A stream sending a checkpoint at `block_height` `count` times, `every` apart, then ending. + fn repeating(block_height: u64, every: Duration, count: usize) -> Messages { + Box::pin(futures::stream::unfold(0, move |sent| async move { + if sent == count { + return None; + } + if sent > 0 { + tokio::time::sleep(every).await; + } + let message = response(Responses::Checkpoint(Checkpoint { block_height })); + Some((Ok(message), sent + 1)) + })) + } + + /// A stream sending `messages` and then nothing. + fn silent(messages: Vec>) -> Messages { + Box::pin(ending(messages).chain(futures::stream::pending())) + } + + fn checkpoint(block_height: u64) -> Result { + Ok(Responses::Checkpoint(Checkpoint { block_height })) + } + + fn transition(bytes: Vec) -> StateTransitionMatch { + StateTransitionMatch { + block_height: 45, + block_time_ms: 1, + protocol_version: PlatformVersion::latest().protocol_version, + state_transition_hash: sha256::Hash::hash(&bytes).to_byte_array().to_vec(), + state_transition: bytes.into(), + matched_filters: vec![1], + matched_batch_positions: vec![], + } + } + + fn transfer() -> Vec { + StateTransition::IdentityCreditTransfer(IdentityCreditTransferTransition::V0( + IdentityCreditTransferTransitionV0 { + identity_id: Identifier::from([1u8; 32]), + recipient_id: Identifier::from([7u8; 32]), + amount: 10, + ..Default::default() + }, + )) + .serialize_to_bytes() + .expect("serializable") + } + + /// A batch creating a document whose data nests `depth` arrays. + fn nested_batch(depth: usize) -> Vec { + let nested = (0..depth).fold(Value::Null, |value, _| Value::Array(vec![value])); + StateTransition::Batch(BatchTransition::V1(BatchTransitionV1 { + owner_id: Identifier::from([1u8; 32]), + transitions: vec![BatchedTransition::Document(DocumentTransition::Create( + DocumentCreateTransition::V0(DocumentCreateTransitionV0 { + base: DocumentBaseTransition::V0(DocumentBaseTransitionV0 { + id: Identifier::from([2u8; 32]), + identity_contract_nonce: 1, + document_type_name: "note".to_string(), + data_contract_id: Identifier::from([3u8; 32]), + }), + entropy: [0; 32], + data: [("nested".to_string(), nested)].into(), + prefunded_voting_balance: None, + }), + ))], + ..Default::default() + })) + .serialize_to_bytes() + .expect("serializable") + } + + fn opens(opens: &Opens) -> Vec> { + opens.lock().unwrap().clone() + } + + #[tokio::test(start_paused = true)] + async fn should_deliver_a_transition_with_the_nodes_matched_filters() { + let bytes = transfer(); + let first = ending(vec![ + checkpoint(41), + Ok(Responses::StateTransition(transition(bytes.clone()))), + ]); + let (mut subscription, _) = subscription(Some(42), first, vec![]); + assert!(matches!( + subscription.next().await, + Ok(SubscriptionEvent::Checkpoint { block_height: 41 }) + )); + let Ok(SubscriptionEvent::StateTransition(event)) = subscription.next().await else { + panic!("expected a transition"); + }; + assert_eq!(event.block_height, 45); + assert_eq!(event.matched_filters, vec![1]); + assert_eq!( + event.state_transition_hash, + sha256::Hash::hash(&bytes).to_byte_array() + ); + } + + #[tokio::test(start_paused = true)] + async fn should_treat_a_wrong_hash_as_a_node_fault_and_resume() { + let mut wrong_hash = transition(transfer()); + wrong_hash.state_transition_hash = vec![0; 32]; + let first = silent(vec![ + checkpoint(41), + Ok(Responses::StateTransition(wrong_hash)), + ]); + let second = silent(vec![ + checkpoint(41), + Ok(Responses::StateTransition(transition(transfer()))), + ]); + let (mut subscription, opened) = subscription(Some(42), first, vec![second]); + assert!(subscription.next().await.is_ok()); + assert!(matches!( + subscription.next().await, + Ok(SubscriptionEvent::Checkpoint { block_height: 41 }) + )); + assert!(matches!( + subscription.next().await, + Ok(SubscriptionEvent::StateTransition(_)) + )); + assert_eq!(opens(&opened), vec![Some(42)]); + } + + /// What `accept` makes of a transition. + fn outcome(result: Result) -> Result<(), String> { + match result { + Ok(_) => Ok(()), + Err(Refusal::NodeFault(error)) => Err(format!("node fault: {error}")), + Err(Refusal::Undecodable(error)) => Err(format!("undecodable: {error}")), + } + } + + #[test] + fn should_refuse_values_nested_deeper_than_the_default_bound_without_blaming_the_node() { + let (mut subscription, _) = subscription(Some(42), ending(vec![]), vec![]); + let no_limit = (1..PlatformVersion::latest().protocol_version) + .rev() + .filter_map(|version| PlatformVersion::get(version).ok()) + .find(|version| version.system_limits.max_document_value_depth.is_none()) + .expect("an early protocol version sets no value depth limit") + .protocol_version; + for protocol_version in [PlatformVersion::latest().protocol_version, no_limit] { + let mut accept = |depth| { + outcome(subscription.accept(response(Responses::StateTransition( + StateTransitionMatch { + protocol_version, + matched_batch_positions: vec![0], + ..transition(nested_batch(depth)) + }, + )))) + }; + assert_eq!(accept(16), Ok(()), "protocol version {protocol_version}"); + // The node vouched for the bytes; the SDK's own bound refuses them. + let error = accept(300).expect_err("too deep"); + assert!( + error.starts_with("undecodable") && error.contains("exceeds maximum 256"), + "{error}" + ); + } + } + + #[test] + fn should_not_blame_the_node_for_a_protocol_version_this_sdk_does_not_know() { + let (mut subscription, _) = subscription(Some(42), ending(vec![]), vec![]); + let unknown = PlatformVersion::latest().protocol_version + 1; + let error = outcome(subscription.accept(response(Responses::StateTransition( + StateTransitionMatch { + protocol_version: unknown, + ..transition(transfer()) + }, + )))) + .expect_err("unknown version"); + assert!( + error.starts_with("undecodable") && error.contains("upgrade"), + "{error}" + ); + } + + #[tokio::test(start_paused = true)] + async fn should_end_the_subscription_on_an_undecodable_transition_without_resuming() { + let mut undecodable = transition(vec![0xff, 0x00, 0x13]); + undecodable.block_height = 77; + let first = silent(vec![ + checkpoint(41), + Ok(Responses::StateTransition(undecodable)), + ]); + let (mut subscription, opened) = + subscription(Some(42), first, vec![silent(vec![checkpoint(41)])]); + assert!(subscription.next().await.is_ok()); + let error = subscription.next().await.expect_err("undecodable"); + assert!( + error.to_string().contains("height 77") && error.to_string().contains("upgrade"), + "{error}" + ); + assert!(subscription.next().await.is_err()); + assert!(opens(&opened).is_empty(), "no other node is tried"); + } + + #[test] + fn should_treat_batch_positions_out_of_range_as_node_faults() { + let (mut subscription, _) = subscription(Some(42), ending(vec![]), vec![]); + let mut accept = |bytes, matched_batch_positions| { + outcome(subscription.accept(response(Responses::StateTransition( + StateTransitionMatch { + matched_batch_positions, + ..transition(bytes) + }, + )))) + }; + assert_eq!(accept(nested_batch(1), vec![0]), Ok(())); + assert_eq!(accept(transfer(), vec![]), Ok(())); + for (bytes, positions) in [(nested_batch(1), vec![1]), (transfer(), vec![0])] { + let error = accept(bytes, positions).expect_err("out of range"); + assert!( + error.starts_with("node fault") && error.contains("batch positions"), + "{error}" + ); + } + } + + #[test] + fn should_treat_invalid_checkpoints_filter_indexes_and_envelopes_as_node_faults() { + let (mut subscription, _) = subscription(Some(42), ending(vec![]), vec![]); + let response = |responses| SubscribeToStateTransitionsResponse { + version: Some(Version::V0(SubscribeToStateTransitionsResponseV0 { + responses, + })), + }; + let with_filters = |matched_filters| { + response(Some(Responses::StateTransition(StateTransitionMatch { + matched_filters, + ..transition(transfer()) + }))) + }; + for invalid in [ + response(Some(Responses::Checkpoint(Checkpoint { block_height: 40 }))), + response(Some(Responses::StateTransition(StateTransitionMatch { + state_transition_hash: vec![0; 32], + ..transition(transfer()) + }))), + response(Some(Responses::Checkpoint(Checkpoint { + block_height: u64::MAX, + }))), + with_filters(vec![]), + with_filters(vec![2]), + response(None), + SubscribeToStateTransitionsResponse { version: None }, + ] { + assert!(matches!( + subscription.accept(invalid), + Err(Refusal::NodeFault(_)) + )); + } + assert_eq!(subscription.resume_height(), Some(42)); + } + + #[tokio::test(start_paused = true)] + async fn should_resume_from_the_last_checkpoint_after_a_transient_error() { + let first = ending(vec![ + checkpoint(41), + checkpoint(43), + Err(Status::unavailable("restarting")), + ]); + let second = silent(vec![checkpoint(43), checkpoint(50)]); + let (mut subscription, opened) = subscription(Some(42), first, vec![second]); + for expected in [41, 43, 43, 50] { + assert!(matches!( + subscription.next().await, + Ok(SubscriptionEvent::Checkpoint { block_height }) if block_height == expected + )); + } + assert_eq!(opens(&opened), vec![Some(44)]); + assert_eq!(subscription.resume_height(), Some(51)); + } + + #[test] + fn should_resume_after_transient_failures_but_not_after_refusals() { + for code in [ + Code::Unavailable, + Code::DeadlineExceeded, + Code::ResourceExhausted, + Code::FailedPrecondition, + ] { + assert!(is_transient(&Status::new(code, "")), "{code:?}"); + } + for code in [Code::InvalidArgument, Code::NotFound, Code::OutOfRange] { + assert!(!is_transient(&Status::new(code, "")), "{code:?}"); + } + } + + #[tokio::test(start_paused = true)] + async fn should_keep_failing_after_the_subscription_ended() { + let first = ending(vec![ + checkpoint(41), + Err(Status::invalid_argument("refused")), + ]); + let (mut subscription, opened) = subscription(Some(42), first, vec![]); + assert!(subscription.next().await.is_ok()); + let error = subscription.next().await.expect_err("refused"); + let later = subscription.next().await.expect_err("ended"); + assert!(later.to_string().contains(&error.to_string()), "{later}"); + assert!(opens(&opened).is_empty()); + assert!(subscription.stream.is_none()); + } + + #[tokio::test(start_paused = true)] + async fn should_fail_a_live_start_that_breaks_before_its_first_checkpoint() { + let first = ending(vec![Err(Status::unavailable("restarting"))]); + let (mut subscription, opened) = subscription(None, first, vec![]); + let error = subscription.next().await.expect_err("cannot resume"); + assert!(error.to_string().contains("first checkpoint"), "{error}"); + assert!(opens(&opened).is_empty()); + } + + #[tokio::test(start_paused = true)] + async fn should_open_the_first_stream_like_a_reopen() { + // A node that lacks the start height is skipped (and banned), not fatal. + let (mut subscription, opened) = unopened( + Some(42), + vec![ + Err(Status::failed_precondition("block 42 is pruned")), + Ok(silent(vec![checkpoint(41)])), + ], + ); + subscription.reopen().await.expect("a transient failure"); + assert!(subscription.stream.is_none()); + assert!(matches!( + subscription.next().await, + Ok(SubscriptionEvent::Checkpoint { block_height: 41 }) + )); + assert_eq!(opens(&opened), vec![Some(42), Some(42)]); + + // A refusal, or a start behind every node's replay window, fails the first open. + for status in [ + Status::invalid_argument("bad filter"), + Status::out_of_range("too far behind"), + ] { + let (mut subscription, opened) = unopened(Some(42), vec![Err(status)]); + assert!(subscription.reopen().await.is_err()); + assert_eq!(opens(&opened), vec![Some(42)]); + } + } + + #[tokio::test(start_paused = true)] + async fn should_reset_the_backoff_after_a_stream_that_lived_an_idle_window() { + // A quiet chain: the checkpoint never advances, and the stream ends after 70 seconds. + let first = repeating(41, Duration::from_secs(10), 8); + let second = silent(vec![checkpoint(41)]); + let (mut subscription, opened) = subscription(Some(42), first, vec![second]); + // As after several failures in a row. + subscription.retry_delay = Duration::from_secs(16); + for _ in 0..8 { + assert!(matches!( + subscription.next().await, + Ok(SubscriptionEvent::Checkpoint { block_height: 41 }) + )); + } + let ended = tokio::time::Instant::now(); + assert!(matches!( + subscription.next().await, + Ok(SubscriptionEvent::Checkpoint { block_height: 41 }) + )); + assert_eq!(ended.elapsed(), FIRST_RETRY_DELAY); + assert_eq!(opens(&opened), vec![Some(42)]); + } + + #[tokio::test(start_paused = true)] + async fn should_move_the_next_stream_off_a_node_that_failed_an_open_stream() { + for (code, ending_with, moved) in [ + (Some(Code::Unavailable), true, true), + (Some(Code::Internal), true, true), + (Some(Code::Unknown), true, true), + // A clean end, and the idle watchdog, blame no node. + (None, true, false), + (None, false, false), + ] { + let failing = ending( + std::iter::once(checkpoint(41)) + .chain(code.map(|code| Err(Status::new(code, "cannot read the block store")))) + .collect(), + ); + let first = if ending_with { + failing + } else { + silent(vec![checkpoint(41)]) + }; + let (mut subscription, _) = + subscription(Some(42), first, vec![silent(vec![checkpoint(41)])]); + // One active node, failing, and a healthy standby. + let mut addresses = subscription.sdk.address_list().clone(); + for port in [1, 2] { + addresses.add( + format!("https://127.0.0.1:{port}") + .parse() + .expect("address"), + ); + } + let addresses = addresses.with_active_set_size(1); + let active = addresses.get_live_address().expect("an active node"); + subscription.stream.as_mut().expect("a stream").address = active.clone(); + + for _ in 0..2 { + assert!(subscription.next().await.is_ok(), "{code:?}"); + } + assert!(!addresses.is_banned(&active), "{code:?}"); + assert_eq!( + addresses.get_live_address().expect("a node") != active, + moved, + "{code:?}" + ); + } + } + + #[tokio::test(start_paused = true)] + async fn should_resume_a_silent_stream_after_the_idle_timeout() { + let first = silent(vec![checkpoint(41)]); + let second = silent(vec![checkpoint(41)]); + let (mut subscription, opened) = subscription(Some(42), first, vec![second]); + assert!(subscription.next().await.is_ok()); + let started = tokio::time::Instant::now(); + // A call cancelled before the stream goes silent does not restart the idle window. + assert!( + tokio::time::timeout(Duration::from_secs(30), subscription.next()) + .await + .is_err() + ); + assert!(matches!( + subscription.next().await, + Ok(SubscriptionEvent::Checkpoint { block_height: 41 }) + )); + let waited = started.elapsed(); + assert!( + waited >= Duration::from_secs(60) && waited <= Duration::from_secs(121), + "{waited:?}" + ); + assert_eq!(opens(&opened), vec![Some(42)]); + } + + #[tokio::test(start_paused = true)] + async fn should_keep_a_pending_open_across_cancelled_calls() { + let (mut subscription, opened) = unopened_with( + Duration::from_secs(10), + SubscriptionConfig::default(), + Some(42), + vec![Ok(silent(vec![checkpoint(41)]))], + ); + let started = tokio::time::Instant::now(); + for _ in 0..5 { + assert!( + tokio::time::timeout(Duration::from_secs(1), subscription.next()) + .await + .is_err() + ); + } + assert!(matches!( + subscription.next().await, + Ok(SubscriptionEvent::Checkpoint { block_height: 41 }) + )); + assert_eq!(started.elapsed(), Duration::from_secs(10)); + assert_eq!(opens(&opened), vec![Some(42)]); + } + + #[tokio::test(start_paused = true)] + async fn should_ban_a_node_lacking_heights_only_when_banning_is_enabled() { + for ban_failed_address in [true, false] { + let config = SubscriptionConfig { + request_settings: RequestSettings { + ban_failed_address: Some(ban_failed_address), + ..RequestSettings::default() + }, + ..SubscriptionConfig::default() + }; + let lacks_heights = || Status::failed_precondition("block 42 is pruned"); + for streamed in [false, true] { + let mut opens = vec![Ok(silent(vec![checkpoint(41)]))]; + if !streamed { + opens.insert(0, Err(lacks_heights())); + } + let (mut subscription, _) = + unopened_with(Duration::ZERO, config.clone(), Some(42), opens); + if streamed { + let first = ending(vec![checkpoint(41), Err(lacks_heights())]); + subscription.stream = Some(OpenStream::new(first, node())); + } + // The failing node is active, with a healthy standby. + let mut addresses = subscription.sdk.address_list().clone(); + addresses.add(node()); + let mut addresses = addresses.with_active_set_size(1); + assert_eq!(addresses.get_live_address(), Some(node())); + addresses.add("https://127.0.0.1:2".parse().expect("address")); + + let calls = if streamed { 2 } else { 1 }; + for _ in 0..calls { + assert!(subscription.next().await.is_ok()); + } + let case = format!("ban {ban_failed_address}, streamed {streamed}"); + assert_eq!(addresses.is_banned(&node()), ban_failed_address, "{case}"); + assert_ne!(addresses.get_live_address(), Some(node()), "{case}"); + } + } + } +} diff --git a/packages/rs-sdk/tests/fetch/mod.rs b/packages/rs-sdk/tests/fetch/mod.rs index 976cc35dd50..74296c3a6ff 100644 --- a/packages/rs-sdk/tests/fetch/mod.rs +++ b/packages/rs-sdk/tests/fetch/mod.rs @@ -35,6 +35,7 @@ mod mock_fetch_many; mod prefunded_specialized_balance; mod protocol_version_vote_count; mod protocol_version_votes; +mod state_transition_subscriptions; mod token_direct_prices; mod tokens; diff --git a/packages/rs-sdk/tests/fetch/state_transition_subscriptions.rs b/packages/rs-sdk/tests/fetch/state_transition_subscriptions.rs new file mode 100644 index 00000000000..8df260d3208 --- /dev/null +++ b/packages/rs-sdk/tests/fetch/state_transition_subscriptions.rs @@ -0,0 +1,35 @@ +#[cfg(all(feature = "network-testing", not(feature = "offline-testing")))] +/// Tests that require connectivity to the server +mod online { + use crate::fetch::{common::setup_logs, config::Config}; + use dash_sdk::dash_platform_queries::subscriptions::{DocumentFilter, StateTransitionFilter}; + use dash_sdk::platform::subscriptions::SubscriptionEvent; + use std::time::Duration; + + /// A live-only subscription is accepted and reports where it starts. + #[tokio::test(flavor = "multi_thread", worker_threads = 1)] + async fn should_start_a_subscription_with_a_checkpoint() { + setup_logs(); + + let cfg = Config::new(); + let sdk = cfg + .setup_api("should_start_a_subscription_with_a_checkpoint") + .await; + let mut subscription = sdk + .subscribe_to_state_transitions( + vec![StateTransitionFilter::Documents(DocumentFilter::new( + cfg.existing_data_contract_id, + ))], + None, + None, + ) + .await + .expect("subscription accepted"); + + let event = tokio::time::timeout(Duration::from_secs(30), subscription.next()) + .await + .expect("first message within 30s") + .expect("first message"); + assert!(matches!(event, SubscriptionEvent::Checkpoint { .. })); + } +}