diff --git a/book/src/data-model/contract-moderation.md b/book/src/data-model/contract-moderation.md index f6bf3b0a461..cf5b155b837 100644 --- a/book/src/data-model/contract-moderation.md +++ b/book/src/data-model/contract-moderation.md @@ -8,7 +8,7 @@ An application that stores user content needs a way to keep an abusive identity Three facts define a contract's moderation: -1. **The contract declares it.** `DataContractConfigV2::moderation` is an optional `ContractModerationConfig { banlist, suspensions, moderators }`. At least one list must be kept. Which lists a contract keeps is decided when it is created and never changes: an update can not make an unmoderated contract moderated, turn a second list on, or turn a list off (`validate_config_update` 2, `DataContractConfigUpdateError`). Whoever writes documents under a contract knows from its first version whether and how they can be barred from it, which matters most where documents are assets: a ban also stops transfers and sales. And a list that is on may hold entries. Only the moderators may be changed by an update. +1. **The contract declares it.** `DataContractConfigV2::moderation` is an optional `ContractModerationConfig { banlist, suspensions, moderators }`. At least one list must be kept, unless a document type lets the moderators delete its documents (see Deleting Documents below), in which case the declaration may keep none. Which lists a contract keeps is decided when it is created and never changes: an update can not make an unmoderated contract moderated, turn a second list on, or turn a list off (`validate_config_update` 2, `DataContractConfigUpdateError`). Whoever writes documents under a contract knows from its first version whether and how they can be barred from it, which matters most where documents are assets: a ban also stops transfers and sales. And a list that is on may hold entries. Only the moderators may be changed by an update. 2. **The owner moderates, alone or with a fixed set.** `ContractModerators` is `ContractOwner` or `AppointedModerators(set)`: at most `SystemLimits::max_contract_moderators` (16) identities. The owner may always moderate and need not be named; it may be named, and then counts toward the 16. Naming it changes nothing about authority. Every identity named must exist: the contract create, and the contract update for the identities it adds, look each one up in state and refuse, paid, with `ContractModeratorIdentityNotFoundError` (41110). A moderator that does not exist can never sign, so naming one is a mistake, and catching it once at the declaration is cheaper than guarding every later reader of the set. Moderators act alone: there is no threshold and no vote. Neither the owner nor a moderator can be banned or suspended. An entry one of them already carries can still be lifted: a contract update may name as moderator an identity that is banned or suspended, the entry keeps binding it, and the owner or another moderator unbans or unsuspends it without demoting it first (never the identity itself: a moderation cannot target its own signer). 3. **A ban lasts until an unban; a suspension lasts until a block time.** A suspension names the block time, in milliseconds, at which it lapses. A lapsed suspension is not deleted by the clock: the first document transition of the identity that runs at or after that time executes normally and, in the same execution, sweeps the stale entry. An explicit unsuspend deletes it too. A ban supersedes a suspension: banning a suspended identity removes the suspension, and suspending a banned identity is refused. @@ -97,6 +97,54 @@ Deletions (`Delete` and `IndexOnlyDelete`) are never refused: a barred identity Basic, in their own band (10900-10949): `InvalidContractModerationConfigError` (10900), `ContractModerationSelfTargetError` (10901), `ContractModerationReasonTooLongError` (10903; 10902 is reserved). State, in their own sub-band: `ContractModerationNotEnabledError` (41100), `IdentityNotContractModeratorError` (41101), `ContractModerationTargetNotAllowedError` (41102), `ContractUserAlreadyBannedError` (41103), `ContractUserNotBannedError` (41104), `ContractUserNotSuspendedError` (41105), `ContractSuspensionNotInFutureError` (41106), `ContractUserBannedError` (41107), `ContractUserSuspendedError` (41108), `ContractModerationTargetNotFoundError` (41109), `ContractModeratorIdentityNotFoundError` (41110, from the contract create and update, not from the moderation transition), `ContractModerationCounterpartyBarredError` (41114, from the document gate; 41111 to 41113 are reserved). A contract update that turns a list on or off is refused with the existing `DataContractConfigUpdateError` (40002). +## Deleting Documents + +A banlist keeps an identity out; it does not take down what the identity already wrote. A document type may let the contract's moderators do that: + +```json +"post": { + "type": "object", + "canBeDeletedByModerators": true, + "properties": { "text": { "type": "string", "maxLength": 280, "position": 0 } }, + "additionalProperties": false +} +``` + +`canBeDeletedByModerators` is a document type keyword of meta-schema v3 (`DocumentTypeV2::documents_can_be_deleted_by_moderators`), parsed by `apply_can_be_deleted_by_moderators`. Its rules: + +- **The contract declares moderation.** The keyword on a contract without a `moderation` block is refused (`InvalidContractStructure`, 10231): moderation can not be switched on later, so nobody could ever delete anything. In return a `moderation` block may keep no list at all when at least one document type carries the keyword (`ContractModerationConfig::validate` takes that fact from the contract): a contract can moderate content without moderating users. +- **It is fixed with the type.** A contract update can not add the keyword to an existing document type or take it away (`DocumentTypeUpdateError`, 40212): authors keep the rules they wrote under. A document type an update adds may carry it. +- **It is independent of `canBeDeleted`**, which rules what a document's own owner may do. `canBeDeleted: false` with `canBeDeletedByModerators: true` is a post its author can not retract and moderation can remove. +- **Some types can not carry it**: one that keeps history (Drive refuses to delete such documents), an indexOnly one (there is no stored row to name by id), and one that restricts creation (its documents are the contract owner's, which no moderator may delete). Transferable and tradeable types may, and so may a type with a deletion token cost, which a moderator does not pay. +- **For references it counts as deletable.** A `permanentDocument` reference refuses such a type (`ReferencedDocumentTypeDeletableError`, 40122) whatever its `canBeDeleted` says, so the guarantee that a validated permanent reference never dangles holds; a `deletableDocument` reference accepts it, `canBeDeleted: false` included. Both checks, at contract registration and at document write, read "deletable" as deletable by anyone. A like or a reply that points at a post moderators can remove therefore declares `refersTo: deletableDocument`: the join reports a removed post as a missing id, and the removal record says why it is missing. + +The deletion is a fifth action of the same transition: + +```rust +ContractUserModerationAction::DeleteDocument { + document_type_name: String, + document_id: Identifier, + reason: ContractModerationReason, // as on a ban: a code nothing checks, a text that may be empty +} +``` + +It names no identity (`identity_id()` is `None`): whose document it is is only known once the document is read. The transform checks, in order and each refusal paid: the document type exists (10406), it carries the keyword (`DocumentTypeNotDeletableByModeratorsError`, 41115), the signer is the owner or a moderator (41101), the document exists (`DocumentNotFoundError`), and its owner is neither the contract owner nor a moderator (41102, the rule that protects them from a ban protects what they wrote). The document is read the way a document's own deletion reads it, billed the same. The action carries the contract, the document's owner and the block time, so Drive reads nothing again. Nothing the document type prices is charged: neither its deletion token cost nor its `actionFees` deletion fee, both of which are what a document's own owner pays for deleting it. + +Drive then runs `DocumentOperationType::DeleteDocumentByModerator`, the ordinary deletion (so every index and aggregate of the type stays right) without its `canBeDeleted` guard, which is the owner's rule and not the moderators', and writes a **removal record**: + +```rust +pub struct ContractDocumentRemoval { + pub document_owner_id: Identifier, + pub moderator_id: Identifier, + pub reason: ContractModerationReason, + pub removed_at: TimestampMillis, // the block time +} +``` + +The record is what is left to say that a document was removed, not lost: a client holding a dangling id (a reply whose parent is gone) can prove who removed it, whose it was, when and why. The moderator pays for it, reason included, and nothing ever deletes it. A record is final: from protocol version 14 a document id commits to the nonce of its create transition and is produced at most once, so the removed id can not be created again, no second removal can replace the record, and the record and a live document of that id never coexist. + +**The deleted document's owner gets no storage refund.** The batch carries `ContractModerationOperationType::ForfeitStorageRefunds`, a marker that writes nothing, and `apply_drive_operations` generation 1 turns every removal such a batch attributes to an identity into a removal attributed to nobody: the bytes still leave the system (`FeeResult::removed_bytes_from_system`), no refund is computed, and the credits stay in the storage pools they were distributed to when the document was written. An estimate carries no refund to begin with (refunds come from the flags of what is really removed), so the mempool's fee check is the same with or without the forfeiture. Forfeiting the whole batch is exact: a moderator's deletion removes the document and nothing else, since its record is written once and the nonce it bumps keeps its size. An author who deletes the same document with an ordinary document transition is refunded as always. + ## Storage ```text @@ -105,12 +153,16 @@ Basic, in their own band (10900-10949): `InvalidContractModerationConfigError` ( ├── [0] the contract (or its history subtree) ├── [1] documents └── [2] other + ├── [16] document removals -> -> + │ -> Item(owner id ‖ moderator id ‖ removed at ‖ reason) (with such a document type) ├── [64] contract version item (every contract) ├── [128] banlist -> -> Item(reason) (when declared) └── [192] suspensions -> -> Item(until ‖ reason) (when declared) ``` -`until` is a u64 of block time in milliseconds, big-endian. A reason is a tag byte (`0`: no code, `1`: a code), the code as a big-endian u16 when tagged, then the text as UTF-8 up to the end of the value, so an entry with an empty reason and no code costs one byte more than the bare entry would. A value without the tag byte is an entry written before entries carried a reason and reads as the empty reason. +`until` is a u64 of block time in milliseconds, big-endian. A reason is a tag byte (`0`: no code, `1`: a code), the code as a big-endian u16 when tagged, then the text as UTF-8 up to the end of the value, so an entry with an empty reason and no code costs one byte more than the bare entry would. A value without the tag byte is an entry written before entries carried a reason and reads as the empty reason. A document removal is the document owner's id, the moderator's id, `removed at` as a u64 of block time in milliseconds, big-endian, then the reason the same way (`types::encode_document_removal`). + +The document removals tree exists exactly when the contract has a document type that carries `canBeDeletedByModerators`: a contract without one keeps the other tree, and the shape, it would have had. One subtree per such document type is created with the type, by `insert_contract` generation 2 or by `update_contract` generation 2 for a type an update adds, and the tree above them with the first: whether it is there is read off the stored contract, since an existing type never changes the keyword, so the update needs no read. Nothing is created lazily by the first removal. The key sorts below `128`, as a key added later should: a contract that keeps both lists, the one whose other tree then holds four keys, still has the banlist on top. With fewer keys the version item is on top, and the list one level down. The contract's own subtree holds three keys whatever the contract keeps, so its Merk keeps `1`, the documents, on top: every document proof and write goes through that key, and a fourth key beside it would have pushed it one level down (a Merk built from one sorted batch roots at the middle key). Everything else a contract keeps goes into `2`, its **other tree**, which protocol version 14 introduces together with the version item. Inside, the keys are spread like the root tree's, so the tree stays balanced as it fills and the most read entry sits on top: the banlist at `128`, read by every document transition on a moderated contract, the version item at `64`, the suspension list at `192`. A key added later should sort below `128` to keep the banlist on top when four keys are created at once. @@ -128,6 +180,7 @@ The writers, readers and provers live in `packages/rs-drive/src/drive/contract/m - `getContractModerationStatus(contract_id, identity_id, lists, prove)`: the identity's status on the lists named. - `getContractModerationEntries(contract_id, list, start_after, limit, prove)`: one page of a list. +- `getContractDocumentRemovals(contract_id, document_type_name, document_ids | page, prove)`: the records of the documents moderators deleted, within one document type that carries `canBeDeletedByModerators` (no other keeps records, so the node refuses any other). By document ids, up to `max_returned_elements` of them and none twice: an id with no record is left out of the response, and proved absent by a proof. Or one page in document id order, with the last document id as the cursor. `Drive::verify_contract_document_removals` rebuilds the path query from the same request. A status query answers for the lists it names and no others: `Drive::verify_contract_moderation_status` and the SDK result both return `ContractModerationListStatuses`, one `ContractModerationListStatus` per list queried, so a list that was not read is absent rather than reported as empty (`banned()` is `None` unless the banlist was queried). `ContractModerationStatusQuery::for_contract` names every list the contract keeps; the wasm-sdk does the same, fetching the contract, when the query names no list. Both have `Fetch` and `FetchUnproved` impls in the Rust SDK (`platform::contract_moderation`), wasm-sdk functions and `contracts.moderationStatus` / `contracts.moderationEntries` on the JavaScript SDK. The proof of a moderation transition's execution covers the lists the moderation touched and is classified as affected state: an earlier or later moderation leaving the same entries verifies just the same. A ban does two things, adds the ban and removes a suspension, so its proof covers every list the contract keeps (the banlist entry present, the suspension absent), which the prover and the verifier both read from the contract's config (so the SDKs fetch and cache the contract before broadcasting a ban, as they do for the contracts a document batch touches); an unban, a suspend and an unsuspend prove the one entry they edit. The result, `VerifiedContractModerationListStatuses`, holds one `ContractModerationListStatus` per list proved, never a full status: a list that was not proved is left unknown rather than reported as empty. An identity whose unsuspend was just proved may be banned; the status query answers that. @@ -179,13 +232,18 @@ The claim's proof is verified against the contract, which names who the pot pays All in place for protocol version 14: `CONTRACT_VERSIONS_V6` makes config V2 the config of every new contract (`max_version` and `default_current_version` 2) and `validate_config_update` 2; `STATE_TRANSITION_SERIALIZATION_VERSIONS_V3` and `DRIVE_ABCI_VALIDATION_VERSIONS_V10` carry the transition's slots and `batch_state_transition.contract_moderation_gate`, and the contract update's basic structure moves to 2 to validate the declaration; `DRIVE_CONTRACT_METHOD_VERSIONS_V4` bumps `insert_contract` to 2 and adds the `moderation` table (its `update_contract` 2 belongs to token distribution and does nothing for moderation); `DRIVE_STATE_TRANSITION_METHOD_VERSIONS_V4` adds the converter slot and bumps `documents_batch_transition` to 1 for the sweep; `DRIVE_VERIFY_METHOD_VERSIONS` and `DRIVE_ABCI_QUERY_VERSIONS` gain their moderation tables; `SYSTEM_LIMITS_V4` gains `max_contract_moderators`, `max_contract_suspension_until` and `max_contract_moderation_reason_length`. +The document deletion adds, all for protocol version 14 as well: the `canBeDeletedByModerators` keyword in meta-schema v3 (`CONTRACT_VERSIONS_V6` already selects it); five slots in `DriveContractModerationMethodVersions` and one in the verify and query tables; and `batch_operations.apply_drive_operations = 1` in `DRIVE_VERSION_V9`, the generation that forfeits the refund. The transition's own tables do not move: the action joins a transition no release contains. + ## What Is Not There Yet -Action fees on token transitions, group-based moderators (`AuthorizedActionTakers::Group` through group actions), keys bound to the contract allowed to sign its moderation, ban codes declared by the contract (the reason's `code` is where they will go), further entry metadata such as a timestamp or the moderator's id, and the Swift and Kotlin SDKs. The refusal a barred identity receives (41107, 41108, 41114) does not repeat the reason: the status query does. +Deleting indexOnly documents (the action would have to carry the owner and the values), deleting every document of an identity at once, action fees on token transitions, group-based moderators (`AuthorizedActionTakers::Group` through group actions), keys bound to the contract allowed to sign its moderation, ban codes declared by the contract (the reason's `code` is where they will go), further entry metadata such as a timestamp or the moderator's id, and the Swift and Kotlin SDKs. The refusal a barred identity receives (41107, 41108, 41114) does not repeat the reason: the status query does. ## Tests +- `packages/rs-dpp/src/data_contract/document_type/class_methods/try_from_schema/v3/moderators_delete_tests.rs`: the keyword's rules; `validate_update/common`: the keyword frozen across updates. +- `packages/rs-drive/src/drive/contract/moderation/document_removal_tests.rs`: the trees created with the contract and with a document type an update adds, records written, replaced, read by ids and by page with proofs that verify to the same, the bounds of a read, estimate against applied cost, and a moderator's deletion refunding nobody where the author's own refunds the author. +- `packages/rs-drive-abci/src/query/contract_moderation_queries/contract_document_removals`: the query by ids and by page, its proof read back by the verifier, and every request it refuses. - `packages/rs-dpp/src/data_contract/config/moderation/mod.rs` and `config/methods/validate_update/v2`: the declaration's rules and the update rules. - `packages/rs-drive/src/drive/contract/moderation/tests.rs`: tree creation on insert, the trees and their entries surviving a contract update, every writer with estimation, status and page proofs, paging, the refund going to the first moderator after another one replaces its suspension, and a status proof over one list saying nothing about the other. - `packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/transformer/v0/contract_moderation_gate/mod.rs`: the gate is silent before protocol version 14 and for an unmoderated contract, and refuses each barred operation of one batch on its own while keeping the deletions. -- `packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/contract_user_moderation/tests.rs`: the whole pipeline, including the mempool refusal, the lapse sweep, the moderator set, every refusal code, the lists staying as the contract was created with them, a barred identity deleting its own documents in a block and in the mempool, a barred identity refused as the recipient of a transfer and as the seller of a purchase, the ban's proof covering the suspension it removed, lifting the entry of an identity an update made moderator, the per-list execution proof, a named owner, a create or an update naming a moderator that does not exist, an update keeping its moderators, and inactivity of the transition and of a moderated contract create or update before protocol version 14. +- `packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/contract_user_moderation/tests.rs`: the whole pipeline, including a moderator deleting a post (record, execution proof, the author's balance unchanged, and the control where the author deletes it and is refunded), every refusal of a deletion, an update adding a document type moderators can delete from, a permanent reference to such a type refused, the mempool refusal, the lapse sweep, the moderator set, every refusal code, the lists staying as the contract was created with them, a barred identity deleting its own documents in a block and in the mempool, a barred identity refused as the recipient of a transfer and as the seller of a purchase, the ban's proof covering the suspension it removed, lifting the entry of an identity an update made moderator, the per-list execution proof, a named owner, a create or an update naming a moderator that does not exist, an update keeping its moderators, and inactivity of the transition and of a moderated contract create or update before protocol version 14. diff --git a/book/src/error-handling/error-codes.md b/book/src/error-handling/error-codes.md index a62f0e2a31f..40f4812a852 100644 --- a/book/src/error-handling/error-codes.md +++ b/book/src/error-handling/error-codes.md @@ -117,7 +117,7 @@ The fee category currently has a single code. The 30000 range is reserved for fu | 40800-40804 | Groups | `IdentityNotMemberOfGroupError` (40800), `GroupActionAlreadyCompletedError` (40802) | | 40900-40904 | Shielded | `InvalidAnchorError` (40900), `NullifierAlreadySpentError` (40901), `InsufficientShieldedFeeError` (40904) | | 41000-41003 | Contract Groups | `ContractGroupAlreadyExistsError` (41000), `ContractGroupNotFoundError` (41001), `IdentityNotContractGroupOwnerOrAdminError` (41002), `ContractGroupAdminNotFoundError` (41003) | -| 41100-41114 | Contract Moderation | `ContractModerationNotEnabledError` (41100), `IdentityNotContractModeratorError` (41101), `ContractUserBannedError` (41107), `ContractUserSuspendedError` (41108), `ContractModerationTargetNotFoundError` (41109), `ContractModeratorIdentityNotFoundError` (41110), `ContractFeesAlreadyClaimedThisEpochError` (41111), `ContractFeesNothingToClaimError` (41112), `ContractFeeClaimNotAllowedError` (41113), `ContractModerationCounterpartyBarredError` (41114) | +| 41100-41115 | Contract Moderation | `ContractModerationNotEnabledError` (41100), `IdentityNotContractModeratorError` (41101), `ContractUserBannedError` (41107), `ContractUserSuspendedError` (41108), `ContractModerationTargetNotFoundError` (41109), `ContractModeratorIdentityNotFoundError` (41110), `ContractFeesAlreadyClaimedThisEpochError` (41111), `ContractFeesNothingToClaimError` (41112), `ContractFeeClaimNotAllowedError` (41113), `ContractModerationCounterpartyBarredError` (41114), `DocumentTypeNotDeletableByModeratorsError` (41115) | Notice how the `DataTriggerError` sub-enum has its own `ErrorWithCode` implementation that the `StateError` delegates to: diff --git a/packages/dapi-grpc/build.rs b/packages/dapi-grpc/build.rs index 5f699400ed5..81eef90f8de 100644 --- a/packages/dapi-grpc/build.rs +++ b/packages/dapi-grpc/build.rs @@ -86,9 +86,10 @@ 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; 65] = [ + const VERSIONED_REQUESTS: [&str; 66] = [ "GetContractModerationStatusRequest", "GetContractModerationEntriesRequest", + "GetContractDocumentRemovalsRequest", "GetContractFeePotsRequest", "GetContractGroupInfoRequest", "GetContractGroupMembersRequest", @@ -166,9 +167,10 @@ fn configure_platform(mut platform: MappingConfig) -> MappingConfig { // - "GetIdentityByNonUniquePublicKeyHashResponse" // // "GetEvonodesProposedEpochBlocksResponse" is used for 2 Requests - const VERSIONED_RESPONSES: [&str; 62] = [ + const VERSIONED_RESPONSES: [&str; 63] = [ "GetContractModerationStatusResponse", "GetContractModerationEntriesResponse", + "GetContractDocumentRemovalsResponse", "GetContractFeePotsResponse", "GetContractGroupInfoResponse", "GetContractGroupMembersResponse", 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 4275c53b36b..03cdabdc17a 100644 --- a/packages/dapi-grpc/clients/drive/v0/nodejs/drive_pbjs.js +++ b/packages/dapi-grpc/clients/drive/v0/nodejs/drive_pbjs.js @@ -1320,6 +1320,39 @@ $root.org = (function() { * @variation 2 */ + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getContractDocumentRemovals}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef getContractDocumentRemovalsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse} [response] GetContractDocumentRemovalsResponse + */ + + /** + * Calls getContractDocumentRemovals. + * @function getContractDocumentRemovals + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetContractDocumentRemovalsRequest} request GetContractDocumentRemovalsRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.getContractDocumentRemovalsCallback} callback Node-style callback called with the error, if any, and GetContractDocumentRemovalsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.getContractDocumentRemovals = function getContractDocumentRemovals(request, callback) { + return this.rpcCall(getContractDocumentRemovals, $root.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest, $root.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse, request, callback); + }, "name", { value: "getContractDocumentRemovals" }); + + /** + * Calls getContractDocumentRemovals. + * @function getContractDocumentRemovals + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetContractDocumentRemovalsRequest} request GetContractDocumentRemovalsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + /** * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getContractFeePots}. * @memberof org.dash.platform.dapi.v0.Platform @@ -27090,6 +27123,1978 @@ $root.org = (function() { return GetContractModerationEntriesResponse; })(); + v0.GetContractDocumentRemovalsRequest = (function() { + + /** + * Properties of a GetContractDocumentRemovalsRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetContractDocumentRemovalsRequest + * @property {org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.IGetContractDocumentRemovalsRequestV0|null} [v0] GetContractDocumentRemovalsRequest v0 + */ + + /** + * Constructs a new GetContractDocumentRemovalsRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetContractDocumentRemovalsRequest. + * @implements IGetContractDocumentRemovalsRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IGetContractDocumentRemovalsRequest=} [properties] Properties to set + */ + function GetContractDocumentRemovalsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetContractDocumentRemovalsRequest v0. + * @member {org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.IGetContractDocumentRemovalsRequestV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest + * @instance + */ + GetContractDocumentRemovalsRequest.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetContractDocumentRemovalsRequest version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest + * @instance + */ + Object.defineProperty(GetContractDocumentRemovalsRequest.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetContractDocumentRemovalsRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetContractDocumentRemovalsRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest} GetContractDocumentRemovalsRequest instance + */ + GetContractDocumentRemovalsRequest.create = function create(properties) { + return new GetContractDocumentRemovalsRequest(properties); + }; + + /** + * Encodes the specified GetContractDocumentRemovalsRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetContractDocumentRemovalsRequest} message GetContractDocumentRemovalsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetContractDocumentRemovalsRequest.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.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetContractDocumentRemovalsRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetContractDocumentRemovalsRequest} message GetContractDocumentRemovalsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetContractDocumentRemovalsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetContractDocumentRemovalsRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest} GetContractDocumentRemovalsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetContractDocumentRemovalsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetContractDocumentRemovalsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest} GetContractDocumentRemovalsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetContractDocumentRemovalsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetContractDocumentRemovalsRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetContractDocumentRemovalsRequest.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.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetContractDocumentRemovalsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest} GetContractDocumentRemovalsRequest + */ + GetContractDocumentRemovalsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetContractDocumentRemovalsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest + * @static + * @param {org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest} message GetContractDocumentRemovalsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetContractDocumentRemovalsRequest.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.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetContractDocumentRemovalsRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest + * @instance + * @returns {Object.} JSON object + */ + GetContractDocumentRemovalsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetContractDocumentRemovalsRequest.DocumentIds = (function() { + + /** + * Properties of a DocumentIds. + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest + * @interface IDocumentIds + * @property {Array.|null} [documentIds] DocumentIds documentIds + */ + + /** + * Constructs a new DocumentIds. + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest + * @classdesc Represents a DocumentIds. + * @implements IDocumentIds + * @constructor + * @param {org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.IDocumentIds=} [properties] Properties to set + */ + function DocumentIds(properties) { + this.documentIds = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DocumentIds documentIds. + * @member {Array.} documentIds + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.DocumentIds + * @instance + */ + DocumentIds.prototype.documentIds = $util.emptyArray; + + /** + * Creates a new DocumentIds instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.DocumentIds + * @static + * @param {org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.IDocumentIds=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.DocumentIds} DocumentIds instance + */ + DocumentIds.create = function create(properties) { + return new DocumentIds(properties); + }; + + /** + * Encodes the specified DocumentIds message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.DocumentIds.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.DocumentIds + * @static + * @param {org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.IDocumentIds} message DocumentIds message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DocumentIds.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.documentIds != null && message.documentIds.length) + for (var i = 0; i < message.documentIds.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.documentIds[i]); + return writer; + }; + + /** + * Encodes the specified DocumentIds message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.DocumentIds.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.DocumentIds + * @static + * @param {org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.IDocumentIds} message DocumentIds message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DocumentIds.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DocumentIds message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.DocumentIds + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.DocumentIds} DocumentIds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DocumentIds.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.DocumentIds(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.documentIds && message.documentIds.length)) + message.documentIds = []; + message.documentIds.push(reader.bytes()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DocumentIds message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.DocumentIds + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.DocumentIds} DocumentIds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DocumentIds.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DocumentIds message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.DocumentIds + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DocumentIds.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.documentIds != null && message.hasOwnProperty("documentIds")) { + if (!Array.isArray(message.documentIds)) + return "documentIds: array expected"; + for (var i = 0; i < message.documentIds.length; ++i) + if (!(message.documentIds[i] && typeof message.documentIds[i].length === "number" || $util.isString(message.documentIds[i]))) + return "documentIds: buffer[] expected"; + } + return null; + }; + + /** + * Creates a DocumentIds message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.DocumentIds + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.DocumentIds} DocumentIds + */ + DocumentIds.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.DocumentIds) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.DocumentIds(); + if (object.documentIds) { + if (!Array.isArray(object.documentIds)) + throw TypeError(".org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.DocumentIds.documentIds: array expected"); + message.documentIds = []; + for (var i = 0; i < object.documentIds.length; ++i) + if (typeof object.documentIds[i] === "string") + $util.base64.decode(object.documentIds[i], message.documentIds[i] = $util.newBuffer($util.base64.length(object.documentIds[i])), 0); + else if (object.documentIds[i].length >= 0) + message.documentIds[i] = object.documentIds[i]; + } + return message; + }; + + /** + * Creates a plain object from a DocumentIds message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.DocumentIds + * @static + * @param {org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.DocumentIds} message DocumentIds + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DocumentIds.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.documentIds = []; + if (message.documentIds && message.documentIds.length) { + object.documentIds = []; + for (var j = 0; j < message.documentIds.length; ++j) + object.documentIds[j] = options.bytes === String ? $util.base64.encode(message.documentIds[j], 0, message.documentIds[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.documentIds[j]) : message.documentIds[j]; + } + return object; + }; + + /** + * Converts this DocumentIds to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.DocumentIds + * @instance + * @returns {Object.} JSON object + */ + DocumentIds.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DocumentIds; + })(); + + GetContractDocumentRemovalsRequest.Page = (function() { + + /** + * Properties of a Page. + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest + * @interface IPage + * @property {Uint8Array|null} [startAfter] Page startAfter + * @property {number|null} [limit] Page limit + */ + + /** + * Constructs a new Page. + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest + * @classdesc Represents a Page. + * @implements IPage + * @constructor + * @param {org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.IPage=} [properties] Properties to set + */ + function Page(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Page startAfter. + * @member {Uint8Array} startAfter + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.Page + * @instance + */ + Page.prototype.startAfter = $util.newBuffer([]); + + /** + * Page limit. + * @member {number} limit + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.Page + * @instance + */ + Page.prototype.limit = 0; + + /** + * Creates a new Page instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.Page + * @static + * @param {org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.IPage=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.Page} Page instance + */ + Page.create = function create(properties) { + return new Page(properties); + }; + + /** + * Encodes the specified Page message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.Page.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.Page + * @static + * @param {org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.IPage} message Page message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Page.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.startAfter != null && Object.hasOwnProperty.call(message, "startAfter")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.startAfter); + if (message.limit != null && Object.hasOwnProperty.call(message, "limit")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.limit); + return writer; + }; + + /** + * Encodes the specified Page message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.Page.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.Page + * @static + * @param {org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.IPage} message Page message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Page.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Page message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.Page + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.Page} Page + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Page.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.Page(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.startAfter = reader.bytes(); + break; + case 2: + message.limit = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Page message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.Page + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.Page} Page + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Page.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Page message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.Page + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Page.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.startAfter != null && message.hasOwnProperty("startAfter")) + if (!(message.startAfter && typeof message.startAfter.length === "number" || $util.isString(message.startAfter))) + return "startAfter: buffer expected"; + if (message.limit != null && message.hasOwnProperty("limit")) + if (!$util.isInteger(message.limit)) + return "limit: integer expected"; + return null; + }; + + /** + * Creates a Page message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.Page + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.Page} Page + */ + Page.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.Page) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.Page(); + if (object.startAfter != null) + if (typeof object.startAfter === "string") + $util.base64.decode(object.startAfter, message.startAfter = $util.newBuffer($util.base64.length(object.startAfter)), 0); + else if (object.startAfter.length >= 0) + message.startAfter = object.startAfter; + if (object.limit != null) + message.limit = object.limit >>> 0; + return message; + }; + + /** + * Creates a plain object from a Page message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.Page + * @static + * @param {org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.Page} message Page + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Page.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.startAfter = ""; + else { + object.startAfter = []; + if (options.bytes !== Array) + object.startAfter = $util.newBuffer(object.startAfter); + } + object.limit = 0; + } + if (message.startAfter != null && message.hasOwnProperty("startAfter")) + object.startAfter = options.bytes === String ? $util.base64.encode(message.startAfter, 0, message.startAfter.length) : options.bytes === Array ? Array.prototype.slice.call(message.startAfter) : message.startAfter; + if (message.limit != null && message.hasOwnProperty("limit")) + object.limit = message.limit; + return object; + }; + + /** + * Converts this Page to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.Page + * @instance + * @returns {Object.} JSON object + */ + Page.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Page; + })(); + + GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0 = (function() { + + /** + * Properties of a GetContractDocumentRemovalsRequestV0. + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest + * @interface IGetContractDocumentRemovalsRequestV0 + * @property {Uint8Array|null} [contractId] GetContractDocumentRemovalsRequestV0 contractId + * @property {string|null} [documentTypeName] GetContractDocumentRemovalsRequestV0 documentTypeName + * @property {org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.IDocumentIds|null} [documentIds] GetContractDocumentRemovalsRequestV0 documentIds + * @property {org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.IPage|null} [page] GetContractDocumentRemovalsRequestV0 page + * @property {boolean|null} [prove] GetContractDocumentRemovalsRequestV0 prove + */ + + /** + * Constructs a new GetContractDocumentRemovalsRequestV0. + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest + * @classdesc Represents a GetContractDocumentRemovalsRequestV0. + * @implements IGetContractDocumentRemovalsRequestV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.IGetContractDocumentRemovalsRequestV0=} [properties] Properties to set + */ + function GetContractDocumentRemovalsRequestV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetContractDocumentRemovalsRequestV0 contractId. + * @member {Uint8Array} contractId + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0 + * @instance + */ + GetContractDocumentRemovalsRequestV0.prototype.contractId = $util.newBuffer([]); + + /** + * GetContractDocumentRemovalsRequestV0 documentTypeName. + * @member {string} documentTypeName + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0 + * @instance + */ + GetContractDocumentRemovalsRequestV0.prototype.documentTypeName = ""; + + /** + * GetContractDocumentRemovalsRequestV0 documentIds. + * @member {org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.IDocumentIds|null|undefined} documentIds + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0 + * @instance + */ + GetContractDocumentRemovalsRequestV0.prototype.documentIds = null; + + /** + * GetContractDocumentRemovalsRequestV0 page. + * @member {org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.IPage|null|undefined} page + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0 + * @instance + */ + GetContractDocumentRemovalsRequestV0.prototype.page = null; + + /** + * GetContractDocumentRemovalsRequestV0 prove. + * @member {boolean} prove + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0 + * @instance + */ + GetContractDocumentRemovalsRequestV0.prototype.prove = false; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetContractDocumentRemovalsRequestV0 selection. + * @member {"documentIds"|"page"|undefined} selection + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0 + * @instance + */ + Object.defineProperty(GetContractDocumentRemovalsRequestV0.prototype, "selection", { + get: $util.oneOfGetter($oneOfFields = ["documentIds", "page"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetContractDocumentRemovalsRequestV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.IGetContractDocumentRemovalsRequestV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0} GetContractDocumentRemovalsRequestV0 instance + */ + GetContractDocumentRemovalsRequestV0.create = function create(properties) { + return new GetContractDocumentRemovalsRequestV0(properties); + }; + + /** + * Encodes the specified GetContractDocumentRemovalsRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.IGetContractDocumentRemovalsRequestV0} message GetContractDocumentRemovalsRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetContractDocumentRemovalsRequestV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.contractId != null && Object.hasOwnProperty.call(message, "contractId")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.contractId); + if (message.documentTypeName != null && Object.hasOwnProperty.call(message, "documentTypeName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.documentTypeName); + if (message.documentIds != null && Object.hasOwnProperty.call(message, "documentIds")) + $root.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.DocumentIds.encode(message.documentIds, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.page != null && Object.hasOwnProperty.call(message, "page")) + $root.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.Page.encode(message.page, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.prove); + return writer; + }; + + /** + * Encodes the specified GetContractDocumentRemovalsRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.IGetContractDocumentRemovalsRequestV0} message GetContractDocumentRemovalsRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetContractDocumentRemovalsRequestV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetContractDocumentRemovalsRequestV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0} GetContractDocumentRemovalsRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetContractDocumentRemovalsRequestV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.contractId = reader.bytes(); + break; + case 2: + message.documentTypeName = reader.string(); + break; + case 3: + message.documentIds = $root.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.DocumentIds.decode(reader, reader.uint32()); + break; + case 4: + message.page = $root.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.Page.decode(reader, reader.uint32()); + break; + case 5: + message.prove = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetContractDocumentRemovalsRequestV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0} GetContractDocumentRemovalsRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetContractDocumentRemovalsRequestV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetContractDocumentRemovalsRequestV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetContractDocumentRemovalsRequestV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.contractId != null && message.hasOwnProperty("contractId")) + if (!(message.contractId && typeof message.contractId.length === "number" || $util.isString(message.contractId))) + return "contractId: buffer expected"; + if (message.documentTypeName != null && message.hasOwnProperty("documentTypeName")) + if (!$util.isString(message.documentTypeName)) + return "documentTypeName: string expected"; + if (message.documentIds != null && message.hasOwnProperty("documentIds")) { + properties.selection = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.DocumentIds.verify(message.documentIds); + if (error) + return "documentIds." + error; + } + } + if (message.page != null && message.hasOwnProperty("page")) { + if (properties.selection === 1) + return "selection: multiple values"; + properties.selection = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.Page.verify(message.page); + if (error) + return "page." + error; + } + } + if (message.prove != null && message.hasOwnProperty("prove")) + if (typeof message.prove !== "boolean") + return "prove: boolean expected"; + return null; + }; + + /** + * Creates a GetContractDocumentRemovalsRequestV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0} GetContractDocumentRemovalsRequestV0 + */ + GetContractDocumentRemovalsRequestV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0(); + if (object.contractId != null) + if (typeof object.contractId === "string") + $util.base64.decode(object.contractId, message.contractId = $util.newBuffer($util.base64.length(object.contractId)), 0); + else if (object.contractId.length >= 0) + message.contractId = object.contractId; + if (object.documentTypeName != null) + message.documentTypeName = String(object.documentTypeName); + if (object.documentIds != null) { + if (typeof object.documentIds !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0.documentIds: object expected"); + message.documentIds = $root.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.DocumentIds.fromObject(object.documentIds); + } + if (object.page != null) { + if (typeof object.page !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0.page: object expected"); + message.page = $root.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.Page.fromObject(object.page); + } + if (object.prove != null) + message.prove = Boolean(object.prove); + return message; + }; + + /** + * Creates a plain object from a GetContractDocumentRemovalsRequestV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0} message GetContractDocumentRemovalsRequestV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetContractDocumentRemovalsRequestV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.contractId = ""; + else { + object.contractId = []; + if (options.bytes !== Array) + object.contractId = $util.newBuffer(object.contractId); + } + object.documentTypeName = ""; + object.prove = false; + } + if (message.contractId != null && message.hasOwnProperty("contractId")) + object.contractId = options.bytes === String ? $util.base64.encode(message.contractId, 0, message.contractId.length) : options.bytes === Array ? Array.prototype.slice.call(message.contractId) : message.contractId; + if (message.documentTypeName != null && message.hasOwnProperty("documentTypeName")) + object.documentTypeName = message.documentTypeName; + if (message.documentIds != null && message.hasOwnProperty("documentIds")) { + object.documentIds = $root.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.DocumentIds.toObject(message.documentIds, options); + if (options.oneofs) + object.selection = "documentIds"; + } + if (message.page != null && message.hasOwnProperty("page")) { + object.page = $root.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.Page.toObject(message.page, options); + if (options.oneofs) + object.selection = "page"; + } + if (message.prove != null && message.hasOwnProperty("prove")) + object.prove = message.prove; + return object; + }; + + /** + * Converts this GetContractDocumentRemovalsRequestV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0 + * @instance + * @returns {Object.} JSON object + */ + GetContractDocumentRemovalsRequestV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetContractDocumentRemovalsRequestV0; + })(); + + return GetContractDocumentRemovalsRequest; + })(); + + v0.GetContractDocumentRemovalsResponse = (function() { + + /** + * Properties of a GetContractDocumentRemovalsResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetContractDocumentRemovalsResponse + * @property {org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.IGetContractDocumentRemovalsResponseV0|null} [v0] GetContractDocumentRemovalsResponse v0 + */ + + /** + * Constructs a new GetContractDocumentRemovalsResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetContractDocumentRemovalsResponse. + * @implements IGetContractDocumentRemovalsResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IGetContractDocumentRemovalsResponse=} [properties] Properties to set + */ + function GetContractDocumentRemovalsResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetContractDocumentRemovalsResponse v0. + * @member {org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.IGetContractDocumentRemovalsResponseV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse + * @instance + */ + GetContractDocumentRemovalsResponse.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetContractDocumentRemovalsResponse version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse + * @instance + */ + Object.defineProperty(GetContractDocumentRemovalsResponse.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetContractDocumentRemovalsResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetContractDocumentRemovalsResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse} GetContractDocumentRemovalsResponse instance + */ + GetContractDocumentRemovalsResponse.create = function create(properties) { + return new GetContractDocumentRemovalsResponse(properties); + }; + + /** + * Encodes the specified GetContractDocumentRemovalsResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetContractDocumentRemovalsResponse} message GetContractDocumentRemovalsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetContractDocumentRemovalsResponse.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.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetContractDocumentRemovalsResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetContractDocumentRemovalsResponse} message GetContractDocumentRemovalsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetContractDocumentRemovalsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetContractDocumentRemovalsResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse} GetContractDocumentRemovalsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetContractDocumentRemovalsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetContractDocumentRemovalsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse} GetContractDocumentRemovalsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetContractDocumentRemovalsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetContractDocumentRemovalsResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetContractDocumentRemovalsResponse.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.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetContractDocumentRemovalsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse} GetContractDocumentRemovalsResponse + */ + GetContractDocumentRemovalsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetContractDocumentRemovalsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse + * @static + * @param {org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse} message GetContractDocumentRemovalsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetContractDocumentRemovalsResponse.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.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetContractDocumentRemovalsResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse + * @instance + * @returns {Object.} JSON object + */ + GetContractDocumentRemovalsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetContractDocumentRemovalsResponse.ContractDocumentRemoval = (function() { + + /** + * Properties of a ContractDocumentRemoval. + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse + * @interface IContractDocumentRemoval + * @property {Uint8Array|null} [documentId] ContractDocumentRemoval documentId + * @property {Uint8Array|null} [documentOwnerId] ContractDocumentRemoval documentOwnerId + * @property {Uint8Array|null} [moderatorId] ContractDocumentRemoval moderatorId + * @property {number|Long|null} [removedAt] ContractDocumentRemoval removedAt + * @property {org.dash.platform.dapi.v0.IContractModerationReason|null} [reason] ContractDocumentRemoval reason + */ + + /** + * Constructs a new ContractDocumentRemoval. + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse + * @classdesc Represents a ContractDocumentRemoval. + * @implements IContractDocumentRemoval + * @constructor + * @param {org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.IContractDocumentRemoval=} [properties] Properties to set + */ + function ContractDocumentRemoval(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ContractDocumentRemoval documentId. + * @member {Uint8Array} documentId + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval + * @instance + */ + ContractDocumentRemoval.prototype.documentId = $util.newBuffer([]); + + /** + * ContractDocumentRemoval documentOwnerId. + * @member {Uint8Array} documentOwnerId + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval + * @instance + */ + ContractDocumentRemoval.prototype.documentOwnerId = $util.newBuffer([]); + + /** + * ContractDocumentRemoval moderatorId. + * @member {Uint8Array} moderatorId + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval + * @instance + */ + ContractDocumentRemoval.prototype.moderatorId = $util.newBuffer([]); + + /** + * ContractDocumentRemoval removedAt. + * @member {number|Long} removedAt + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval + * @instance + */ + ContractDocumentRemoval.prototype.removedAt = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * ContractDocumentRemoval reason. + * @member {org.dash.platform.dapi.v0.IContractModerationReason|null|undefined} reason + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval + * @instance + */ + ContractDocumentRemoval.prototype.reason = null; + + /** + * Creates a new ContractDocumentRemoval instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval + * @static + * @param {org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.IContractDocumentRemoval=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval} ContractDocumentRemoval instance + */ + ContractDocumentRemoval.create = function create(properties) { + return new ContractDocumentRemoval(properties); + }; + + /** + * Encodes the specified ContractDocumentRemoval message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval + * @static + * @param {org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.IContractDocumentRemoval} message ContractDocumentRemoval message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContractDocumentRemoval.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.documentId != null && Object.hasOwnProperty.call(message, "documentId")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.documentId); + if (message.documentOwnerId != null && Object.hasOwnProperty.call(message, "documentOwnerId")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.documentOwnerId); + if (message.moderatorId != null && Object.hasOwnProperty.call(message, "moderatorId")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.moderatorId); + if (message.removedAt != null && Object.hasOwnProperty.call(message, "removedAt")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.removedAt); + if (message.reason != null && Object.hasOwnProperty.call(message, "reason")) + $root.org.dash.platform.dapi.v0.ContractModerationReason.encode(message.reason, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ContractDocumentRemoval message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval + * @static + * @param {org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.IContractDocumentRemoval} message ContractDocumentRemoval message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContractDocumentRemoval.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ContractDocumentRemoval message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval} ContractDocumentRemoval + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContractDocumentRemoval.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.documentId = reader.bytes(); + break; + case 2: + message.documentOwnerId = reader.bytes(); + break; + case 3: + message.moderatorId = reader.bytes(); + break; + case 4: + message.removedAt = reader.uint64(); + break; + case 5: + message.reason = $root.org.dash.platform.dapi.v0.ContractModerationReason.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ContractDocumentRemoval message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval} ContractDocumentRemoval + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContractDocumentRemoval.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ContractDocumentRemoval message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ContractDocumentRemoval.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.documentId != null && message.hasOwnProperty("documentId")) + if (!(message.documentId && typeof message.documentId.length === "number" || $util.isString(message.documentId))) + return "documentId: buffer expected"; + if (message.documentOwnerId != null && message.hasOwnProperty("documentOwnerId")) + if (!(message.documentOwnerId && typeof message.documentOwnerId.length === "number" || $util.isString(message.documentOwnerId))) + return "documentOwnerId: buffer expected"; + if (message.moderatorId != null && message.hasOwnProperty("moderatorId")) + if (!(message.moderatorId && typeof message.moderatorId.length === "number" || $util.isString(message.moderatorId))) + return "moderatorId: buffer expected"; + if (message.removedAt != null && message.hasOwnProperty("removedAt")) + if (!$util.isInteger(message.removedAt) && !(message.removedAt && $util.isInteger(message.removedAt.low) && $util.isInteger(message.removedAt.high))) + return "removedAt: integer|Long expected"; + if (message.reason != null && message.hasOwnProperty("reason")) { + var error = $root.org.dash.platform.dapi.v0.ContractModerationReason.verify(message.reason); + if (error) + return "reason." + error; + } + return null; + }; + + /** + * Creates a ContractDocumentRemoval message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval} ContractDocumentRemoval + */ + ContractDocumentRemoval.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval(); + if (object.documentId != null) + if (typeof object.documentId === "string") + $util.base64.decode(object.documentId, message.documentId = $util.newBuffer($util.base64.length(object.documentId)), 0); + else if (object.documentId.length >= 0) + message.documentId = object.documentId; + if (object.documentOwnerId != null) + if (typeof object.documentOwnerId === "string") + $util.base64.decode(object.documentOwnerId, message.documentOwnerId = $util.newBuffer($util.base64.length(object.documentOwnerId)), 0); + else if (object.documentOwnerId.length >= 0) + message.documentOwnerId = object.documentOwnerId; + if (object.moderatorId != null) + if (typeof object.moderatorId === "string") + $util.base64.decode(object.moderatorId, message.moderatorId = $util.newBuffer($util.base64.length(object.moderatorId)), 0); + else if (object.moderatorId.length >= 0) + message.moderatorId = object.moderatorId; + if (object.removedAt != null) + if ($util.Long) + (message.removedAt = $util.Long.fromValue(object.removedAt)).unsigned = true; + else if (typeof object.removedAt === "string") + message.removedAt = parseInt(object.removedAt, 10); + else if (typeof object.removedAt === "number") + message.removedAt = object.removedAt; + else if (typeof object.removedAt === "object") + message.removedAt = new $util.LongBits(object.removedAt.low >>> 0, object.removedAt.high >>> 0).toNumber(true); + if (object.reason != null) { + if (typeof object.reason !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval.reason: object expected"); + message.reason = $root.org.dash.platform.dapi.v0.ContractModerationReason.fromObject(object.reason); + } + return message; + }; + + /** + * Creates a plain object from a ContractDocumentRemoval message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval + * @static + * @param {org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval} message ContractDocumentRemoval + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ContractDocumentRemoval.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.documentId = ""; + else { + object.documentId = []; + if (options.bytes !== Array) + object.documentId = $util.newBuffer(object.documentId); + } + if (options.bytes === String) + object.documentOwnerId = ""; + else { + object.documentOwnerId = []; + if (options.bytes !== Array) + object.documentOwnerId = $util.newBuffer(object.documentOwnerId); + } + if (options.bytes === String) + object.moderatorId = ""; + else { + object.moderatorId = []; + if (options.bytes !== Array) + object.moderatorId = $util.newBuffer(object.moderatorId); + } + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.removedAt = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.removedAt = options.longs === String ? "0" : 0; + object.reason = null; + } + if (message.documentId != null && message.hasOwnProperty("documentId")) + object.documentId = options.bytes === String ? $util.base64.encode(message.documentId, 0, message.documentId.length) : options.bytes === Array ? Array.prototype.slice.call(message.documentId) : message.documentId; + if (message.documentOwnerId != null && message.hasOwnProperty("documentOwnerId")) + object.documentOwnerId = options.bytes === String ? $util.base64.encode(message.documentOwnerId, 0, message.documentOwnerId.length) : options.bytes === Array ? Array.prototype.slice.call(message.documentOwnerId) : message.documentOwnerId; + if (message.moderatorId != null && message.hasOwnProperty("moderatorId")) + object.moderatorId = options.bytes === String ? $util.base64.encode(message.moderatorId, 0, message.moderatorId.length) : options.bytes === Array ? Array.prototype.slice.call(message.moderatorId) : message.moderatorId; + if (message.removedAt != null && message.hasOwnProperty("removedAt")) + if (typeof message.removedAt === "number") + object.removedAt = options.longs === String ? String(message.removedAt) : message.removedAt; + else + object.removedAt = options.longs === String ? $util.Long.prototype.toString.call(message.removedAt) : options.longs === Number ? new $util.LongBits(message.removedAt.low >>> 0, message.removedAt.high >>> 0).toNumber(true) : message.removedAt; + if (message.reason != null && message.hasOwnProperty("reason")) + object.reason = $root.org.dash.platform.dapi.v0.ContractModerationReason.toObject(message.reason, options); + return object; + }; + + /** + * Converts this ContractDocumentRemoval to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval + * @instance + * @returns {Object.} JSON object + */ + ContractDocumentRemoval.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ContractDocumentRemoval; + })(); + + GetContractDocumentRemovalsResponse.ContractDocumentRemovals = (function() { + + /** + * Properties of a ContractDocumentRemovals. + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse + * @interface IContractDocumentRemovals + * @property {Array.|null} [removals] ContractDocumentRemovals removals + */ + + /** + * Constructs a new ContractDocumentRemovals. + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse + * @classdesc Represents a ContractDocumentRemovals. + * @implements IContractDocumentRemovals + * @constructor + * @param {org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.IContractDocumentRemovals=} [properties] Properties to set + */ + function ContractDocumentRemovals(properties) { + this.removals = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ContractDocumentRemovals removals. + * @member {Array.} removals + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemovals + * @instance + */ + ContractDocumentRemovals.prototype.removals = $util.emptyArray; + + /** + * Creates a new ContractDocumentRemovals instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemovals + * @static + * @param {org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.IContractDocumentRemovals=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemovals} ContractDocumentRemovals instance + */ + ContractDocumentRemovals.create = function create(properties) { + return new ContractDocumentRemovals(properties); + }; + + /** + * Encodes the specified ContractDocumentRemovals message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemovals.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemovals + * @static + * @param {org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.IContractDocumentRemovals} message ContractDocumentRemovals message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContractDocumentRemovals.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.removals != null && message.removals.length) + for (var i = 0; i < message.removals.length; ++i) + $root.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval.encode(message.removals[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ContractDocumentRemovals message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemovals.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemovals + * @static + * @param {org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.IContractDocumentRemovals} message ContractDocumentRemovals message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContractDocumentRemovals.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ContractDocumentRemovals message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemovals + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemovals} ContractDocumentRemovals + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContractDocumentRemovals.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemovals(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.removals && message.removals.length)) + message.removals = []; + message.removals.push($root.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ContractDocumentRemovals message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemovals + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemovals} ContractDocumentRemovals + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContractDocumentRemovals.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ContractDocumentRemovals message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemovals + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ContractDocumentRemovals.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.removals != null && message.hasOwnProperty("removals")) { + if (!Array.isArray(message.removals)) + return "removals: array expected"; + for (var i = 0; i < message.removals.length; ++i) { + var error = $root.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval.verify(message.removals[i]); + if (error) + return "removals." + error; + } + } + return null; + }; + + /** + * Creates a ContractDocumentRemovals message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemovals + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemovals} ContractDocumentRemovals + */ + ContractDocumentRemovals.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemovals) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemovals(); + if (object.removals) { + if (!Array.isArray(object.removals)) + throw TypeError(".org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemovals.removals: array expected"); + message.removals = []; + for (var i = 0; i < object.removals.length; ++i) { + if (typeof object.removals[i] !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemovals.removals: object expected"); + message.removals[i] = $root.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval.fromObject(object.removals[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ContractDocumentRemovals message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemovals + * @static + * @param {org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemovals} message ContractDocumentRemovals + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ContractDocumentRemovals.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.removals = []; + if (message.removals && message.removals.length) { + object.removals = []; + for (var j = 0; j < message.removals.length; ++j) + object.removals[j] = $root.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval.toObject(message.removals[j], options); + } + return object; + }; + + /** + * Converts this ContractDocumentRemovals to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemovals + * @instance + * @returns {Object.} JSON object + */ + ContractDocumentRemovals.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ContractDocumentRemovals; + })(); + + GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0 = (function() { + + /** + * Properties of a GetContractDocumentRemovalsResponseV0. + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse + * @interface IGetContractDocumentRemovalsResponseV0 + * @property {org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.IContractDocumentRemovals|null} [removals] GetContractDocumentRemovalsResponseV0 removals + * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetContractDocumentRemovalsResponseV0 proof + * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetContractDocumentRemovalsResponseV0 metadata + */ + + /** + * Constructs a new GetContractDocumentRemovalsResponseV0. + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse + * @classdesc Represents a GetContractDocumentRemovalsResponseV0. + * @implements IGetContractDocumentRemovalsResponseV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.IGetContractDocumentRemovalsResponseV0=} [properties] Properties to set + */ + function GetContractDocumentRemovalsResponseV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetContractDocumentRemovalsResponseV0 removals. + * @member {org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.IContractDocumentRemovals|null|undefined} removals + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0 + * @instance + */ + GetContractDocumentRemovalsResponseV0.prototype.removals = null; + + /** + * GetContractDocumentRemovalsResponseV0 proof. + * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0 + * @instance + */ + GetContractDocumentRemovalsResponseV0.prototype.proof = null; + + /** + * GetContractDocumentRemovalsResponseV0 metadata. + * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0 + * @instance + */ + GetContractDocumentRemovalsResponseV0.prototype.metadata = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetContractDocumentRemovalsResponseV0 result. + * @member {"removals"|"proof"|undefined} result + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0 + * @instance + */ + Object.defineProperty(GetContractDocumentRemovalsResponseV0.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["removals", "proof"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetContractDocumentRemovalsResponseV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.IGetContractDocumentRemovalsResponseV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0} GetContractDocumentRemovalsResponseV0 instance + */ + GetContractDocumentRemovalsResponseV0.create = function create(properties) { + return new GetContractDocumentRemovalsResponseV0(properties); + }; + + /** + * Encodes the specified GetContractDocumentRemovalsResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.IGetContractDocumentRemovalsResponseV0} message GetContractDocumentRemovalsResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetContractDocumentRemovalsResponseV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.removals != null && Object.hasOwnProperty.call(message, "removals")) + $root.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemovals.encode(message.removals, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetContractDocumentRemovalsResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.IGetContractDocumentRemovalsResponseV0} message GetContractDocumentRemovalsResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetContractDocumentRemovalsResponseV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetContractDocumentRemovalsResponseV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0} GetContractDocumentRemovalsResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetContractDocumentRemovalsResponseV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.removals = $root.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemovals.decode(reader, reader.uint32()); + break; + case 2: + message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); + break; + case 3: + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetContractDocumentRemovalsResponseV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0} GetContractDocumentRemovalsResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetContractDocumentRemovalsResponseV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetContractDocumentRemovalsResponseV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetContractDocumentRemovalsResponseV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.removals != null && message.hasOwnProperty("removals")) { + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemovals.verify(message.removals); + if (error) + return "removals." + error; + } + } + if (message.proof != null && message.hasOwnProperty("proof")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); + if (error) + return "proof." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a GetContractDocumentRemovalsResponseV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0} GetContractDocumentRemovalsResponseV0 + */ + GetContractDocumentRemovalsResponseV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0(); + if (object.removals != null) { + if (typeof object.removals !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0.removals: object expected"); + message.removals = $root.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemovals.fromObject(object.removals); + } + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0.proof: object expected"); + message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0.metadata: object expected"); + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a GetContractDocumentRemovalsResponseV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0} message GetContractDocumentRemovalsResponseV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetContractDocumentRemovalsResponseV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.metadata = null; + if (message.removals != null && message.hasOwnProperty("removals")) { + object.removals = $root.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemovals.toObject(message.removals, options); + if (options.oneofs) + object.result = "removals"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); + if (options.oneofs) + object.result = "proof"; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this GetContractDocumentRemovalsResponseV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0 + * @instance + * @returns {Object.} JSON object + */ + GetContractDocumentRemovalsResponseV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetContractDocumentRemovalsResponseV0; + })(); + + return GetContractDocumentRemovalsResponse; + })(); + v0.GetContractFeePotsRequest = (function() { /** 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 04c2985c561..32d9808a577 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 @@ -697,6 +697,37 @@ org.dash.platform.dapi.v0.PlatformOuterClass.GetContractModerationEntriesRespons return getGetContractModerationEntriesMethod; } + private static volatile io.grpc.MethodDescriptor getGetContractDocumentRemovalsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "getContractDocumentRemovals", + requestType = org.dash.platform.dapi.v0.PlatformOuterClass.GetContractDocumentRemovalsRequest.class, + responseType = org.dash.platform.dapi.v0.PlatformOuterClass.GetContractDocumentRemovalsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getGetContractDocumentRemovalsMethod() { + io.grpc.MethodDescriptor getGetContractDocumentRemovalsMethod; + if ((getGetContractDocumentRemovalsMethod = PlatformGrpc.getGetContractDocumentRemovalsMethod) == null) { + synchronized (PlatformGrpc.class) { + if ((getGetContractDocumentRemovalsMethod = PlatformGrpc.getGetContractDocumentRemovalsMethod) == null) { + PlatformGrpc.getGetContractDocumentRemovalsMethod = getGetContractDocumentRemovalsMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "getContractDocumentRemovals")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + org.dash.platform.dapi.v0.PlatformOuterClass.GetContractDocumentRemovalsRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + org.dash.platform.dapi.v0.PlatformOuterClass.GetContractDocumentRemovalsResponse.getDefaultInstance())) + .setSchemaDescriptor(new PlatformMethodDescriptorSupplier("getContractDocumentRemovals")) + .build(); + } + } + } + return getGetContractDocumentRemovalsMethod; + } + private static volatile io.grpc.MethodDescriptor getGetContractFeePotsMethod; @@ -2359,6 +2390,13 @@ public void getContractModerationEntries(org.dash.platform.dapi.v0.PlatformOuter io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetContractModerationEntriesMethod(), responseObserver); } + /** + */ + public void getContractDocumentRemovals(org.dash.platform.dapi.v0.PlatformOuterClass.GetContractDocumentRemovalsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetContractDocumentRemovalsMethod(), responseObserver); + } + /** */ public void getContractFeePots(org.dash.platform.dapi.v0.PlatformOuterClass.GetContractFeePotsRequest request, @@ -2862,6 +2900,13 @@ public void getShieldedNullifiers(org.dash.platform.dapi.v0.PlatformOuterClass.G org.dash.platform.dapi.v0.PlatformOuterClass.GetContractModerationEntriesRequest, org.dash.platform.dapi.v0.PlatformOuterClass.GetContractModerationEntriesResponse>( this, METHODID_GET_CONTRACT_MODERATION_ENTRIES))) + .addMethod( + getGetContractDocumentRemovalsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + org.dash.platform.dapi.v0.PlatformOuterClass.GetContractDocumentRemovalsRequest, + org.dash.platform.dapi.v0.PlatformOuterClass.GetContractDocumentRemovalsResponse>( + this, METHODID_GET_CONTRACT_DOCUMENT_REMOVALS))) .addMethod( getGetContractFeePotsMethod(), io.grpc.stub.ServerCalls.asyncUnaryCall( @@ -3388,6 +3433,14 @@ public void getContractModerationEntries(org.dash.platform.dapi.v0.PlatformOuter getChannel().newCall(getGetContractModerationEntriesMethod(), getCallOptions()), request, responseObserver); } + /** + */ + public void getContractDocumentRemovals(org.dash.platform.dapi.v0.PlatformOuterClass.GetContractDocumentRemovalsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetContractDocumentRemovalsMethod(), getCallOptions()), request, responseObserver); + } + /** */ public void getContractFeePots(org.dash.platform.dapi.v0.PlatformOuterClass.GetContractFeePotsRequest request, @@ -3954,6 +4007,13 @@ public org.dash.platform.dapi.v0.PlatformOuterClass.GetContractModerationEntries getChannel(), getGetContractModerationEntriesMethod(), getCallOptions(), request); } + /** + */ + public org.dash.platform.dapi.v0.PlatformOuterClass.GetContractDocumentRemovalsResponse getContractDocumentRemovals(org.dash.platform.dapi.v0.PlatformOuterClass.GetContractDocumentRemovalsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetContractDocumentRemovalsMethod(), getCallOptions(), request); + } + /** */ public org.dash.platform.dapi.v0.PlatformOuterClass.GetContractFeePotsResponse getContractFeePots(org.dash.platform.dapi.v0.PlatformOuterClass.GetContractFeePotsRequest request) { @@ -4495,6 +4555,14 @@ public com.google.common.util.concurrent.ListenableFuture getContractDocumentRemovals( + org.dash.platform.dapi.v0.PlatformOuterClass.GetContractDocumentRemovalsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetContractDocumentRemovalsMethod(), getCallOptions()), request); + } + /** */ public com.google.common.util.concurrent.ListenableFuture getContractFeePots( @@ -4912,53 +4980,54 @@ public com.google.common.util.concurrent.ListenableFuture implements io.grpc.stub.ServerCalls.UnaryMethod, @@ -5065,6 +5134,10 @@ public void invoke(Req request, io.grpc.stub.StreamObserver responseObserv serviceImpl.getContractModerationEntries((org.dash.platform.dapi.v0.PlatformOuterClass.GetContractModerationEntriesRequest) request, (io.grpc.stub.StreamObserver) responseObserver); break; + case METHODID_GET_CONTRACT_DOCUMENT_REMOVALS: + serviceImpl.getContractDocumentRemovals((org.dash.platform.dapi.v0.PlatformOuterClass.GetContractDocumentRemovalsRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; case METHODID_GET_CONTRACT_FEE_POTS: serviceImpl.getContractFeePots((org.dash.platform.dapi.v0.PlatformOuterClass.GetContractFeePotsRequest) request, (io.grpc.stub.StreamObserver) responseObserver); @@ -5336,6 +5409,7 @@ public static io.grpc.ServiceDescriptor getServiceDescriptor() { .addMethod(getGetContractGroupsForContractMethod()) .addMethod(getGetContractModerationStatusMethod()) .addMethod(getGetContractModerationEntriesMethod()) + .addMethod(getGetContractDocumentRemovalsMethod()) .addMethod(getGetContractFeePotsMethod()) .addMethod(getGetDocumentHistoryMethod()) .addMethod(getGetDocumentsMethod()) 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 7e1624fa210..ac244335653 100644 --- a/packages/dapi-grpc/clients/platform/v0/nodejs/platform_pbjs.js +++ b/packages/dapi-grpc/clients/platform/v0/nodejs/platform_pbjs.js @@ -812,6 +812,39 @@ $root.org = (function() { * @variation 2 */ + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getContractDocumentRemovals}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef getContractDocumentRemovalsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse} [response] GetContractDocumentRemovalsResponse + */ + + /** + * Calls getContractDocumentRemovals. + * @function getContractDocumentRemovals + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetContractDocumentRemovalsRequest} request GetContractDocumentRemovalsRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.getContractDocumentRemovalsCallback} callback Node-style callback called with the error, if any, and GetContractDocumentRemovalsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.getContractDocumentRemovals = function getContractDocumentRemovals(request, callback) { + return this.rpcCall(getContractDocumentRemovals, $root.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest, $root.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse, request, callback); + }, "name", { value: "getContractDocumentRemovals" }); + + /** + * Calls getContractDocumentRemovals. + * @function getContractDocumentRemovals + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetContractDocumentRemovalsRequest} request GetContractDocumentRemovalsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + /** * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getContractFeePots}. * @memberof org.dash.platform.dapi.v0.Platform @@ -26582,6 +26615,1978 @@ $root.org = (function() { return GetContractModerationEntriesResponse; })(); + v0.GetContractDocumentRemovalsRequest = (function() { + + /** + * Properties of a GetContractDocumentRemovalsRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetContractDocumentRemovalsRequest + * @property {org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.IGetContractDocumentRemovalsRequestV0|null} [v0] GetContractDocumentRemovalsRequest v0 + */ + + /** + * Constructs a new GetContractDocumentRemovalsRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetContractDocumentRemovalsRequest. + * @implements IGetContractDocumentRemovalsRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IGetContractDocumentRemovalsRequest=} [properties] Properties to set + */ + function GetContractDocumentRemovalsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetContractDocumentRemovalsRequest v0. + * @member {org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.IGetContractDocumentRemovalsRequestV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest + * @instance + */ + GetContractDocumentRemovalsRequest.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetContractDocumentRemovalsRequest version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest + * @instance + */ + Object.defineProperty(GetContractDocumentRemovalsRequest.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetContractDocumentRemovalsRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetContractDocumentRemovalsRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest} GetContractDocumentRemovalsRequest instance + */ + GetContractDocumentRemovalsRequest.create = function create(properties) { + return new GetContractDocumentRemovalsRequest(properties); + }; + + /** + * Encodes the specified GetContractDocumentRemovalsRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetContractDocumentRemovalsRequest} message GetContractDocumentRemovalsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetContractDocumentRemovalsRequest.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.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetContractDocumentRemovalsRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetContractDocumentRemovalsRequest} message GetContractDocumentRemovalsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetContractDocumentRemovalsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetContractDocumentRemovalsRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest} GetContractDocumentRemovalsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetContractDocumentRemovalsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetContractDocumentRemovalsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest} GetContractDocumentRemovalsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetContractDocumentRemovalsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetContractDocumentRemovalsRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetContractDocumentRemovalsRequest.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.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetContractDocumentRemovalsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest} GetContractDocumentRemovalsRequest + */ + GetContractDocumentRemovalsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetContractDocumentRemovalsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest + * @static + * @param {org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest} message GetContractDocumentRemovalsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetContractDocumentRemovalsRequest.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.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetContractDocumentRemovalsRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest + * @instance + * @returns {Object.} JSON object + */ + GetContractDocumentRemovalsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetContractDocumentRemovalsRequest.DocumentIds = (function() { + + /** + * Properties of a DocumentIds. + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest + * @interface IDocumentIds + * @property {Array.|null} [documentIds] DocumentIds documentIds + */ + + /** + * Constructs a new DocumentIds. + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest + * @classdesc Represents a DocumentIds. + * @implements IDocumentIds + * @constructor + * @param {org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.IDocumentIds=} [properties] Properties to set + */ + function DocumentIds(properties) { + this.documentIds = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DocumentIds documentIds. + * @member {Array.} documentIds + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.DocumentIds + * @instance + */ + DocumentIds.prototype.documentIds = $util.emptyArray; + + /** + * Creates a new DocumentIds instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.DocumentIds + * @static + * @param {org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.IDocumentIds=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.DocumentIds} DocumentIds instance + */ + DocumentIds.create = function create(properties) { + return new DocumentIds(properties); + }; + + /** + * Encodes the specified DocumentIds message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.DocumentIds.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.DocumentIds + * @static + * @param {org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.IDocumentIds} message DocumentIds message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DocumentIds.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.documentIds != null && message.documentIds.length) + for (var i = 0; i < message.documentIds.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.documentIds[i]); + return writer; + }; + + /** + * Encodes the specified DocumentIds message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.DocumentIds.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.DocumentIds + * @static + * @param {org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.IDocumentIds} message DocumentIds message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DocumentIds.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DocumentIds message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.DocumentIds + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.DocumentIds} DocumentIds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DocumentIds.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.DocumentIds(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.documentIds && message.documentIds.length)) + message.documentIds = []; + message.documentIds.push(reader.bytes()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DocumentIds message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.DocumentIds + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.DocumentIds} DocumentIds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DocumentIds.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DocumentIds message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.DocumentIds + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DocumentIds.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.documentIds != null && message.hasOwnProperty("documentIds")) { + if (!Array.isArray(message.documentIds)) + return "documentIds: array expected"; + for (var i = 0; i < message.documentIds.length; ++i) + if (!(message.documentIds[i] && typeof message.documentIds[i].length === "number" || $util.isString(message.documentIds[i]))) + return "documentIds: buffer[] expected"; + } + return null; + }; + + /** + * Creates a DocumentIds message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.DocumentIds + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.DocumentIds} DocumentIds + */ + DocumentIds.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.DocumentIds) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.DocumentIds(); + if (object.documentIds) { + if (!Array.isArray(object.documentIds)) + throw TypeError(".org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.DocumentIds.documentIds: array expected"); + message.documentIds = []; + for (var i = 0; i < object.documentIds.length; ++i) + if (typeof object.documentIds[i] === "string") + $util.base64.decode(object.documentIds[i], message.documentIds[i] = $util.newBuffer($util.base64.length(object.documentIds[i])), 0); + else if (object.documentIds[i].length >= 0) + message.documentIds[i] = object.documentIds[i]; + } + return message; + }; + + /** + * Creates a plain object from a DocumentIds message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.DocumentIds + * @static + * @param {org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.DocumentIds} message DocumentIds + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DocumentIds.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.documentIds = []; + if (message.documentIds && message.documentIds.length) { + object.documentIds = []; + for (var j = 0; j < message.documentIds.length; ++j) + object.documentIds[j] = options.bytes === String ? $util.base64.encode(message.documentIds[j], 0, message.documentIds[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.documentIds[j]) : message.documentIds[j]; + } + return object; + }; + + /** + * Converts this DocumentIds to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.DocumentIds + * @instance + * @returns {Object.} JSON object + */ + DocumentIds.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DocumentIds; + })(); + + GetContractDocumentRemovalsRequest.Page = (function() { + + /** + * Properties of a Page. + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest + * @interface IPage + * @property {Uint8Array|null} [startAfter] Page startAfter + * @property {number|null} [limit] Page limit + */ + + /** + * Constructs a new Page. + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest + * @classdesc Represents a Page. + * @implements IPage + * @constructor + * @param {org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.IPage=} [properties] Properties to set + */ + function Page(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Page startAfter. + * @member {Uint8Array} startAfter + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.Page + * @instance + */ + Page.prototype.startAfter = $util.newBuffer([]); + + /** + * Page limit. + * @member {number} limit + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.Page + * @instance + */ + Page.prototype.limit = 0; + + /** + * Creates a new Page instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.Page + * @static + * @param {org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.IPage=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.Page} Page instance + */ + Page.create = function create(properties) { + return new Page(properties); + }; + + /** + * Encodes the specified Page message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.Page.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.Page + * @static + * @param {org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.IPage} message Page message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Page.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.startAfter != null && Object.hasOwnProperty.call(message, "startAfter")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.startAfter); + if (message.limit != null && Object.hasOwnProperty.call(message, "limit")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.limit); + return writer; + }; + + /** + * Encodes the specified Page message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.Page.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.Page + * @static + * @param {org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.IPage} message Page message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Page.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Page message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.Page + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.Page} Page + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Page.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.Page(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.startAfter = reader.bytes(); + break; + case 2: + message.limit = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Page message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.Page + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.Page} Page + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Page.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Page message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.Page + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Page.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.startAfter != null && message.hasOwnProperty("startAfter")) + if (!(message.startAfter && typeof message.startAfter.length === "number" || $util.isString(message.startAfter))) + return "startAfter: buffer expected"; + if (message.limit != null && message.hasOwnProperty("limit")) + if (!$util.isInteger(message.limit)) + return "limit: integer expected"; + return null; + }; + + /** + * Creates a Page message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.Page + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.Page} Page + */ + Page.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.Page) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.Page(); + if (object.startAfter != null) + if (typeof object.startAfter === "string") + $util.base64.decode(object.startAfter, message.startAfter = $util.newBuffer($util.base64.length(object.startAfter)), 0); + else if (object.startAfter.length >= 0) + message.startAfter = object.startAfter; + if (object.limit != null) + message.limit = object.limit >>> 0; + return message; + }; + + /** + * Creates a plain object from a Page message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.Page + * @static + * @param {org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.Page} message Page + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Page.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.startAfter = ""; + else { + object.startAfter = []; + if (options.bytes !== Array) + object.startAfter = $util.newBuffer(object.startAfter); + } + object.limit = 0; + } + if (message.startAfter != null && message.hasOwnProperty("startAfter")) + object.startAfter = options.bytes === String ? $util.base64.encode(message.startAfter, 0, message.startAfter.length) : options.bytes === Array ? Array.prototype.slice.call(message.startAfter) : message.startAfter; + if (message.limit != null && message.hasOwnProperty("limit")) + object.limit = message.limit; + return object; + }; + + /** + * Converts this Page to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.Page + * @instance + * @returns {Object.} JSON object + */ + Page.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Page; + })(); + + GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0 = (function() { + + /** + * Properties of a GetContractDocumentRemovalsRequestV0. + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest + * @interface IGetContractDocumentRemovalsRequestV0 + * @property {Uint8Array|null} [contractId] GetContractDocumentRemovalsRequestV0 contractId + * @property {string|null} [documentTypeName] GetContractDocumentRemovalsRequestV0 documentTypeName + * @property {org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.IDocumentIds|null} [documentIds] GetContractDocumentRemovalsRequestV0 documentIds + * @property {org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.IPage|null} [page] GetContractDocumentRemovalsRequestV0 page + * @property {boolean|null} [prove] GetContractDocumentRemovalsRequestV0 prove + */ + + /** + * Constructs a new GetContractDocumentRemovalsRequestV0. + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest + * @classdesc Represents a GetContractDocumentRemovalsRequestV0. + * @implements IGetContractDocumentRemovalsRequestV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.IGetContractDocumentRemovalsRequestV0=} [properties] Properties to set + */ + function GetContractDocumentRemovalsRequestV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetContractDocumentRemovalsRequestV0 contractId. + * @member {Uint8Array} contractId + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0 + * @instance + */ + GetContractDocumentRemovalsRequestV0.prototype.contractId = $util.newBuffer([]); + + /** + * GetContractDocumentRemovalsRequestV0 documentTypeName. + * @member {string} documentTypeName + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0 + * @instance + */ + GetContractDocumentRemovalsRequestV0.prototype.documentTypeName = ""; + + /** + * GetContractDocumentRemovalsRequestV0 documentIds. + * @member {org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.IDocumentIds|null|undefined} documentIds + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0 + * @instance + */ + GetContractDocumentRemovalsRequestV0.prototype.documentIds = null; + + /** + * GetContractDocumentRemovalsRequestV0 page. + * @member {org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.IPage|null|undefined} page + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0 + * @instance + */ + GetContractDocumentRemovalsRequestV0.prototype.page = null; + + /** + * GetContractDocumentRemovalsRequestV0 prove. + * @member {boolean} prove + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0 + * @instance + */ + GetContractDocumentRemovalsRequestV0.prototype.prove = false; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetContractDocumentRemovalsRequestV0 selection. + * @member {"documentIds"|"page"|undefined} selection + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0 + * @instance + */ + Object.defineProperty(GetContractDocumentRemovalsRequestV0.prototype, "selection", { + get: $util.oneOfGetter($oneOfFields = ["documentIds", "page"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetContractDocumentRemovalsRequestV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.IGetContractDocumentRemovalsRequestV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0} GetContractDocumentRemovalsRequestV0 instance + */ + GetContractDocumentRemovalsRequestV0.create = function create(properties) { + return new GetContractDocumentRemovalsRequestV0(properties); + }; + + /** + * Encodes the specified GetContractDocumentRemovalsRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.IGetContractDocumentRemovalsRequestV0} message GetContractDocumentRemovalsRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetContractDocumentRemovalsRequestV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.contractId != null && Object.hasOwnProperty.call(message, "contractId")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.contractId); + if (message.documentTypeName != null && Object.hasOwnProperty.call(message, "documentTypeName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.documentTypeName); + if (message.documentIds != null && Object.hasOwnProperty.call(message, "documentIds")) + $root.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.DocumentIds.encode(message.documentIds, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.page != null && Object.hasOwnProperty.call(message, "page")) + $root.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.Page.encode(message.page, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.prove); + return writer; + }; + + /** + * Encodes the specified GetContractDocumentRemovalsRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.IGetContractDocumentRemovalsRequestV0} message GetContractDocumentRemovalsRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetContractDocumentRemovalsRequestV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetContractDocumentRemovalsRequestV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0} GetContractDocumentRemovalsRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetContractDocumentRemovalsRequestV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.contractId = reader.bytes(); + break; + case 2: + message.documentTypeName = reader.string(); + break; + case 3: + message.documentIds = $root.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.DocumentIds.decode(reader, reader.uint32()); + break; + case 4: + message.page = $root.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.Page.decode(reader, reader.uint32()); + break; + case 5: + message.prove = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetContractDocumentRemovalsRequestV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0} GetContractDocumentRemovalsRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetContractDocumentRemovalsRequestV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetContractDocumentRemovalsRequestV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetContractDocumentRemovalsRequestV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.contractId != null && message.hasOwnProperty("contractId")) + if (!(message.contractId && typeof message.contractId.length === "number" || $util.isString(message.contractId))) + return "contractId: buffer expected"; + if (message.documentTypeName != null && message.hasOwnProperty("documentTypeName")) + if (!$util.isString(message.documentTypeName)) + return "documentTypeName: string expected"; + if (message.documentIds != null && message.hasOwnProperty("documentIds")) { + properties.selection = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.DocumentIds.verify(message.documentIds); + if (error) + return "documentIds." + error; + } + } + if (message.page != null && message.hasOwnProperty("page")) { + if (properties.selection === 1) + return "selection: multiple values"; + properties.selection = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.Page.verify(message.page); + if (error) + return "page." + error; + } + } + if (message.prove != null && message.hasOwnProperty("prove")) + if (typeof message.prove !== "boolean") + return "prove: boolean expected"; + return null; + }; + + /** + * Creates a GetContractDocumentRemovalsRequestV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0} GetContractDocumentRemovalsRequestV0 + */ + GetContractDocumentRemovalsRequestV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0(); + if (object.contractId != null) + if (typeof object.contractId === "string") + $util.base64.decode(object.contractId, message.contractId = $util.newBuffer($util.base64.length(object.contractId)), 0); + else if (object.contractId.length >= 0) + message.contractId = object.contractId; + if (object.documentTypeName != null) + message.documentTypeName = String(object.documentTypeName); + if (object.documentIds != null) { + if (typeof object.documentIds !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0.documentIds: object expected"); + message.documentIds = $root.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.DocumentIds.fromObject(object.documentIds); + } + if (object.page != null) { + if (typeof object.page !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0.page: object expected"); + message.page = $root.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.Page.fromObject(object.page); + } + if (object.prove != null) + message.prove = Boolean(object.prove); + return message; + }; + + /** + * Creates a plain object from a GetContractDocumentRemovalsRequestV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0} message GetContractDocumentRemovalsRequestV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetContractDocumentRemovalsRequestV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.contractId = ""; + else { + object.contractId = []; + if (options.bytes !== Array) + object.contractId = $util.newBuffer(object.contractId); + } + object.documentTypeName = ""; + object.prove = false; + } + if (message.contractId != null && message.hasOwnProperty("contractId")) + object.contractId = options.bytes === String ? $util.base64.encode(message.contractId, 0, message.contractId.length) : options.bytes === Array ? Array.prototype.slice.call(message.contractId) : message.contractId; + if (message.documentTypeName != null && message.hasOwnProperty("documentTypeName")) + object.documentTypeName = message.documentTypeName; + if (message.documentIds != null && message.hasOwnProperty("documentIds")) { + object.documentIds = $root.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.DocumentIds.toObject(message.documentIds, options); + if (options.oneofs) + object.selection = "documentIds"; + } + if (message.page != null && message.hasOwnProperty("page")) { + object.page = $root.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.Page.toObject(message.page, options); + if (options.oneofs) + object.selection = "page"; + } + if (message.prove != null && message.hasOwnProperty("prove")) + object.prove = message.prove; + return object; + }; + + /** + * Converts this GetContractDocumentRemovalsRequestV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0 + * @instance + * @returns {Object.} JSON object + */ + GetContractDocumentRemovalsRequestV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetContractDocumentRemovalsRequestV0; + })(); + + return GetContractDocumentRemovalsRequest; + })(); + + v0.GetContractDocumentRemovalsResponse = (function() { + + /** + * Properties of a GetContractDocumentRemovalsResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetContractDocumentRemovalsResponse + * @property {org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.IGetContractDocumentRemovalsResponseV0|null} [v0] GetContractDocumentRemovalsResponse v0 + */ + + /** + * Constructs a new GetContractDocumentRemovalsResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetContractDocumentRemovalsResponse. + * @implements IGetContractDocumentRemovalsResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IGetContractDocumentRemovalsResponse=} [properties] Properties to set + */ + function GetContractDocumentRemovalsResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetContractDocumentRemovalsResponse v0. + * @member {org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.IGetContractDocumentRemovalsResponseV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse + * @instance + */ + GetContractDocumentRemovalsResponse.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetContractDocumentRemovalsResponse version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse + * @instance + */ + Object.defineProperty(GetContractDocumentRemovalsResponse.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetContractDocumentRemovalsResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetContractDocumentRemovalsResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse} GetContractDocumentRemovalsResponse instance + */ + GetContractDocumentRemovalsResponse.create = function create(properties) { + return new GetContractDocumentRemovalsResponse(properties); + }; + + /** + * Encodes the specified GetContractDocumentRemovalsResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetContractDocumentRemovalsResponse} message GetContractDocumentRemovalsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetContractDocumentRemovalsResponse.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.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetContractDocumentRemovalsResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetContractDocumentRemovalsResponse} message GetContractDocumentRemovalsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetContractDocumentRemovalsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetContractDocumentRemovalsResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse} GetContractDocumentRemovalsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetContractDocumentRemovalsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetContractDocumentRemovalsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse} GetContractDocumentRemovalsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetContractDocumentRemovalsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetContractDocumentRemovalsResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetContractDocumentRemovalsResponse.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.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetContractDocumentRemovalsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse} GetContractDocumentRemovalsResponse + */ + GetContractDocumentRemovalsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetContractDocumentRemovalsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse + * @static + * @param {org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse} message GetContractDocumentRemovalsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetContractDocumentRemovalsResponse.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.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetContractDocumentRemovalsResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse + * @instance + * @returns {Object.} JSON object + */ + GetContractDocumentRemovalsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetContractDocumentRemovalsResponse.ContractDocumentRemoval = (function() { + + /** + * Properties of a ContractDocumentRemoval. + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse + * @interface IContractDocumentRemoval + * @property {Uint8Array|null} [documentId] ContractDocumentRemoval documentId + * @property {Uint8Array|null} [documentOwnerId] ContractDocumentRemoval documentOwnerId + * @property {Uint8Array|null} [moderatorId] ContractDocumentRemoval moderatorId + * @property {number|Long|null} [removedAt] ContractDocumentRemoval removedAt + * @property {org.dash.platform.dapi.v0.IContractModerationReason|null} [reason] ContractDocumentRemoval reason + */ + + /** + * Constructs a new ContractDocumentRemoval. + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse + * @classdesc Represents a ContractDocumentRemoval. + * @implements IContractDocumentRemoval + * @constructor + * @param {org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.IContractDocumentRemoval=} [properties] Properties to set + */ + function ContractDocumentRemoval(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ContractDocumentRemoval documentId. + * @member {Uint8Array} documentId + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval + * @instance + */ + ContractDocumentRemoval.prototype.documentId = $util.newBuffer([]); + + /** + * ContractDocumentRemoval documentOwnerId. + * @member {Uint8Array} documentOwnerId + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval + * @instance + */ + ContractDocumentRemoval.prototype.documentOwnerId = $util.newBuffer([]); + + /** + * ContractDocumentRemoval moderatorId. + * @member {Uint8Array} moderatorId + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval + * @instance + */ + ContractDocumentRemoval.prototype.moderatorId = $util.newBuffer([]); + + /** + * ContractDocumentRemoval removedAt. + * @member {number|Long} removedAt + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval + * @instance + */ + ContractDocumentRemoval.prototype.removedAt = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * ContractDocumentRemoval reason. + * @member {org.dash.platform.dapi.v0.IContractModerationReason|null|undefined} reason + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval + * @instance + */ + ContractDocumentRemoval.prototype.reason = null; + + /** + * Creates a new ContractDocumentRemoval instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval + * @static + * @param {org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.IContractDocumentRemoval=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval} ContractDocumentRemoval instance + */ + ContractDocumentRemoval.create = function create(properties) { + return new ContractDocumentRemoval(properties); + }; + + /** + * Encodes the specified ContractDocumentRemoval message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval + * @static + * @param {org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.IContractDocumentRemoval} message ContractDocumentRemoval message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContractDocumentRemoval.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.documentId != null && Object.hasOwnProperty.call(message, "documentId")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.documentId); + if (message.documentOwnerId != null && Object.hasOwnProperty.call(message, "documentOwnerId")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.documentOwnerId); + if (message.moderatorId != null && Object.hasOwnProperty.call(message, "moderatorId")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.moderatorId); + if (message.removedAt != null && Object.hasOwnProperty.call(message, "removedAt")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.removedAt); + if (message.reason != null && Object.hasOwnProperty.call(message, "reason")) + $root.org.dash.platform.dapi.v0.ContractModerationReason.encode(message.reason, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ContractDocumentRemoval message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval + * @static + * @param {org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.IContractDocumentRemoval} message ContractDocumentRemoval message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContractDocumentRemoval.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ContractDocumentRemoval message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval} ContractDocumentRemoval + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContractDocumentRemoval.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.documentId = reader.bytes(); + break; + case 2: + message.documentOwnerId = reader.bytes(); + break; + case 3: + message.moderatorId = reader.bytes(); + break; + case 4: + message.removedAt = reader.uint64(); + break; + case 5: + message.reason = $root.org.dash.platform.dapi.v0.ContractModerationReason.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ContractDocumentRemoval message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval} ContractDocumentRemoval + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContractDocumentRemoval.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ContractDocumentRemoval message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ContractDocumentRemoval.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.documentId != null && message.hasOwnProperty("documentId")) + if (!(message.documentId && typeof message.documentId.length === "number" || $util.isString(message.documentId))) + return "documentId: buffer expected"; + if (message.documentOwnerId != null && message.hasOwnProperty("documentOwnerId")) + if (!(message.documentOwnerId && typeof message.documentOwnerId.length === "number" || $util.isString(message.documentOwnerId))) + return "documentOwnerId: buffer expected"; + if (message.moderatorId != null && message.hasOwnProperty("moderatorId")) + if (!(message.moderatorId && typeof message.moderatorId.length === "number" || $util.isString(message.moderatorId))) + return "moderatorId: buffer expected"; + if (message.removedAt != null && message.hasOwnProperty("removedAt")) + if (!$util.isInteger(message.removedAt) && !(message.removedAt && $util.isInteger(message.removedAt.low) && $util.isInteger(message.removedAt.high))) + return "removedAt: integer|Long expected"; + if (message.reason != null && message.hasOwnProperty("reason")) { + var error = $root.org.dash.platform.dapi.v0.ContractModerationReason.verify(message.reason); + if (error) + return "reason." + error; + } + return null; + }; + + /** + * Creates a ContractDocumentRemoval message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval} ContractDocumentRemoval + */ + ContractDocumentRemoval.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval(); + if (object.documentId != null) + if (typeof object.documentId === "string") + $util.base64.decode(object.documentId, message.documentId = $util.newBuffer($util.base64.length(object.documentId)), 0); + else if (object.documentId.length >= 0) + message.documentId = object.documentId; + if (object.documentOwnerId != null) + if (typeof object.documentOwnerId === "string") + $util.base64.decode(object.documentOwnerId, message.documentOwnerId = $util.newBuffer($util.base64.length(object.documentOwnerId)), 0); + else if (object.documentOwnerId.length >= 0) + message.documentOwnerId = object.documentOwnerId; + if (object.moderatorId != null) + if (typeof object.moderatorId === "string") + $util.base64.decode(object.moderatorId, message.moderatorId = $util.newBuffer($util.base64.length(object.moderatorId)), 0); + else if (object.moderatorId.length >= 0) + message.moderatorId = object.moderatorId; + if (object.removedAt != null) + if ($util.Long) + (message.removedAt = $util.Long.fromValue(object.removedAt)).unsigned = true; + else if (typeof object.removedAt === "string") + message.removedAt = parseInt(object.removedAt, 10); + else if (typeof object.removedAt === "number") + message.removedAt = object.removedAt; + else if (typeof object.removedAt === "object") + message.removedAt = new $util.LongBits(object.removedAt.low >>> 0, object.removedAt.high >>> 0).toNumber(true); + if (object.reason != null) { + if (typeof object.reason !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval.reason: object expected"); + message.reason = $root.org.dash.platform.dapi.v0.ContractModerationReason.fromObject(object.reason); + } + return message; + }; + + /** + * Creates a plain object from a ContractDocumentRemoval message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval + * @static + * @param {org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval} message ContractDocumentRemoval + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ContractDocumentRemoval.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.documentId = ""; + else { + object.documentId = []; + if (options.bytes !== Array) + object.documentId = $util.newBuffer(object.documentId); + } + if (options.bytes === String) + object.documentOwnerId = ""; + else { + object.documentOwnerId = []; + if (options.bytes !== Array) + object.documentOwnerId = $util.newBuffer(object.documentOwnerId); + } + if (options.bytes === String) + object.moderatorId = ""; + else { + object.moderatorId = []; + if (options.bytes !== Array) + object.moderatorId = $util.newBuffer(object.moderatorId); + } + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.removedAt = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.removedAt = options.longs === String ? "0" : 0; + object.reason = null; + } + if (message.documentId != null && message.hasOwnProperty("documentId")) + object.documentId = options.bytes === String ? $util.base64.encode(message.documentId, 0, message.documentId.length) : options.bytes === Array ? Array.prototype.slice.call(message.documentId) : message.documentId; + if (message.documentOwnerId != null && message.hasOwnProperty("documentOwnerId")) + object.documentOwnerId = options.bytes === String ? $util.base64.encode(message.documentOwnerId, 0, message.documentOwnerId.length) : options.bytes === Array ? Array.prototype.slice.call(message.documentOwnerId) : message.documentOwnerId; + if (message.moderatorId != null && message.hasOwnProperty("moderatorId")) + object.moderatorId = options.bytes === String ? $util.base64.encode(message.moderatorId, 0, message.moderatorId.length) : options.bytes === Array ? Array.prototype.slice.call(message.moderatorId) : message.moderatorId; + if (message.removedAt != null && message.hasOwnProperty("removedAt")) + if (typeof message.removedAt === "number") + object.removedAt = options.longs === String ? String(message.removedAt) : message.removedAt; + else + object.removedAt = options.longs === String ? $util.Long.prototype.toString.call(message.removedAt) : options.longs === Number ? new $util.LongBits(message.removedAt.low >>> 0, message.removedAt.high >>> 0).toNumber(true) : message.removedAt; + if (message.reason != null && message.hasOwnProperty("reason")) + object.reason = $root.org.dash.platform.dapi.v0.ContractModerationReason.toObject(message.reason, options); + return object; + }; + + /** + * Converts this ContractDocumentRemoval to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval + * @instance + * @returns {Object.} JSON object + */ + ContractDocumentRemoval.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ContractDocumentRemoval; + })(); + + GetContractDocumentRemovalsResponse.ContractDocumentRemovals = (function() { + + /** + * Properties of a ContractDocumentRemovals. + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse + * @interface IContractDocumentRemovals + * @property {Array.|null} [removals] ContractDocumentRemovals removals + */ + + /** + * Constructs a new ContractDocumentRemovals. + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse + * @classdesc Represents a ContractDocumentRemovals. + * @implements IContractDocumentRemovals + * @constructor + * @param {org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.IContractDocumentRemovals=} [properties] Properties to set + */ + function ContractDocumentRemovals(properties) { + this.removals = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ContractDocumentRemovals removals. + * @member {Array.} removals + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemovals + * @instance + */ + ContractDocumentRemovals.prototype.removals = $util.emptyArray; + + /** + * Creates a new ContractDocumentRemovals instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemovals + * @static + * @param {org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.IContractDocumentRemovals=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemovals} ContractDocumentRemovals instance + */ + ContractDocumentRemovals.create = function create(properties) { + return new ContractDocumentRemovals(properties); + }; + + /** + * Encodes the specified ContractDocumentRemovals message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemovals.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemovals + * @static + * @param {org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.IContractDocumentRemovals} message ContractDocumentRemovals message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContractDocumentRemovals.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.removals != null && message.removals.length) + for (var i = 0; i < message.removals.length; ++i) + $root.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval.encode(message.removals[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ContractDocumentRemovals message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemovals.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemovals + * @static + * @param {org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.IContractDocumentRemovals} message ContractDocumentRemovals message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContractDocumentRemovals.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ContractDocumentRemovals message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemovals + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemovals} ContractDocumentRemovals + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContractDocumentRemovals.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemovals(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.removals && message.removals.length)) + message.removals = []; + message.removals.push($root.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ContractDocumentRemovals message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemovals + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemovals} ContractDocumentRemovals + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContractDocumentRemovals.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ContractDocumentRemovals message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemovals + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ContractDocumentRemovals.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.removals != null && message.hasOwnProperty("removals")) { + if (!Array.isArray(message.removals)) + return "removals: array expected"; + for (var i = 0; i < message.removals.length; ++i) { + var error = $root.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval.verify(message.removals[i]); + if (error) + return "removals." + error; + } + } + return null; + }; + + /** + * Creates a ContractDocumentRemovals message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemovals + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemovals} ContractDocumentRemovals + */ + ContractDocumentRemovals.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemovals) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemovals(); + if (object.removals) { + if (!Array.isArray(object.removals)) + throw TypeError(".org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemovals.removals: array expected"); + message.removals = []; + for (var i = 0; i < object.removals.length; ++i) { + if (typeof object.removals[i] !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemovals.removals: object expected"); + message.removals[i] = $root.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval.fromObject(object.removals[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ContractDocumentRemovals message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemovals + * @static + * @param {org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemovals} message ContractDocumentRemovals + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ContractDocumentRemovals.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.removals = []; + if (message.removals && message.removals.length) { + object.removals = []; + for (var j = 0; j < message.removals.length; ++j) + object.removals[j] = $root.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval.toObject(message.removals[j], options); + } + return object; + }; + + /** + * Converts this ContractDocumentRemovals to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemovals + * @instance + * @returns {Object.} JSON object + */ + ContractDocumentRemovals.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ContractDocumentRemovals; + })(); + + GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0 = (function() { + + /** + * Properties of a GetContractDocumentRemovalsResponseV0. + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse + * @interface IGetContractDocumentRemovalsResponseV0 + * @property {org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.IContractDocumentRemovals|null} [removals] GetContractDocumentRemovalsResponseV0 removals + * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetContractDocumentRemovalsResponseV0 proof + * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetContractDocumentRemovalsResponseV0 metadata + */ + + /** + * Constructs a new GetContractDocumentRemovalsResponseV0. + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse + * @classdesc Represents a GetContractDocumentRemovalsResponseV0. + * @implements IGetContractDocumentRemovalsResponseV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.IGetContractDocumentRemovalsResponseV0=} [properties] Properties to set + */ + function GetContractDocumentRemovalsResponseV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetContractDocumentRemovalsResponseV0 removals. + * @member {org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.IContractDocumentRemovals|null|undefined} removals + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0 + * @instance + */ + GetContractDocumentRemovalsResponseV0.prototype.removals = null; + + /** + * GetContractDocumentRemovalsResponseV0 proof. + * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0 + * @instance + */ + GetContractDocumentRemovalsResponseV0.prototype.proof = null; + + /** + * GetContractDocumentRemovalsResponseV0 metadata. + * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0 + * @instance + */ + GetContractDocumentRemovalsResponseV0.prototype.metadata = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetContractDocumentRemovalsResponseV0 result. + * @member {"removals"|"proof"|undefined} result + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0 + * @instance + */ + Object.defineProperty(GetContractDocumentRemovalsResponseV0.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["removals", "proof"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetContractDocumentRemovalsResponseV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.IGetContractDocumentRemovalsResponseV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0} GetContractDocumentRemovalsResponseV0 instance + */ + GetContractDocumentRemovalsResponseV0.create = function create(properties) { + return new GetContractDocumentRemovalsResponseV0(properties); + }; + + /** + * Encodes the specified GetContractDocumentRemovalsResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.IGetContractDocumentRemovalsResponseV0} message GetContractDocumentRemovalsResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetContractDocumentRemovalsResponseV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.removals != null && Object.hasOwnProperty.call(message, "removals")) + $root.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemovals.encode(message.removals, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetContractDocumentRemovalsResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.IGetContractDocumentRemovalsResponseV0} message GetContractDocumentRemovalsResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetContractDocumentRemovalsResponseV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetContractDocumentRemovalsResponseV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0} GetContractDocumentRemovalsResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetContractDocumentRemovalsResponseV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.removals = $root.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemovals.decode(reader, reader.uint32()); + break; + case 2: + message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); + break; + case 3: + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetContractDocumentRemovalsResponseV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0} GetContractDocumentRemovalsResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetContractDocumentRemovalsResponseV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetContractDocumentRemovalsResponseV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetContractDocumentRemovalsResponseV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.removals != null && message.hasOwnProperty("removals")) { + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemovals.verify(message.removals); + if (error) + return "removals." + error; + } + } + if (message.proof != null && message.hasOwnProperty("proof")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); + if (error) + return "proof." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a GetContractDocumentRemovalsResponseV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0} GetContractDocumentRemovalsResponseV0 + */ + GetContractDocumentRemovalsResponseV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0(); + if (object.removals != null) { + if (typeof object.removals !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0.removals: object expected"); + message.removals = $root.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemovals.fromObject(object.removals); + } + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0.proof: object expected"); + message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0.metadata: object expected"); + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a GetContractDocumentRemovalsResponseV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0} message GetContractDocumentRemovalsResponseV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetContractDocumentRemovalsResponseV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.metadata = null; + if (message.removals != null && message.hasOwnProperty("removals")) { + object.removals = $root.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemovals.toObject(message.removals, options); + if (options.oneofs) + object.result = "removals"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); + if (options.oneofs) + object.result = "proof"; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this GetContractDocumentRemovalsResponseV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0 + * @instance + * @returns {Object.} JSON object + */ + GetContractDocumentRemovalsResponseV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetContractDocumentRemovalsResponseV0; + })(); + + return GetContractDocumentRemovalsResponse; + })(); + v0.GetContractFeePotsRequest = (function() { /** diff --git a/packages/dapi-grpc/clients/platform/v0/nodejs/platform_protoc.js b/packages/dapi-grpc/clients/platform/v0/nodejs/platform_protoc.js index 532de357dde..150c073de43 100644 --- a/packages/dapi-grpc/clients/platform/v0/nodejs/platform_protoc.js +++ b/packages/dapi-grpc/clients/platform/v0/nodejs/platform_protoc.js @@ -118,6 +118,18 @@ goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetContestedResourcesResponse goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValues', null, { proto }); goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ResultCase', null, { proto }); goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetContestedResourcesResponse.VersionCase', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.DocumentIds', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0.SelectionCase', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.Page', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.VersionCase', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemovals', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0.ResultCase', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.VersionCase', null, { proto }); goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetContractFeePotsRequest', null, { proto }); goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetContractFeePotsRequest.GetContractFeePotsRequestV0', null, { proto }); goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetContractFeePotsRequest.VersionCase', null, { proto }); @@ -2858,6 +2870,174 @@ if (goog.DEBUG && !COMPILED) { */ proto.org.dash.platform.dapi.v0.GetContractModerationEntriesResponse.GetContractModerationEntriesResponseV0.displayName = 'proto.org.dash.platform.dapi.v0.GetContractModerationEntriesResponse.GetContractModerationEntriesResponseV0'; } +/** + * 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.GetContractDocumentRemovalsRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.oneofGroups_); +}; +goog.inherits(proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.displayName = 'proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest'; +} +/** + * 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.GetContractDocumentRemovalsRequest.DocumentIds = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.DocumentIds.repeatedFields_, null); +}; +goog.inherits(proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.DocumentIds, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.DocumentIds.displayName = 'proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.DocumentIds'; +} +/** + * 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.GetContractDocumentRemovalsRequest.Page = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.Page, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.Page.displayName = 'proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.Page'; +} +/** + * 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.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0 = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0.oneofGroups_); +}; +goog.inherits(proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0.displayName = 'proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0'; +} +/** + * 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.GetContractDocumentRemovalsResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.oneofGroups_); +}; +goog.inherits(proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.displayName = 'proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse'; +} +/** + * 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.GetContractDocumentRemovalsResponse.ContractDocumentRemoval = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval.displayName = 'proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval'; +} +/** + * 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.GetContractDocumentRemovalsResponse.ContractDocumentRemovals = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemovals.repeatedFields_, null); +}; +goog.inherits(proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemovals, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemovals.displayName = 'proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemovals'; +} +/** + * 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.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0 = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0.oneofGroups_); +}; +goog.inherits(proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0.displayName = 'proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0'; +} /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a @@ -32175,6 +32355,1882 @@ proto.org.dash.platform.dapi.v0.GetContractModerationEntriesResponse.prototype.h +/** + * 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.GetContractDocumentRemovalsRequest.oneofGroups_ = [[1]]; + +/** + * @enum {number} + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.VersionCase = { + VERSION_NOT_SET: 0, + V0: 1 +}; + +/** + * @return {proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.VersionCase} + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.prototype.getVersionCase = function() { + return /** @type {proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.VersionCase} */(jspb.Message.computeOneofCase(this, proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.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.GetContractDocumentRemovalsRequest.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.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.GetContractDocumentRemovalsRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.toObject = function(includeInstance, msg) { + var f, obj = { + v0: (f = msg.getV0()) && proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0.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.GetContractDocumentRemovalsRequest} + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest; + return proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.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.GetContractDocumentRemovalsRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest} + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.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.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0.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.GetContractDocumentRemovalsRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.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.GetContractDocumentRemovalsRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getV0(); + if (f != null) { + writer.writeMessage( + 1, + f, + proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0.serializeBinaryToWriter + ); + } +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.DocumentIds.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.GetContractDocumentRemovalsRequest.DocumentIds.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.DocumentIds.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.GetContractDocumentRemovalsRequest.DocumentIds} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.DocumentIds.toObject = function(includeInstance, msg) { + var f, obj = { + documentIdsList: msg.getDocumentIdsList_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.GetContractDocumentRemovalsRequest.DocumentIds} + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.DocumentIds.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.DocumentIds; + return proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.DocumentIds.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.GetContractDocumentRemovalsRequest.DocumentIds} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.DocumentIds} + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.DocumentIds.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.addDocumentIds(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.GetContractDocumentRemovalsRequest.DocumentIds.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.DocumentIds.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.GetContractDocumentRemovalsRequest.DocumentIds} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.DocumentIds.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getDocumentIdsList_asU8(); + if (f.length > 0) { + writer.writeRepeatedBytes( + 1, + f + ); + } +}; + + +/** + * repeated bytes document_ids = 1; + * @return {!Array} + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.DocumentIds.prototype.getDocumentIdsList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 1)); +}; + + +/** + * repeated bytes document_ids = 1; + * This is a type-conversion wrapper around `getDocumentIdsList()` + * @return {!Array} + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.DocumentIds.prototype.getDocumentIdsList_asB64 = function() { + return /** @type {!Array} */ (jspb.Message.bytesListAsB64( + this.getDocumentIdsList())); +}; + + +/** + * repeated bytes document_ids = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getDocumentIdsList()` + * @return {!Array} + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.DocumentIds.prototype.getDocumentIdsList_asU8 = function() { + return /** @type {!Array} */ (jspb.Message.bytesListAsU8( + this.getDocumentIdsList())); +}; + + +/** + * @param {!(Array|Array)} value + * @return {!proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.DocumentIds} returns this + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.DocumentIds.prototype.setDocumentIdsList = function(value) { + return jspb.Message.setField(this, 1, value || []); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @param {number=} opt_index + * @return {!proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.DocumentIds} returns this + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.DocumentIds.prototype.addDocumentIds = 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.GetContractDocumentRemovalsRequest.DocumentIds} returns this + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.DocumentIds.prototype.clearDocumentIdsList = function() { + return this.setDocumentIdsList([]); +}; + + + + + +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.GetContractDocumentRemovalsRequest.Page.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.Page.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.GetContractDocumentRemovalsRequest.Page} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.Page.toObject = function(includeInstance, msg) { + var f, obj = { + startAfter: msg.getStartAfter_asB64(), + limit: 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.GetContractDocumentRemovalsRequest.Page} + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.Page.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.Page; + return proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.Page.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.GetContractDocumentRemovalsRequest.Page} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.Page} + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.Page.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.setStartAfter(value); + break; + case 2: + var value = /** @type {number} */ (reader.readUint32()); + msg.setLimit(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.GetContractDocumentRemovalsRequest.Page.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.Page.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.GetContractDocumentRemovalsRequest.Page} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.Page.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = /** @type {!(string|Uint8Array)} */ (jspb.Message.getField(message, 1)); + if (f != null) { + writer.writeBytes( + 1, + f + ); + } + f = /** @type {number} */ (jspb.Message.getField(message, 2)); + if (f != null) { + writer.writeUint32( + 2, + f + ); + } +}; + + +/** + * optional bytes start_after = 1; + * @return {string} + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.Page.prototype.getStartAfter = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * optional bytes start_after = 1; + * This is a type-conversion wrapper around `getStartAfter()` + * @return {string} + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.Page.prototype.getStartAfter_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getStartAfter())); +}; + + +/** + * optional bytes start_after = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getStartAfter()` + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.Page.prototype.getStartAfter_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getStartAfter())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.Page} returns this + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.Page.prototype.setStartAfter = function(value) { + return jspb.Message.setField(this, 1, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.Page} returns this + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.Page.prototype.clearStartAfter = function() { + return jspb.Message.setField(this, 1, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.Page.prototype.hasStartAfter = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * optional uint32 limit = 2; + * @return {number} + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.Page.prototype.getLimit = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.Page} returns this + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.Page.prototype.setLimit = function(value) { + return jspb.Message.setField(this, 2, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.Page} returns this + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.Page.prototype.clearLimit = function() { + return jspb.Message.setField(this, 2, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.Page.prototype.hasLimit = function() { + return jspb.Message.getField(this, 2) != 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.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0.oneofGroups_ = [[3,4]]; + +/** + * @enum {number} + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0.SelectionCase = { + SELECTION_NOT_SET: 0, + DOCUMENT_IDS: 3, + PAGE: 4 +}; + +/** + * @return {proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0.SelectionCase} + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0.prototype.getSelectionCase = function() { + return /** @type {proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0.SelectionCase} */(jspb.Message.computeOneofCase(this, proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0.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.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0.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.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0.toObject = function(includeInstance, msg) { + var f, obj = { + contractId: msg.getContractId_asB64(), + documentTypeName: jspb.Message.getFieldWithDefault(msg, 2, ""), + documentIds: (f = msg.getDocumentIds()) && proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.DocumentIds.toObject(includeInstance, f), + page: (f = msg.getPage()) && proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.Page.toObject(includeInstance, f), + prove: jspb.Message.getBooleanFieldWithDefault(msg, 5, false) + }; + + 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.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0} + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0; + return proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0.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.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0} + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setContractId(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setDocumentTypeName(value); + break; + case 3: + var value = new proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.DocumentIds; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.DocumentIds.deserializeBinaryFromReader); + msg.setDocumentIds(value); + break; + case 4: + var value = new proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.Page; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.Page.deserializeBinaryFromReader); + msg.setPage(value); + break; + case 5: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setProve(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.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0.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.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getContractId_asU8(); + if (f.length > 0) { + writer.writeBytes( + 1, + f + ); + } + f = message.getDocumentTypeName(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getDocumentIds(); + if (f != null) { + writer.writeMessage( + 3, + f, + proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.DocumentIds.serializeBinaryToWriter + ); + } + f = message.getPage(); + if (f != null) { + writer.writeMessage( + 4, + f, + proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.Page.serializeBinaryToWriter + ); + } + f = message.getProve(); + if (f) { + writer.writeBool( + 5, + f + ); + } +}; + + +/** + * optional bytes contract_id = 1; + * @return {string} + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0.prototype.getContractId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * optional bytes contract_id = 1; + * This is a type-conversion wrapper around `getContractId()` + * @return {string} + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0.prototype.getContractId_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getContractId())); +}; + + +/** + * optional bytes contract_id = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getContractId()` + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0.prototype.getContractId_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getContractId())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0} returns this + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0.prototype.setContractId = function(value) { + return jspb.Message.setProto3BytesField(this, 1, value); +}; + + +/** + * optional string document_type_name = 2; + * @return {string} + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0.prototype.getDocumentTypeName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0} returns this + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0.prototype.setDocumentTypeName = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * optional DocumentIds document_ids = 3; + * @return {?proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.DocumentIds} + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0.prototype.getDocumentIds = function() { + return /** @type{?proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.DocumentIds} */ ( + jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.DocumentIds, 3)); +}; + + +/** + * @param {?proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.DocumentIds|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0} returns this +*/ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0.prototype.setDocumentIds = function(value) { + return jspb.Message.setOneofWrapperField(this, 3, proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0} returns this + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0.prototype.clearDocumentIds = function() { + return this.setDocumentIds(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0.prototype.hasDocumentIds = function() { + return jspb.Message.getField(this, 3) != null; +}; + + +/** + * optional Page page = 4; + * @return {?proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.Page} + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0.prototype.getPage = function() { + return /** @type{?proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.Page} */ ( + jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.Page, 4)); +}; + + +/** + * @param {?proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.Page|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0} returns this +*/ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0.prototype.setPage = function(value) { + return jspb.Message.setOneofWrapperField(this, 4, proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0} returns this + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0.prototype.clearPage = function() { + return this.setPage(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0.prototype.hasPage = function() { + return jspb.Message.getField(this, 4) != null; +}; + + +/** + * optional bool prove = 5; + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0.prototype.getProve = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 5, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0} returns this + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0.prototype.setProve = function(value) { + return jspb.Message.setProto3BooleanField(this, 5, value); +}; + + +/** + * optional GetContractDocumentRemovalsRequestV0 v0 = 1; + * @return {?proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0} + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.prototype.getV0 = function() { + return /** @type{?proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0} */ ( + jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0, 1)); +}; + + +/** + * @param {?proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest} returns this +*/ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.prototype.setV0 = function(value) { + return jspb.Message.setOneofWrapperField(this, 1, proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest} returns this + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.prototype.clearV0 = function() { + return this.setV0(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.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.GetContractDocumentRemovalsResponse.oneofGroups_ = [[1]]; + +/** + * @enum {number} + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.VersionCase = { + VERSION_NOT_SET: 0, + V0: 1 +}; + +/** + * @return {proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.VersionCase} + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.prototype.getVersionCase = function() { + return /** @type {proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.VersionCase} */(jspb.Message.computeOneofCase(this, proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.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.GetContractDocumentRemovalsResponse.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.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.GetContractDocumentRemovalsResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.toObject = function(includeInstance, msg) { + var f, obj = { + v0: (f = msg.getV0()) && proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0.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.GetContractDocumentRemovalsResponse} + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse; + return proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.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.GetContractDocumentRemovalsResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse} + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.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.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0.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.GetContractDocumentRemovalsResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.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.GetContractDocumentRemovalsResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getV0(); + if (f != null) { + writer.writeMessage( + 1, + f, + proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0.serializeBinaryToWriter + ); + } +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval.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.GetContractDocumentRemovalsResponse.ContractDocumentRemoval} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval.toObject = function(includeInstance, msg) { + var f, obj = { + documentId: msg.getDocumentId_asB64(), + documentOwnerId: msg.getDocumentOwnerId_asB64(), + moderatorId: msg.getModeratorId_asB64(), + removedAt: jspb.Message.getFieldWithDefault(msg, 4, 0), + reason: (f = msg.getReason()) && proto.org.dash.platform.dapi.v0.ContractModerationReason.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.GetContractDocumentRemovalsResponse.ContractDocumentRemoval} + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval; + return proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval.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.GetContractDocumentRemovalsResponse.ContractDocumentRemoval} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval} + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval.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.setDocumentId(value); + break; + case 2: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setDocumentOwnerId(value); + break; + case 3: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setModeratorId(value); + break; + case 4: + var value = /** @type {number} */ (reader.readUint64()); + msg.setRemovedAt(value); + break; + case 5: + var value = new proto.org.dash.platform.dapi.v0.ContractModerationReason; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.ContractModerationReason.deserializeBinaryFromReader); + msg.setReason(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.GetContractDocumentRemovalsResponse.ContractDocumentRemoval.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval.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.GetContractDocumentRemovalsResponse.ContractDocumentRemoval} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getDocumentId_asU8(); + if (f.length > 0) { + writer.writeBytes( + 1, + f + ); + } + f = message.getDocumentOwnerId_asU8(); + if (f.length > 0) { + writer.writeBytes( + 2, + f + ); + } + f = message.getModeratorId_asU8(); + if (f.length > 0) { + writer.writeBytes( + 3, + f + ); + } + f = message.getRemovedAt(); + if (f !== 0) { + writer.writeUint64( + 4, + f + ); + } + f = message.getReason(); + if (f != null) { + writer.writeMessage( + 5, + f, + proto.org.dash.platform.dapi.v0.ContractModerationReason.serializeBinaryToWriter + ); + } +}; + + +/** + * optional bytes document_id = 1; + * @return {string} + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval.prototype.getDocumentId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * optional bytes document_id = 1; + * This is a type-conversion wrapper around `getDocumentId()` + * @return {string} + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval.prototype.getDocumentId_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getDocumentId())); +}; + + +/** + * optional bytes document_id = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getDocumentId()` + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval.prototype.getDocumentId_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getDocumentId())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval} returns this + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval.prototype.setDocumentId = function(value) { + return jspb.Message.setProto3BytesField(this, 1, value); +}; + + +/** + * optional bytes document_owner_id = 2; + * @return {string} + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval.prototype.getDocumentOwnerId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * optional bytes document_owner_id = 2; + * This is a type-conversion wrapper around `getDocumentOwnerId()` + * @return {string} + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval.prototype.getDocumentOwnerId_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getDocumentOwnerId())); +}; + + +/** + * optional bytes document_owner_id = 2; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getDocumentOwnerId()` + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval.prototype.getDocumentOwnerId_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getDocumentOwnerId())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval} returns this + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval.prototype.setDocumentOwnerId = function(value) { + return jspb.Message.setProto3BytesField(this, 2, value); +}; + + +/** + * optional bytes moderator_id = 3; + * @return {string} + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval.prototype.getModeratorId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * optional bytes moderator_id = 3; + * This is a type-conversion wrapper around `getModeratorId()` + * @return {string} + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval.prototype.getModeratorId_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getModeratorId())); +}; + + +/** + * optional bytes moderator_id = 3; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getModeratorId()` + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval.prototype.getModeratorId_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getModeratorId())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval} returns this + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval.prototype.setModeratorId = function(value) { + return jspb.Message.setProto3BytesField(this, 3, value); +}; + + +/** + * optional uint64 removed_at = 4; + * @return {number} + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval.prototype.getRemovedAt = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval} returns this + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval.prototype.setRemovedAt = function(value) { + return jspb.Message.setProto3IntField(this, 4, value); +}; + + +/** + * optional ContractModerationReason reason = 5; + * @return {?proto.org.dash.platform.dapi.v0.ContractModerationReason} + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval.prototype.getReason = function() { + return /** @type{?proto.org.dash.platform.dapi.v0.ContractModerationReason} */ ( + jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.ContractModerationReason, 5)); +}; + + +/** + * @param {?proto.org.dash.platform.dapi.v0.ContractModerationReason|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval} returns this +*/ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval.prototype.setReason = function(value) { + return jspb.Message.setWrapperField(this, 5, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval} returns this + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval.prototype.clearReason = function() { + return this.setReason(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval.prototype.hasReason = function() { + return jspb.Message.getField(this, 5) != null; +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemovals.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.GetContractDocumentRemovalsResponse.ContractDocumentRemovals.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemovals.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.GetContractDocumentRemovalsResponse.ContractDocumentRemovals} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemovals.toObject = function(includeInstance, msg) { + var f, obj = { + removalsList: jspb.Message.toObjectList(msg.getRemovalsList(), + proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval.toObject, includeInstance) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemovals} + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemovals.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemovals; + return proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemovals.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.GetContractDocumentRemovalsResponse.ContractDocumentRemovals} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemovals} + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemovals.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.GetContractDocumentRemovalsResponse.ContractDocumentRemoval; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval.deserializeBinaryFromReader); + msg.addRemovals(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.GetContractDocumentRemovalsResponse.ContractDocumentRemovals.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemovals.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.GetContractDocumentRemovalsResponse.ContractDocumentRemovals} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemovals.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getRemovalsList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 1, + f, + proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval.serializeBinaryToWriter + ); + } +}; + + +/** + * repeated ContractDocumentRemoval removals = 1; + * @return {!Array} + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemovals.prototype.getRemovalsList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval, 1)); +}; + + +/** + * @param {!Array} value + * @return {!proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemovals} returns this +*/ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemovals.prototype.setRemovalsList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 1, value); +}; + + +/** + * @param {!proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval=} opt_value + * @param {number=} opt_index + * @return {!proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval} + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemovals.prototype.addRemovals = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemovals} returns this + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemovals.prototype.clearRemovalsList = function() { + return this.setRemovalsList([]); +}; + + + +/** + * 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.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0.oneofGroups_ = [[1,2]]; + +/** + * @enum {number} + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0.ResultCase = { + RESULT_NOT_SET: 0, + REMOVALS: 1, + PROOF: 2 +}; + +/** + * @return {proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0.ResultCase} + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0.prototype.getResultCase = function() { + return /** @type {proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0.ResultCase} */(jspb.Message.computeOneofCase(this, proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0.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.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0.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.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0.toObject = function(includeInstance, msg) { + var f, obj = { + removals: (f = msg.getRemovals()) && proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemovals.toObject(includeInstance, f), + proof: (f = msg.getProof()) && proto.org.dash.platform.dapi.v0.Proof.toObject(includeInstance, f), + metadata: (f = msg.getMetadata()) && proto.org.dash.platform.dapi.v0.ResponseMetadata.toObject(includeInstance, f) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0} + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0; + return proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0.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.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0} + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0.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.GetContractDocumentRemovalsResponse.ContractDocumentRemovals; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemovals.deserializeBinaryFromReader); + msg.setRemovals(value); + break; + case 2: + var value = new proto.org.dash.platform.dapi.v0.Proof; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.Proof.deserializeBinaryFromReader); + msg.setProof(value); + break; + case 3: + var value = new proto.org.dash.platform.dapi.v0.ResponseMetadata; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.ResponseMetadata.deserializeBinaryFromReader); + msg.setMetadata(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0.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.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getRemovals(); + if (f != null) { + writer.writeMessage( + 1, + f, + proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemovals.serializeBinaryToWriter + ); + } + f = message.getProof(); + if (f != null) { + writer.writeMessage( + 2, + f, + proto.org.dash.platform.dapi.v0.Proof.serializeBinaryToWriter + ); + } + f = message.getMetadata(); + if (f != null) { + writer.writeMessage( + 3, + f, + proto.org.dash.platform.dapi.v0.ResponseMetadata.serializeBinaryToWriter + ); + } +}; + + +/** + * optional ContractDocumentRemovals removals = 1; + * @return {?proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemovals} + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0.prototype.getRemovals = function() { + return /** @type{?proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemovals} */ ( + jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemovals, 1)); +}; + + +/** + * @param {?proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemovals|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0} returns this +*/ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0.prototype.setRemovals = function(value) { + return jspb.Message.setOneofWrapperField(this, 1, proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0} returns this + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0.prototype.clearRemovals = function() { + return this.setRemovals(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0.prototype.hasRemovals = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * optional Proof proof = 2; + * @return {?proto.org.dash.platform.dapi.v0.Proof} + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0.prototype.getProof = function() { + return /** @type{?proto.org.dash.platform.dapi.v0.Proof} */ ( + jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.Proof, 2)); +}; + + +/** + * @param {?proto.org.dash.platform.dapi.v0.Proof|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0} returns this +*/ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0.prototype.setProof = function(value) { + return jspb.Message.setOneofWrapperField(this, 2, proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0} returns this + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0.prototype.clearProof = function() { + return this.setProof(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0.prototype.hasProof = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * optional ResponseMetadata metadata = 3; + * @return {?proto.org.dash.platform.dapi.v0.ResponseMetadata} + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0.prototype.getMetadata = function() { + return /** @type{?proto.org.dash.platform.dapi.v0.ResponseMetadata} */ ( + jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.ResponseMetadata, 3)); +}; + + +/** + * @param {?proto.org.dash.platform.dapi.v0.ResponseMetadata|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0} returns this +*/ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0.prototype.setMetadata = function(value) { + return jspb.Message.setWrapperField(this, 3, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0} returns this + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0.prototype.clearMetadata = function() { + return this.setMetadata(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0.prototype.hasMetadata = function() { + return jspb.Message.getField(this, 3) != null; +}; + + +/** + * optional GetContractDocumentRemovalsResponseV0 v0 = 1; + * @return {?proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0} + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.prototype.getV0 = function() { + return /** @type{?proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0} */ ( + jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0, 1)); +}; + + +/** + * @param {?proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse} returns this +*/ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.prototype.setV0 = function(value) { + return jspb.Message.setOneofWrapperField(this, 1, proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse} returns this + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.prototype.clearV0 = function() { + return this.setV0(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.prototype.hasV0 = function() { + return jspb.Message.getField(this, 1) != null; +}; + + + /** * Oneof group definitions for this message. Each group defines the field * numbers belonging to that group. When of these fields' value is set, all diff --git a/packages/dapi-grpc/clients/platform/v0/objective-c/Platform.pbobjc.h b/packages/dapi-grpc/clients/platform/v0/objective-c/Platform.pbobjc.h index d2b9f0c211f..3636cc20ee2 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 @@ -76,6 +76,12 @@ CF_EXTERN_C_BEGIN @class GetContestedResourcesRequest_GetContestedResourcesRequestV0_StartAtValueInfo; @class GetContestedResourcesResponse_GetContestedResourcesResponseV0; @class GetContestedResourcesResponse_GetContestedResourcesResponseV0_ContestedResourceValues; +@class GetContractDocumentRemovalsRequest_DocumentIds; +@class GetContractDocumentRemovalsRequest_GetContractDocumentRemovalsRequestV0; +@class GetContractDocumentRemovalsRequest_Page; +@class GetContractDocumentRemovalsResponse_ContractDocumentRemoval; +@class GetContractDocumentRemovalsResponse_ContractDocumentRemovals; +@class GetContractDocumentRemovalsResponse_GetContractDocumentRemovalsResponseV0; @class GetContractFeePotsRequest_GetContractFeePotsRequestV0; @class GetContractFeePotsResponse_ContractFeePot; @class GetContractFeePotsResponse_ContractFeePotLastClaim; @@ -3313,6 +3319,218 @@ GPB_FINAL @interface GetContractModerationEntriesResponse_GetContractModerationE **/ void GetContractModerationEntriesResponse_GetContractModerationEntriesResponseV0_ClearResultOneOfCase(GetContractModerationEntriesResponse_GetContractModerationEntriesResponseV0 *message); +#pragma mark - GetContractDocumentRemovalsRequest + +typedef GPB_ENUM(GetContractDocumentRemovalsRequest_FieldNumber) { + GetContractDocumentRemovalsRequest_FieldNumber_V0 = 1, +}; + +typedef GPB_ENUM(GetContractDocumentRemovalsRequest_Version_OneOfCase) { + GetContractDocumentRemovalsRequest_Version_OneOfCase_GPBUnsetOneOfCase = 0, + GetContractDocumentRemovalsRequest_Version_OneOfCase_V0 = 1, +}; + +/** + * The records of the documents a contract's moderators deleted, within one + * document type whose documents they may delete (`canBeDeletedByModerators`): + * the ones of the document ids named, or one page in document id order. + **/ +GPB_FINAL @interface GetContractDocumentRemovalsRequest : GPBMessage + +@property(nonatomic, readonly) GetContractDocumentRemovalsRequest_Version_OneOfCase versionOneOfCase; + +@property(nonatomic, readwrite, strong, null_resettable) GetContractDocumentRemovalsRequest_GetContractDocumentRemovalsRequestV0 *v0; + +@end + +/** + * Clears whatever value was set for the oneof 'version'. + **/ +void GetContractDocumentRemovalsRequest_ClearVersionOneOfCase(GetContractDocumentRemovalsRequest *message); + +#pragma mark - GetContractDocumentRemovalsRequest_DocumentIds + +typedef GPB_ENUM(GetContractDocumentRemovalsRequest_DocumentIds_FieldNumber) { + GetContractDocumentRemovalsRequest_DocumentIds_FieldNumber_DocumentIdsArray = 1, +}; + +GPB_FINAL @interface GetContractDocumentRemovalsRequest_DocumentIds : GPBMessage + +/** 32-byte document ids, from 1 to the protocol's */ +@property(nonatomic, readwrite, strong, null_resettable) NSMutableArray *documentIdsArray; +/** The number of items in @c documentIdsArray without causing the array to be created. */ +@property(nonatomic, readonly) NSUInteger documentIdsArray_Count; + +@end + +#pragma mark - GetContractDocumentRemovalsRequest_Page + +typedef GPB_ENUM(GetContractDocumentRemovalsRequest_Page_FieldNumber) { + GetContractDocumentRemovalsRequest_Page_FieldNumber_StartAfter = 1, + GetContractDocumentRemovalsRequest_Page_FieldNumber_Limit = 2, +}; + +GPB_FINAL @interface GetContractDocumentRemovalsRequest_Page : GPBMessage + +/** 32-byte document id; the page starts after it */ +@property(nonatomic, readwrite, copy, null_resettable) NSData *startAfter; +/** Test to see if @c startAfter has been set. */ +@property(nonatomic, readwrite) BOOL hasStartAfter; + +/** Maximum number of records to return, from 1 to the protocol's */ +@property(nonatomic, readwrite) uint32_t limit; + +@property(nonatomic, readwrite) BOOL hasLimit; +@end + +#pragma mark - GetContractDocumentRemovalsRequest_GetContractDocumentRemovalsRequestV0 + +typedef GPB_ENUM(GetContractDocumentRemovalsRequest_GetContractDocumentRemovalsRequestV0_FieldNumber) { + GetContractDocumentRemovalsRequest_GetContractDocumentRemovalsRequestV0_FieldNumber_ContractId = 1, + GetContractDocumentRemovalsRequest_GetContractDocumentRemovalsRequestV0_FieldNumber_DocumentTypeName = 2, + GetContractDocumentRemovalsRequest_GetContractDocumentRemovalsRequestV0_FieldNumber_DocumentIds = 3, + GetContractDocumentRemovalsRequest_GetContractDocumentRemovalsRequestV0_FieldNumber_Page = 4, + GetContractDocumentRemovalsRequest_GetContractDocumentRemovalsRequestV0_FieldNumber_Prove = 5, +}; + +typedef GPB_ENUM(GetContractDocumentRemovalsRequest_GetContractDocumentRemovalsRequestV0_Selection_OneOfCase) { + GetContractDocumentRemovalsRequest_GetContractDocumentRemovalsRequestV0_Selection_OneOfCase_GPBUnsetOneOfCase = 0, + GetContractDocumentRemovalsRequest_GetContractDocumentRemovalsRequestV0_Selection_OneOfCase_DocumentIds = 3, + GetContractDocumentRemovalsRequest_GetContractDocumentRemovalsRequestV0_Selection_OneOfCase_Page = 4, +}; + +GPB_FINAL @interface GetContractDocumentRemovalsRequest_GetContractDocumentRemovalsRequestV0 : GPBMessage + +/** The 32-byte id of the moderated contract */ +@property(nonatomic, readwrite, copy, null_resettable) NSData *contractId; + +/** The document type, which must let moderators delete its documents */ +@property(nonatomic, readwrite, copy, null_resettable) NSString *documentTypeName; + +@property(nonatomic, readonly) GetContractDocumentRemovalsRequest_GetContractDocumentRemovalsRequestV0_Selection_OneOfCase selectionOneOfCase; + +/** The records of these documents */ +@property(nonatomic, readwrite, strong, null_resettable) GetContractDocumentRemovalsRequest_DocumentIds *documentIds; + +/** One page of the type's records */ +@property(nonatomic, readwrite, strong, null_resettable) GetContractDocumentRemovalsRequest_Page *page; + +/** Flag to request a proof as the response */ +@property(nonatomic, readwrite) BOOL prove; + +@end + +/** + * Clears whatever value was set for the oneof 'selection'. + **/ +void GetContractDocumentRemovalsRequest_GetContractDocumentRemovalsRequestV0_ClearSelectionOneOfCase(GetContractDocumentRemovalsRequest_GetContractDocumentRemovalsRequestV0 *message); + +#pragma mark - GetContractDocumentRemovalsResponse + +typedef GPB_ENUM(GetContractDocumentRemovalsResponse_FieldNumber) { + GetContractDocumentRemovalsResponse_FieldNumber_V0 = 1, +}; + +typedef GPB_ENUM(GetContractDocumentRemovalsResponse_Version_OneOfCase) { + GetContractDocumentRemovalsResponse_Version_OneOfCase_GPBUnsetOneOfCase = 0, + GetContractDocumentRemovalsResponse_Version_OneOfCase_V0 = 1, +}; + +GPB_FINAL @interface GetContractDocumentRemovalsResponse : GPBMessage + +@property(nonatomic, readonly) GetContractDocumentRemovalsResponse_Version_OneOfCase versionOneOfCase; + +@property(nonatomic, readwrite, strong, null_resettable) GetContractDocumentRemovalsResponse_GetContractDocumentRemovalsResponseV0 *v0; + +@end + +/** + * Clears whatever value was set for the oneof 'version'. + **/ +void GetContractDocumentRemovalsResponse_ClearVersionOneOfCase(GetContractDocumentRemovalsResponse *message); + +#pragma mark - GetContractDocumentRemovalsResponse_ContractDocumentRemoval + +typedef GPB_ENUM(GetContractDocumentRemovalsResponse_ContractDocumentRemoval_FieldNumber) { + GetContractDocumentRemovalsResponse_ContractDocumentRemoval_FieldNumber_DocumentId = 1, + GetContractDocumentRemovalsResponse_ContractDocumentRemoval_FieldNumber_DocumentOwnerId = 2, + GetContractDocumentRemovalsResponse_ContractDocumentRemoval_FieldNumber_ModeratorId = 3, + GetContractDocumentRemovalsResponse_ContractDocumentRemoval_FieldNumber_RemovedAt = 4, + GetContractDocumentRemovalsResponse_ContractDocumentRemoval_FieldNumber_Reason = 5, +}; + +GPB_FINAL @interface GetContractDocumentRemovalsResponse_ContractDocumentRemoval : GPBMessage + +/** The id the removed document had */ +@property(nonatomic, readwrite, copy, null_resettable) NSData *documentId; + +/** The identity that owned it */ +@property(nonatomic, readwrite, copy, null_resettable) NSData *documentOwnerId; + +/** The contract owner or moderator that removed it */ +@property(nonatomic, readwrite, copy, null_resettable) NSData *moderatorId; + +/** The time of the block that removed it, in milliseconds */ +@property(nonatomic, readwrite) uint64_t removedAt; + +/** Why the moderator removed it */ +@property(nonatomic, readwrite, strong, null_resettable) ContractModerationReason *reason; +/** Test to see if @c reason has been set. */ +@property(nonatomic, readwrite) BOOL hasReason; + +@end + +#pragma mark - GetContractDocumentRemovalsResponse_ContractDocumentRemovals + +typedef GPB_ENUM(GetContractDocumentRemovalsResponse_ContractDocumentRemovals_FieldNumber) { + GetContractDocumentRemovalsResponse_ContractDocumentRemovals_FieldNumber_RemovalsArray = 1, +}; + +GPB_FINAL @interface GetContractDocumentRemovalsResponse_ContractDocumentRemovals : GPBMessage + +/** The records, in document id order */ +@property(nonatomic, readwrite, strong, null_resettable) NSMutableArray *removalsArray; +/** The number of items in @c removalsArray without causing the array to be created. */ +@property(nonatomic, readonly) NSUInteger removalsArray_Count; + +@end + +#pragma mark - GetContractDocumentRemovalsResponse_GetContractDocumentRemovalsResponseV0 + +typedef GPB_ENUM(GetContractDocumentRemovalsResponse_GetContractDocumentRemovalsResponseV0_FieldNumber) { + GetContractDocumentRemovalsResponse_GetContractDocumentRemovalsResponseV0_FieldNumber_Removals = 1, + GetContractDocumentRemovalsResponse_GetContractDocumentRemovalsResponseV0_FieldNumber_Proof = 2, + GetContractDocumentRemovalsResponse_GetContractDocumentRemovalsResponseV0_FieldNumber_Metadata = 3, +}; + +typedef GPB_ENUM(GetContractDocumentRemovalsResponse_GetContractDocumentRemovalsResponseV0_Result_OneOfCase) { + GetContractDocumentRemovalsResponse_GetContractDocumentRemovalsResponseV0_Result_OneOfCase_GPBUnsetOneOfCase = 0, + GetContractDocumentRemovalsResponse_GetContractDocumentRemovalsResponseV0_Result_OneOfCase_Removals = 1, + GetContractDocumentRemovalsResponse_GetContractDocumentRemovalsResponseV0_Result_OneOfCase_Proof = 2, +}; + +GPB_FINAL @interface GetContractDocumentRemovalsResponse_GetContractDocumentRemovalsResponseV0 : GPBMessage + +@property(nonatomic, readonly) GetContractDocumentRemovalsResponse_GetContractDocumentRemovalsResponseV0_Result_OneOfCase resultOneOfCase; + +/** The records read */ +@property(nonatomic, readwrite, strong, null_resettable) GetContractDocumentRemovalsResponse_ContractDocumentRemovals *removals; + +/** Cryptographic proof of the records, if requested */ +@property(nonatomic, readwrite, strong, null_resettable) Proof *proof; + +/** Metadata about the blockchain state */ +@property(nonatomic, readwrite, strong, null_resettable) ResponseMetadata *metadata; +/** Test to see if @c metadata has been set. */ +@property(nonatomic, readwrite) BOOL hasMetadata; + +@end + +/** + * Clears whatever value was set for the oneof 'result'. + **/ +void GetContractDocumentRemovalsResponse_GetContractDocumentRemovalsResponseV0_ClearResultOneOfCase(GetContractDocumentRemovalsResponse_GetContractDocumentRemovalsResponseV0 *message); + #pragma mark - GetContractFeePotsRequest typedef GPB_ENUM(GetContractFeePotsRequest_FieldNumber) { diff --git a/packages/dapi-grpc/clients/platform/v0/objective-c/Platform.pbobjc.m b/packages/dapi-grpc/clients/platform/v0/objective-c/Platform.pbobjc.m index aae205dbe0f..893a2078f3e 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 @@ -94,6 +94,14 @@ GPBObjCClassDeclaration(GetContestedResourcesResponse); GPBObjCClassDeclaration(GetContestedResourcesResponse_GetContestedResourcesResponseV0); GPBObjCClassDeclaration(GetContestedResourcesResponse_GetContestedResourcesResponseV0_ContestedResourceValues); +GPBObjCClassDeclaration(GetContractDocumentRemovalsRequest); +GPBObjCClassDeclaration(GetContractDocumentRemovalsRequest_DocumentIds); +GPBObjCClassDeclaration(GetContractDocumentRemovalsRequest_GetContractDocumentRemovalsRequestV0); +GPBObjCClassDeclaration(GetContractDocumentRemovalsRequest_Page); +GPBObjCClassDeclaration(GetContractDocumentRemovalsResponse); +GPBObjCClassDeclaration(GetContractDocumentRemovalsResponse_ContractDocumentRemoval); +GPBObjCClassDeclaration(GetContractDocumentRemovalsResponse_ContractDocumentRemovals); +GPBObjCClassDeclaration(GetContractDocumentRemovalsResponse_GetContractDocumentRemovalsResponseV0); GPBObjCClassDeclaration(GetContractFeePotsRequest); GPBObjCClassDeclaration(GetContractFeePotsRequest_GetContractFeePotsRequestV0); GPBObjCClassDeclaration(GetContractFeePotsResponse); @@ -7052,6 +7060,540 @@ void GetContractModerationEntriesResponse_GetContractModerationEntriesResponseV0 GPBOneofDescriptor *oneof = [descriptor.oneofs objectAtIndex:0]; GPBClearOneof(message, oneof); } +#pragma mark - GetContractDocumentRemovalsRequest + +@implementation GetContractDocumentRemovalsRequest + +@dynamic versionOneOfCase; +@dynamic v0; + +typedef struct GetContractDocumentRemovalsRequest__storage_ { + uint32_t _has_storage_[2]; + GetContractDocumentRemovalsRequest_GetContractDocumentRemovalsRequestV0 *v0; +} GetContractDocumentRemovalsRequest__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(GetContractDocumentRemovalsRequest_GetContractDocumentRemovalsRequestV0), + .number = GetContractDocumentRemovalsRequest_FieldNumber_V0, + .hasIndex = -1, + .offset = (uint32_t)offsetof(GetContractDocumentRemovalsRequest__storage_, v0), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeMessage, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GetContractDocumentRemovalsRequest class] + rootClass:[PlatformRoot class] + file:PlatformRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(GetContractDocumentRemovalsRequest__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 GetContractDocumentRemovalsRequest_ClearVersionOneOfCase(GetContractDocumentRemovalsRequest *message) { + GPBDescriptor *descriptor = [GetContractDocumentRemovalsRequest descriptor]; + GPBOneofDescriptor *oneof = [descriptor.oneofs objectAtIndex:0]; + GPBClearOneof(message, oneof); +} +#pragma mark - GetContractDocumentRemovalsRequest_DocumentIds + +@implementation GetContractDocumentRemovalsRequest_DocumentIds + +@dynamic documentIdsArray, documentIdsArray_Count; + +typedef struct GetContractDocumentRemovalsRequest_DocumentIds__storage_ { + uint32_t _has_storage_[1]; + NSMutableArray *documentIdsArray; +} GetContractDocumentRemovalsRequest_DocumentIds__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 = "documentIdsArray", + .dataTypeSpecific.clazz = Nil, + .number = GetContractDocumentRemovalsRequest_DocumentIds_FieldNumber_DocumentIdsArray, + .hasIndex = GPBNoHasBit, + .offset = (uint32_t)offsetof(GetContractDocumentRemovalsRequest_DocumentIds__storage_, documentIdsArray), + .flags = GPBFieldRepeated, + .dataType = GPBDataTypeBytes, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GetContractDocumentRemovalsRequest_DocumentIds class] + rootClass:[PlatformRoot class] + file:PlatformRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(GetContractDocumentRemovalsRequest_DocumentIds__storage_) + flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown)]; + [localDescriptor setupContainingMessageClass:GPBObjCClass(GetContractDocumentRemovalsRequest)]; + #if defined(DEBUG) && DEBUG + NSAssert(descriptor == nil, @"Startup recursed!"); + #endif // DEBUG + descriptor = localDescriptor; + } + return descriptor; +} + +@end + +#pragma mark - GetContractDocumentRemovalsRequest_Page + +@implementation GetContractDocumentRemovalsRequest_Page + +@dynamic hasStartAfter, startAfter; +@dynamic hasLimit, limit; + +typedef struct GetContractDocumentRemovalsRequest_Page__storage_ { + uint32_t _has_storage_[1]; + uint32_t limit; + NSData *startAfter; +} GetContractDocumentRemovalsRequest_Page__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 = "startAfter", + .dataTypeSpecific.clazz = Nil, + .number = GetContractDocumentRemovalsRequest_Page_FieldNumber_StartAfter, + .hasIndex = 0, + .offset = (uint32_t)offsetof(GetContractDocumentRemovalsRequest_Page__storage_, startAfter), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeBytes, + }, + { + .name = "limit", + .dataTypeSpecific.clazz = Nil, + .number = GetContractDocumentRemovalsRequest_Page_FieldNumber_Limit, + .hasIndex = 1, + .offset = (uint32_t)offsetof(GetContractDocumentRemovalsRequest_Page__storage_, limit), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeUInt32, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GetContractDocumentRemovalsRequest_Page class] + rootClass:[PlatformRoot class] + file:PlatformRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(GetContractDocumentRemovalsRequest_Page__storage_) + flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown)]; + [localDescriptor setupContainingMessageClass:GPBObjCClass(GetContractDocumentRemovalsRequest)]; + #if defined(DEBUG) && DEBUG + NSAssert(descriptor == nil, @"Startup recursed!"); + #endif // DEBUG + descriptor = localDescriptor; + } + return descriptor; +} + +@end + +#pragma mark - GetContractDocumentRemovalsRequest_GetContractDocumentRemovalsRequestV0 + +@implementation GetContractDocumentRemovalsRequest_GetContractDocumentRemovalsRequestV0 + +@dynamic selectionOneOfCase; +@dynamic contractId; +@dynamic documentTypeName; +@dynamic documentIds; +@dynamic page; +@dynamic prove; + +typedef struct GetContractDocumentRemovalsRequest_GetContractDocumentRemovalsRequestV0__storage_ { + uint32_t _has_storage_[2]; + NSData *contractId; + NSString *documentTypeName; + GetContractDocumentRemovalsRequest_DocumentIds *documentIds; + GetContractDocumentRemovalsRequest_Page *page; +} GetContractDocumentRemovalsRequest_GetContractDocumentRemovalsRequestV0__storage_; + +// This method is threadsafe because it is initially called +// in +initialize for each subclass. ++ (GPBDescriptor *)descriptor { + static GPBDescriptor *descriptor = nil; + if (!descriptor) { + static GPBMessageFieldDescription fields[] = { + { + .name = "contractId", + .dataTypeSpecific.clazz = Nil, + .number = GetContractDocumentRemovalsRequest_GetContractDocumentRemovalsRequestV0_FieldNumber_ContractId, + .hasIndex = 0, + .offset = (uint32_t)offsetof(GetContractDocumentRemovalsRequest_GetContractDocumentRemovalsRequestV0__storage_, contractId), + .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), + .dataType = GPBDataTypeBytes, + }, + { + .name = "documentTypeName", + .dataTypeSpecific.clazz = Nil, + .number = GetContractDocumentRemovalsRequest_GetContractDocumentRemovalsRequestV0_FieldNumber_DocumentTypeName, + .hasIndex = 1, + .offset = (uint32_t)offsetof(GetContractDocumentRemovalsRequest_GetContractDocumentRemovalsRequestV0__storage_, documentTypeName), + .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), + .dataType = GPBDataTypeString, + }, + { + .name = "documentIds", + .dataTypeSpecific.clazz = GPBObjCClass(GetContractDocumentRemovalsRequest_DocumentIds), + .number = GetContractDocumentRemovalsRequest_GetContractDocumentRemovalsRequestV0_FieldNumber_DocumentIds, + .hasIndex = -1, + .offset = (uint32_t)offsetof(GetContractDocumentRemovalsRequest_GetContractDocumentRemovalsRequestV0__storage_, documentIds), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeMessage, + }, + { + .name = "page", + .dataTypeSpecific.clazz = GPBObjCClass(GetContractDocumentRemovalsRequest_Page), + .number = GetContractDocumentRemovalsRequest_GetContractDocumentRemovalsRequestV0_FieldNumber_Page, + .hasIndex = -1, + .offset = (uint32_t)offsetof(GetContractDocumentRemovalsRequest_GetContractDocumentRemovalsRequestV0__storage_, page), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeMessage, + }, + { + .name = "prove", + .dataTypeSpecific.clazz = Nil, + .number = GetContractDocumentRemovalsRequest_GetContractDocumentRemovalsRequestV0_FieldNumber_Prove, + .hasIndex = 2, + .offset = 3, // Stored in _has_storage_ to save space. + .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), + .dataType = GPBDataTypeBool, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GetContractDocumentRemovalsRequest_GetContractDocumentRemovalsRequestV0 class] + rootClass:[PlatformRoot class] + file:PlatformRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(GetContractDocumentRemovalsRequest_GetContractDocumentRemovalsRequestV0__storage_) + flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown)]; + static const char *oneofs[] = { + "selection", + }; + [localDescriptor setupOneofs:oneofs + count:(uint32_t)(sizeof(oneofs) / sizeof(char*)) + firstHasIndex:-1]; + [localDescriptor setupContainingMessageClass:GPBObjCClass(GetContractDocumentRemovalsRequest)]; + #if defined(DEBUG) && DEBUG + NSAssert(descriptor == nil, @"Startup recursed!"); + #endif // DEBUG + descriptor = localDescriptor; + } + return descriptor; +} + +@end + +void GetContractDocumentRemovalsRequest_GetContractDocumentRemovalsRequestV0_ClearSelectionOneOfCase(GetContractDocumentRemovalsRequest_GetContractDocumentRemovalsRequestV0 *message) { + GPBDescriptor *descriptor = [GetContractDocumentRemovalsRequest_GetContractDocumentRemovalsRequestV0 descriptor]; + GPBOneofDescriptor *oneof = [descriptor.oneofs objectAtIndex:0]; + GPBClearOneof(message, oneof); +} +#pragma mark - GetContractDocumentRemovalsResponse + +@implementation GetContractDocumentRemovalsResponse + +@dynamic versionOneOfCase; +@dynamic v0; + +typedef struct GetContractDocumentRemovalsResponse__storage_ { + uint32_t _has_storage_[2]; + GetContractDocumentRemovalsResponse_GetContractDocumentRemovalsResponseV0 *v0; +} GetContractDocumentRemovalsResponse__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(GetContractDocumentRemovalsResponse_GetContractDocumentRemovalsResponseV0), + .number = GetContractDocumentRemovalsResponse_FieldNumber_V0, + .hasIndex = -1, + .offset = (uint32_t)offsetof(GetContractDocumentRemovalsResponse__storage_, v0), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeMessage, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GetContractDocumentRemovalsResponse class] + rootClass:[PlatformRoot class] + file:PlatformRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(GetContractDocumentRemovalsResponse__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 GetContractDocumentRemovalsResponse_ClearVersionOneOfCase(GetContractDocumentRemovalsResponse *message) { + GPBDescriptor *descriptor = [GetContractDocumentRemovalsResponse descriptor]; + GPBOneofDescriptor *oneof = [descriptor.oneofs objectAtIndex:0]; + GPBClearOneof(message, oneof); +} +#pragma mark - GetContractDocumentRemovalsResponse_ContractDocumentRemoval + +@implementation GetContractDocumentRemovalsResponse_ContractDocumentRemoval + +@dynamic documentId; +@dynamic documentOwnerId; +@dynamic moderatorId; +@dynamic removedAt; +@dynamic hasReason, reason; + +typedef struct GetContractDocumentRemovalsResponse_ContractDocumentRemoval__storage_ { + uint32_t _has_storage_[1]; + NSData *documentId; + NSData *documentOwnerId; + NSData *moderatorId; + ContractModerationReason *reason; + uint64_t removedAt; +} GetContractDocumentRemovalsResponse_ContractDocumentRemoval__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 = "documentId", + .dataTypeSpecific.clazz = Nil, + .number = GetContractDocumentRemovalsResponse_ContractDocumentRemoval_FieldNumber_DocumentId, + .hasIndex = 0, + .offset = (uint32_t)offsetof(GetContractDocumentRemovalsResponse_ContractDocumentRemoval__storage_, documentId), + .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), + .dataType = GPBDataTypeBytes, + }, + { + .name = "documentOwnerId", + .dataTypeSpecific.clazz = Nil, + .number = GetContractDocumentRemovalsResponse_ContractDocumentRemoval_FieldNumber_DocumentOwnerId, + .hasIndex = 1, + .offset = (uint32_t)offsetof(GetContractDocumentRemovalsResponse_ContractDocumentRemoval__storage_, documentOwnerId), + .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), + .dataType = GPBDataTypeBytes, + }, + { + .name = "moderatorId", + .dataTypeSpecific.clazz = Nil, + .number = GetContractDocumentRemovalsResponse_ContractDocumentRemoval_FieldNumber_ModeratorId, + .hasIndex = 2, + .offset = (uint32_t)offsetof(GetContractDocumentRemovalsResponse_ContractDocumentRemoval__storage_, moderatorId), + .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), + .dataType = GPBDataTypeBytes, + }, + { + .name = "removedAt", + .dataTypeSpecific.clazz = Nil, + .number = GetContractDocumentRemovalsResponse_ContractDocumentRemoval_FieldNumber_RemovedAt, + .hasIndex = 3, + .offset = (uint32_t)offsetof(GetContractDocumentRemovalsResponse_ContractDocumentRemoval__storage_, removedAt), + .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), + .dataType = GPBDataTypeUInt64, + }, + { + .name = "reason", + .dataTypeSpecific.clazz = GPBObjCClass(ContractModerationReason), + .number = GetContractDocumentRemovalsResponse_ContractDocumentRemoval_FieldNumber_Reason, + .hasIndex = 4, + .offset = (uint32_t)offsetof(GetContractDocumentRemovalsResponse_ContractDocumentRemoval__storage_, reason), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeMessage, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GetContractDocumentRemovalsResponse_ContractDocumentRemoval class] + rootClass:[PlatformRoot class] + file:PlatformRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(GetContractDocumentRemovalsResponse_ContractDocumentRemoval__storage_) + flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown)]; + [localDescriptor setupContainingMessageClass:GPBObjCClass(GetContractDocumentRemovalsResponse)]; + #if defined(DEBUG) && DEBUG + NSAssert(descriptor == nil, @"Startup recursed!"); + #endif // DEBUG + descriptor = localDescriptor; + } + return descriptor; +} + +@end + +#pragma mark - GetContractDocumentRemovalsResponse_ContractDocumentRemovals + +@implementation GetContractDocumentRemovalsResponse_ContractDocumentRemovals + +@dynamic removalsArray, removalsArray_Count; + +typedef struct GetContractDocumentRemovalsResponse_ContractDocumentRemovals__storage_ { + uint32_t _has_storage_[1]; + NSMutableArray *removalsArray; +} GetContractDocumentRemovalsResponse_ContractDocumentRemovals__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 = "removalsArray", + .dataTypeSpecific.clazz = GPBObjCClass(GetContractDocumentRemovalsResponse_ContractDocumentRemoval), + .number = GetContractDocumentRemovalsResponse_ContractDocumentRemovals_FieldNumber_RemovalsArray, + .hasIndex = GPBNoHasBit, + .offset = (uint32_t)offsetof(GetContractDocumentRemovalsResponse_ContractDocumentRemovals__storage_, removalsArray), + .flags = GPBFieldRepeated, + .dataType = GPBDataTypeMessage, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GetContractDocumentRemovalsResponse_ContractDocumentRemovals class] + rootClass:[PlatformRoot class] + file:PlatformRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(GetContractDocumentRemovalsResponse_ContractDocumentRemovals__storage_) + flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown)]; + [localDescriptor setupContainingMessageClass:GPBObjCClass(GetContractDocumentRemovalsResponse)]; + #if defined(DEBUG) && DEBUG + NSAssert(descriptor == nil, @"Startup recursed!"); + #endif // DEBUG + descriptor = localDescriptor; + } + return descriptor; +} + +@end + +#pragma mark - GetContractDocumentRemovalsResponse_GetContractDocumentRemovalsResponseV0 + +@implementation GetContractDocumentRemovalsResponse_GetContractDocumentRemovalsResponseV0 + +@dynamic resultOneOfCase; +@dynamic removals; +@dynamic proof; +@dynamic hasMetadata, metadata; + +typedef struct GetContractDocumentRemovalsResponse_GetContractDocumentRemovalsResponseV0__storage_ { + uint32_t _has_storage_[2]; + GetContractDocumentRemovalsResponse_ContractDocumentRemovals *removals; + Proof *proof; + ResponseMetadata *metadata; +} GetContractDocumentRemovalsResponse_GetContractDocumentRemovalsResponseV0__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 = "removals", + .dataTypeSpecific.clazz = GPBObjCClass(GetContractDocumentRemovalsResponse_ContractDocumentRemovals), + .number = GetContractDocumentRemovalsResponse_GetContractDocumentRemovalsResponseV0_FieldNumber_Removals, + .hasIndex = -1, + .offset = (uint32_t)offsetof(GetContractDocumentRemovalsResponse_GetContractDocumentRemovalsResponseV0__storage_, removals), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeMessage, + }, + { + .name = "proof", + .dataTypeSpecific.clazz = GPBObjCClass(Proof), + .number = GetContractDocumentRemovalsResponse_GetContractDocumentRemovalsResponseV0_FieldNumber_Proof, + .hasIndex = -1, + .offset = (uint32_t)offsetof(GetContractDocumentRemovalsResponse_GetContractDocumentRemovalsResponseV0__storage_, proof), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeMessage, + }, + { + .name = "metadata", + .dataTypeSpecific.clazz = GPBObjCClass(ResponseMetadata), + .number = GetContractDocumentRemovalsResponse_GetContractDocumentRemovalsResponseV0_FieldNumber_Metadata, + .hasIndex = 0, + .offset = (uint32_t)offsetof(GetContractDocumentRemovalsResponse_GetContractDocumentRemovalsResponseV0__storage_, metadata), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeMessage, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GetContractDocumentRemovalsResponse_GetContractDocumentRemovalsResponseV0 class] + rootClass:[PlatformRoot class] + file:PlatformRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(GetContractDocumentRemovalsResponse_GetContractDocumentRemovalsResponseV0__storage_) + flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown)]; + static const char *oneofs[] = { + "result", + }; + [localDescriptor setupOneofs:oneofs + count:(uint32_t)(sizeof(oneofs) / sizeof(char*)) + firstHasIndex:-1]; + [localDescriptor setupContainingMessageClass:GPBObjCClass(GetContractDocumentRemovalsResponse)]; + #if defined(DEBUG) && DEBUG + NSAssert(descriptor == nil, @"Startup recursed!"); + #endif // DEBUG + descriptor = localDescriptor; + } + return descriptor; +} + +@end + +void GetContractDocumentRemovalsResponse_GetContractDocumentRemovalsResponseV0_ClearResultOneOfCase(GetContractDocumentRemovalsResponse_GetContractDocumentRemovalsResponseV0 *message) { + GPBDescriptor *descriptor = [GetContractDocumentRemovalsResponse_GetContractDocumentRemovalsResponseV0 descriptor]; + GPBOneofDescriptor *oneof = [descriptor.oneofs objectAtIndex:0]; + GPBClearOneof(message, oneof); +} #pragma mark - GetContractFeePotsRequest @implementation GetContractFeePotsRequest 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 56f912bf51a..ab287673079 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 @@ -34,6 +34,8 @@ @class GetContestedResourceVotersForIdentityResponse; @class GetContestedResourcesRequest; @class GetContestedResourcesResponse; +@class GetContractDocumentRemovalsRequest; +@class GetContractDocumentRemovalsResponse; @class GetContractFeePotsRequest; @class GetContractFeePotsResponse; @class GetContractGroupInfoRequest; @@ -271,6 +273,10 @@ NS_ASSUME_NONNULL_BEGIN - (GRPCUnaryProtoCall *)getContractModerationEntriesWithMessage:(GetContractModerationEntriesRequest *)message responseHandler:(id)handler callOptions:(GRPCCallOptions *_Nullable)callOptions; +#pragma mark getContractDocumentRemovals(GetContractDocumentRemovalsRequest) returns (GetContractDocumentRemovalsResponse) + +- (GRPCUnaryProtoCall *)getContractDocumentRemovalsWithMessage:(GetContractDocumentRemovalsRequest *)message responseHandler:(id)handler callOptions:(GRPCCallOptions *_Nullable)callOptions; + #pragma mark getContractFeePots(GetContractFeePotsRequest) returns (GetContractFeePotsResponse) - (GRPCUnaryProtoCall *)getContractFeePotsWithMessage:(GetContractFeePotsRequest *)message responseHandler:(id)handler callOptions:(GRPCCallOptions *_Nullable)callOptions; @@ -649,6 +655,13 @@ NS_ASSUME_NONNULL_BEGIN - (GRPCProtoCall *)RPCTogetContractModerationEntriesWithRequest:(GetContractModerationEntriesRequest *)request handler:(void(^)(GetContractModerationEntriesResponse *_Nullable response, NSError *_Nullable error))handler; +#pragma mark getContractDocumentRemovals(GetContractDocumentRemovalsRequest) returns (GetContractDocumentRemovalsResponse) + +- (void)getContractDocumentRemovalsWithRequest:(GetContractDocumentRemovalsRequest *)request handler:(void(^)(GetContractDocumentRemovalsResponse *_Nullable response, NSError *_Nullable error))handler; + +- (GRPCProtoCall *)RPCTogetContractDocumentRemovalsWithRequest:(GetContractDocumentRemovalsRequest *)request handler:(void(^)(GetContractDocumentRemovalsResponse *_Nullable response, NSError *_Nullable error))handler; + + #pragma mark getContractFeePots(GetContractFeePotsRequest) returns (GetContractFeePotsResponse) - (void)getContractFeePotsWithRequest:(GetContractFeePotsRequest *)request handler:(void(^)(GetContractFeePotsResponse *_Nullable response, NSError *_Nullable error))handler; diff --git a/packages/dapi-grpc/clients/platform/v0/objective-c/Platform.pbrpc.m b/packages/dapi-grpc/clients/platform/v0/objective-c/Platform.pbrpc.m index a7f186e8b34..d897a4c204a 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 @@ -523,6 +523,26 @@ - (GRPCUnaryProtoCall *)getContractModerationEntriesWithMessage:(GetContractMode responseClass:[GetContractModerationEntriesResponse class]]; } +#pragma mark getContractDocumentRemovals(GetContractDocumentRemovalsRequest) returns (GetContractDocumentRemovalsResponse) + +- (void)getContractDocumentRemovalsWithRequest:(GetContractDocumentRemovalsRequest *)request handler:(void(^)(GetContractDocumentRemovalsResponse *_Nullable response, NSError *_Nullable error))handler{ + [[self RPCTogetContractDocumentRemovalsWithRequest:request handler:handler] start]; +} +// Returns a not-yet-started RPC object. +- (GRPCProtoCall *)RPCTogetContractDocumentRemovalsWithRequest:(GetContractDocumentRemovalsRequest *)request handler:(void(^)(GetContractDocumentRemovalsResponse *_Nullable response, NSError *_Nullable error))handler{ + return [self RPCToMethod:@"getContractDocumentRemovals" + requestsWriter:[GRXWriter writerWithValue:request] + responseClass:[GetContractDocumentRemovalsResponse class] + responsesWriteable:[GRXWriteable writeableWithSingleHandler:handler]]; +} +- (GRPCUnaryProtoCall *)getContractDocumentRemovalsWithMessage:(GetContractDocumentRemovalsRequest *)message responseHandler:(id)handler callOptions:(GRPCCallOptions *_Nullable)callOptions { + return [self RPCToMethod:@"getContractDocumentRemovals" + message:message + responseHandler:handler + callOptions:callOptions + responseClass:[GetContractDocumentRemovalsResponse class]]; +} + #pragma mark getContractFeePots(GetContractFeePotsRequest) returns (GetContractFeePotsResponse) - (void)getContractFeePotsWithRequest:(GetContractFeePotsRequest *)request handler:(void(^)(GetContractFeePotsResponse *_Nullable response, NSError *_Nullable error))handler{ diff --git a/packages/dapi-grpc/clients/platform/v0/python/platform_pb2.py b/packages/dapi-grpc/clients/platform/v0/python/platform_pb2.py index 19064f19ac2..1012ca63427 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\"D\n\x18\x43ontractModerationReason\x12\x11\n\x04\x63ode\x18\x01 \x01(\rH\x00\x88\x01\x01\x12\x0c\n\x04text\x18\x02 \x01(\tB\x07\n\x05_code\"\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\"\xae\x06\n#GetContractModerationStatusResponse\x12r\n\x02v0\x18\x01 \x01(\x0b\x32\x64.org.dash.platform.dapi.v0.GetContractModerationStatusResponse.GetContractModerationStatusResponseV0H\x00\x1a\xf6\x02\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\x42\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\"\xd8\x05\n$GetContractModerationEntriesResponse\x12t\n\x02v0\x18\x01 \x01(\x0b\x32\x66.org.dash.platform.dapi.v0.GetContractModerationEntriesResponse.GetContractModerationEntriesResponseV0H\x00\x1a\x91\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.ContractModerationReasonB\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\"\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\"\xe0\x1f\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\x95\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\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\"\xfa\x01\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\x42\t\n\x07version\"\xf2\x1b\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\x84\x18\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_\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\x1a\xab\x03\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\xfd\x01\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\x42\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\"\xd6\x06\n+GetIdentityByNonUniquePublicKeyHashResponse\x12\x82\x01\n\x02v0\x18\x01 \x01(\x0b\x32t.org.dash.platform.dapi.v0.GetIdentityByNonUniquePublicKeyHashResponse.GetIdentityByNonUniquePublicKeyHashResponseV0H\x00\x1a\x96\x05\n-GetIdentityByNonUniquePublicKeyHashResponseV0\x12\x9a\x01\n\x08identity\x18\x01 \x01(\x0b\x32\x85\x01.org.dash.platform.dapi.v0.GetIdentityByNonUniquePublicKeyHashResponse.GetIdentityByNonUniquePublicKeyHashResponseV0.IdentityResponseH\x00\x12\x9d\x01\n\x05proof\x18\x02 \x01(\x0b\x32\x8b\x01.org.dash.platform.dapi.v0.GetIdentityByNonUniquePublicKeyHashResponse.GetIdentityByNonUniquePublicKeyHashResponseV0.IdentityProvedResponseH\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_identity\x1a\xa6\x01\n\x16IdentityProvedResponse\x12P\n&grovedb_identity_public_key_hash_proof\x18\x01 \x01(\x0b\x32 .org.dash.platform.dapi.v0.Proof\x12!\n\x14identity_proof_bytes\x18\x02 \x01(\x0cH\x00\x88\x01\x01\x42\x17\n\x15_identity_proof_bytesB\x08\n\x06resultB\t\n\x07version\"\xfb\x01\n#WaitForStateTransitionResultRequest\x12r\n\x02v0\x18\x01 \x01(\x0b\x32\x64.org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0H\x00\x1aU\n%WaitForStateTransitionResultRequestV0\x12\x1d\n\x15state_transition_hash\x18\x01 \x01(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\x99\x03\n$WaitForStateTransitionResultResponse\x12t\n\x02v0\x18\x01 \x01(\x0b\x32\x66.org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0H\x00\x1a\xef\x01\n&WaitForStateTransitionResultResponseV0\x12I\n\x05\x65rror\x18\x01 \x01(\x0b\x32\x38.org.dash.platform.dapi.v0.StateTransitionBroadcastErrorH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadataB\x08\n\x06resultB\t\n\x07version\"\xc4\x01\n\x19GetConsensusParamsRequest\x12^\n\x02v0\x18\x01 \x01(\x0b\x32P.org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0H\x00\x1a<\n\x1bGetConsensusParamsRequestV0\x12\x0e\n\x06height\x18\x01 \x01(\x05\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\x9c\x04\n\x1aGetConsensusParamsResponse\x12`\n\x02v0\x18\x01 \x01(\x0b\x32R.org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0H\x00\x1aP\n\x14\x43onsensusParamsBlock\x12\x11\n\tmax_bytes\x18\x01 \x01(\t\x12\x0f\n\x07max_gas\x18\x02 \x01(\t\x12\x14\n\x0ctime_iota_ms\x18\x03 \x01(\t\x1a\x62\n\x17\x43onsensusParamsEvidence\x12\x1a\n\x12max_age_num_blocks\x18\x01 \x01(\t\x12\x18\n\x10max_age_duration\x18\x02 \x01(\t\x12\x11\n\tmax_bytes\x18\x03 \x01(\t\x1a\xda\x01\n\x1cGetConsensusParamsResponseV0\x12Y\n\x05\x62lock\x18\x01 \x01(\x0b\x32J.org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock\x12_\n\x08\x65vidence\x18\x02 \x01(\x0b\x32M.org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidenceB\t\n\x07version\"\xe4\x01\n%GetProtocolVersionUpgradeStateRequest\x12v\n\x02v0\x18\x01 \x01(\x0b\x32h.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0H\x00\x1a\x38\n\'GetProtocolVersionUpgradeStateRequestV0\x12\r\n\x05prove\x18\x01 \x01(\x08\x42\t\n\x07version\"\xb5\x05\n&GetProtocolVersionUpgradeStateResponse\x12x\n\x02v0\x18\x01 \x01(\x0b\x32j.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0H\x00\x1a\x85\x04\n(GetProtocolVersionUpgradeStateResponseV0\x12\x87\x01\n\x08versions\x18\x01 \x01(\x0b\x32s.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionsH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a\x96\x01\n\x08Versions\x12\x89\x01\n\x08versions\x18\x01 \x03(\x0b\x32w.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry\x1a:\n\x0cVersionEntry\x12\x16\n\x0eversion_number\x18\x01 \x01(\r\x12\x12\n\nvote_count\x18\x02 \x01(\rB\x08\n\x06resultB\t\n\x07version\"\xa3\x02\n*GetProtocolVersionUpgradeVoteStatusRequest\x12\x80\x01\n\x02v0\x18\x01 \x01(\x0b\x32r.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0H\x00\x1ag\n,GetProtocolVersionUpgradeVoteStatusRequestV0\x12\x19\n\x11start_pro_tx_hash\x18\x01 \x01(\x0c\x12\r\n\x05\x63ount\x18\x02 \x01(\r\x12\r\n\x05prove\x18\x03 \x01(\x08\x42\t\n\x07version\"\xef\x05\n+GetProtocolVersionUpgradeVoteStatusResponse\x12\x82\x01\n\x02v0\x18\x01 \x01(\x0b\x32t.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0H\x00\x1a\xaf\x04\n-GetProtocolVersionUpgradeVoteStatusResponseV0\x12\x98\x01\n\x08versions\x18\x01 \x01(\x0b\x32\x83\x01.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignalsH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a\xaf\x01\n\x0eVersionSignals\x12\x9c\x01\n\x0fversion_signals\x18\x01 \x03(\x0b\x32\x82\x01.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal\x1a\x35\n\rVersionSignal\x12\x13\n\x0bpro_tx_hash\x18\x01 \x01(\x0c\x12\x0f\n\x07version\x18\x02 \x01(\rB\x08\n\x06resultB\t\n\x07version\"\xf5\x01\n\x14GetEpochsInfoRequest\x12T\n\x02v0\x18\x01 \x01(\x0b\x32\x46.org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0H\x00\x1a|\n\x16GetEpochsInfoRequestV0\x12\x31\n\x0bstart_epoch\x18\x01 \x01(\x0b\x32\x1c.google.protobuf.UInt32Value\x12\r\n\x05\x63ount\x18\x02 \x01(\r\x12\x11\n\tascending\x18\x03 \x01(\x08\x12\r\n\x05prove\x18\x04 \x01(\x08\x42\t\n\x07version\"\x99\x05\n\x15GetEpochsInfoResponse\x12V\n\x02v0\x18\x01 \x01(\x0b\x32H.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0H\x00\x1a\x9c\x04\n\x17GetEpochsInfoResponseV0\x12\x65\n\x06\x65pochs\x18\x01 \x01(\x0b\x32S.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfosH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1au\n\nEpochInfos\x12g\n\x0b\x65poch_infos\x18\x01 \x03(\x0b\x32R.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo\x1a\xa6\x01\n\tEpochInfo\x12\x0e\n\x06number\x18\x01 \x01(\r\x12\x1e\n\x12\x66irst_block_height\x18\x02 \x01(\x04\x42\x02\x30\x01\x12\x1f\n\x17\x66irst_core_block_height\x18\x03 \x01(\r\x12\x16\n\nstart_time\x18\x04 \x01(\x04\x42\x02\x30\x01\x12\x16\n\x0e\x66\x65\x65_multiplier\x18\x05 \x01(\x01\x12\x18\n\x10protocol_version\x18\x06 \x01(\rB\x08\n\x06resultB\t\n\x07version\"\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\"\xd6\x1e\n\x17GetGroupActionsResponse\x12Z\n\x02v0\x18\x01 \x01(\x0b\x32L.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0H\x00\x1a\xd3\x1d\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\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\xd1\x07\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\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\"\xf4\x01\n GetShieldedEncryptedNotesRequest\x12l\n\x02v0\x18\x01 \x01(\x0b\x32^.org.dash.platform.dapi.v0.GetShieldedEncryptedNotesRequest.GetShieldedEncryptedNotesRequestV0H\x00\x1aW\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\x42\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\"\xb4\x01\n\x19GetShieldedAnchorsRequest\x12^\n\x02v0\x18\x01 \x01(\x0b\x32P.org.dash.platform.dapi.v0.GetShieldedAnchorsRequest.GetShieldedAnchorsRequestV0H\x00\x1a,\n\x1bGetShieldedAnchorsRequestV0\x12\r\n\x05prove\x18\x01 \x01(\x08\x42\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\"\xd8\x01\n\"GetMostRecentShieldedAnchorRequest\x12p\n\x02v0\x18\x01 \x01(\x0b\x32\x62.org.dash.platform.dapi.v0.GetMostRecentShieldedAnchorRequest.GetMostRecentShieldedAnchorRequestV0H\x00\x1a\x35\n$GetMostRecentShieldedAnchorRequestV0\x12\r\n\x05prove\x18\x01 \x01(\x08\x42\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\"\xbc\x01\n\x1bGetShieldedPoolStateRequest\x12\x62\n\x02v0\x18\x01 \x01(\x0b\x32T.org.dash.platform.dapi.v0.GetShieldedPoolStateRequest.GetShieldedPoolStateRequestV0H\x00\x1a.\n\x1dGetShieldedPoolStateRequestV0\x12\r\n\x05prove\x18\x01 \x01(\x08\x42\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\"\xc0\x01\n\x1cGetShieldedNotesCountRequest\x12\x64\n\x02v0\x18\x01 \x01(\x0b\x32V.org.dash.platform.dapi.v0.GetShieldedNotesCountRequest.GetShieldedNotesCountRequestV0H\x00\x1a/\n\x1eGetShieldedNotesCountRequestV0\x12\r\n\x05prove\x18\x01 \x01(\x08\x42\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\"\xd4\x01\n\x1cGetShieldedNullifiersRequest\x12\x64\n\x02v0\x18\x01 \x01(\x0b\x32V.org.dash.platform.dapi.v0.GetShieldedNullifiersRequest.GetShieldedNullifiersRequestV0H\x00\x1a\x43\n\x1eGetShieldedNullifiersRequestV0\x12\x12\n\nnullifiers\x18\x01 \x03(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\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*\x92\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\x32\xb1O\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\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\"D\n\x18\x43ontractModerationReason\x12\x11\n\x04\x63ode\x18\x01 \x01(\rH\x00\x88\x01\x01\x12\x0c\n\x04text\x18\x02 \x01(\tB\x07\n\x05_code\"\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\"\xae\x06\n#GetContractModerationStatusResponse\x12r\n\x02v0\x18\x01 \x01(\x0b\x32\x64.org.dash.platform.dapi.v0.GetContractModerationStatusResponse.GetContractModerationStatusResponseV0H\x00\x1a\xf6\x02\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\x42\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\"\xd8\x05\n$GetContractModerationEntriesResponse\x12t\n\x02v0\x18\x01 \x01(\x0b\x32\x66.org.dash.platform.dapi.v0.GetContractModerationEntriesResponse.GetContractModerationEntriesResponseV0H\x00\x1a\x91\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.ContractModerationReasonB\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\"\xf9\x05\n#GetContractDocumentRemovalsResponse\x12r\n\x02v0\x18\x01 \x01(\x0b\x32\x64.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0H\x00\x1a\xb8\x01\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\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\"\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\"\xe0\x1f\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\x95\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\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\"\xfa\x01\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\x42\t\n\x07version\"\xf2\x1b\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\x84\x18\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_\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\x1a\xab\x03\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\xfd\x01\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\x42\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\"\xd6\x06\n+GetIdentityByNonUniquePublicKeyHashResponse\x12\x82\x01\n\x02v0\x18\x01 \x01(\x0b\x32t.org.dash.platform.dapi.v0.GetIdentityByNonUniquePublicKeyHashResponse.GetIdentityByNonUniquePublicKeyHashResponseV0H\x00\x1a\x96\x05\n-GetIdentityByNonUniquePublicKeyHashResponseV0\x12\x9a\x01\n\x08identity\x18\x01 \x01(\x0b\x32\x85\x01.org.dash.platform.dapi.v0.GetIdentityByNonUniquePublicKeyHashResponse.GetIdentityByNonUniquePublicKeyHashResponseV0.IdentityResponseH\x00\x12\x9d\x01\n\x05proof\x18\x02 \x01(\x0b\x32\x8b\x01.org.dash.platform.dapi.v0.GetIdentityByNonUniquePublicKeyHashResponse.GetIdentityByNonUniquePublicKeyHashResponseV0.IdentityProvedResponseH\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_identity\x1a\xa6\x01\n\x16IdentityProvedResponse\x12P\n&grovedb_identity_public_key_hash_proof\x18\x01 \x01(\x0b\x32 .org.dash.platform.dapi.v0.Proof\x12!\n\x14identity_proof_bytes\x18\x02 \x01(\x0cH\x00\x88\x01\x01\x42\x17\n\x15_identity_proof_bytesB\x08\n\x06resultB\t\n\x07version\"\xfb\x01\n#WaitForStateTransitionResultRequest\x12r\n\x02v0\x18\x01 \x01(\x0b\x32\x64.org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0H\x00\x1aU\n%WaitForStateTransitionResultRequestV0\x12\x1d\n\x15state_transition_hash\x18\x01 \x01(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\x99\x03\n$WaitForStateTransitionResultResponse\x12t\n\x02v0\x18\x01 \x01(\x0b\x32\x66.org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0H\x00\x1a\xef\x01\n&WaitForStateTransitionResultResponseV0\x12I\n\x05\x65rror\x18\x01 \x01(\x0b\x32\x38.org.dash.platform.dapi.v0.StateTransitionBroadcastErrorH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadataB\x08\n\x06resultB\t\n\x07version\"\xc4\x01\n\x19GetConsensusParamsRequest\x12^\n\x02v0\x18\x01 \x01(\x0b\x32P.org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0H\x00\x1a<\n\x1bGetConsensusParamsRequestV0\x12\x0e\n\x06height\x18\x01 \x01(\x05\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\x9c\x04\n\x1aGetConsensusParamsResponse\x12`\n\x02v0\x18\x01 \x01(\x0b\x32R.org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0H\x00\x1aP\n\x14\x43onsensusParamsBlock\x12\x11\n\tmax_bytes\x18\x01 \x01(\t\x12\x0f\n\x07max_gas\x18\x02 \x01(\t\x12\x14\n\x0ctime_iota_ms\x18\x03 \x01(\t\x1a\x62\n\x17\x43onsensusParamsEvidence\x12\x1a\n\x12max_age_num_blocks\x18\x01 \x01(\t\x12\x18\n\x10max_age_duration\x18\x02 \x01(\t\x12\x11\n\tmax_bytes\x18\x03 \x01(\t\x1a\xda\x01\n\x1cGetConsensusParamsResponseV0\x12Y\n\x05\x62lock\x18\x01 \x01(\x0b\x32J.org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock\x12_\n\x08\x65vidence\x18\x02 \x01(\x0b\x32M.org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidenceB\t\n\x07version\"\xe4\x01\n%GetProtocolVersionUpgradeStateRequest\x12v\n\x02v0\x18\x01 \x01(\x0b\x32h.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0H\x00\x1a\x38\n\'GetProtocolVersionUpgradeStateRequestV0\x12\r\n\x05prove\x18\x01 \x01(\x08\x42\t\n\x07version\"\xb5\x05\n&GetProtocolVersionUpgradeStateResponse\x12x\n\x02v0\x18\x01 \x01(\x0b\x32j.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0H\x00\x1a\x85\x04\n(GetProtocolVersionUpgradeStateResponseV0\x12\x87\x01\n\x08versions\x18\x01 \x01(\x0b\x32s.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionsH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a\x96\x01\n\x08Versions\x12\x89\x01\n\x08versions\x18\x01 \x03(\x0b\x32w.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry\x1a:\n\x0cVersionEntry\x12\x16\n\x0eversion_number\x18\x01 \x01(\r\x12\x12\n\nvote_count\x18\x02 \x01(\rB\x08\n\x06resultB\t\n\x07version\"\xa3\x02\n*GetProtocolVersionUpgradeVoteStatusRequest\x12\x80\x01\n\x02v0\x18\x01 \x01(\x0b\x32r.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0H\x00\x1ag\n,GetProtocolVersionUpgradeVoteStatusRequestV0\x12\x19\n\x11start_pro_tx_hash\x18\x01 \x01(\x0c\x12\r\n\x05\x63ount\x18\x02 \x01(\r\x12\r\n\x05prove\x18\x03 \x01(\x08\x42\t\n\x07version\"\xef\x05\n+GetProtocolVersionUpgradeVoteStatusResponse\x12\x82\x01\n\x02v0\x18\x01 \x01(\x0b\x32t.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0H\x00\x1a\xaf\x04\n-GetProtocolVersionUpgradeVoteStatusResponseV0\x12\x98\x01\n\x08versions\x18\x01 \x01(\x0b\x32\x83\x01.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignalsH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a\xaf\x01\n\x0eVersionSignals\x12\x9c\x01\n\x0fversion_signals\x18\x01 \x03(\x0b\x32\x82\x01.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal\x1a\x35\n\rVersionSignal\x12\x13\n\x0bpro_tx_hash\x18\x01 \x01(\x0c\x12\x0f\n\x07version\x18\x02 \x01(\rB\x08\n\x06resultB\t\n\x07version\"\xf5\x01\n\x14GetEpochsInfoRequest\x12T\n\x02v0\x18\x01 \x01(\x0b\x32\x46.org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0H\x00\x1a|\n\x16GetEpochsInfoRequestV0\x12\x31\n\x0bstart_epoch\x18\x01 \x01(\x0b\x32\x1c.google.protobuf.UInt32Value\x12\r\n\x05\x63ount\x18\x02 \x01(\r\x12\x11\n\tascending\x18\x03 \x01(\x08\x12\r\n\x05prove\x18\x04 \x01(\x08\x42\t\n\x07version\"\x99\x05\n\x15GetEpochsInfoResponse\x12V\n\x02v0\x18\x01 \x01(\x0b\x32H.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0H\x00\x1a\x9c\x04\n\x17GetEpochsInfoResponseV0\x12\x65\n\x06\x65pochs\x18\x01 \x01(\x0b\x32S.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfosH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1au\n\nEpochInfos\x12g\n\x0b\x65poch_infos\x18\x01 \x03(\x0b\x32R.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo\x1a\xa6\x01\n\tEpochInfo\x12\x0e\n\x06number\x18\x01 \x01(\r\x12\x1e\n\x12\x66irst_block_height\x18\x02 \x01(\x04\x42\x02\x30\x01\x12\x1f\n\x17\x66irst_core_block_height\x18\x03 \x01(\r\x12\x16\n\nstart_time\x18\x04 \x01(\x04\x42\x02\x30\x01\x12\x16\n\x0e\x66\x65\x65_multiplier\x18\x05 \x01(\x01\x12\x18\n\x10protocol_version\x18\x06 \x01(\rB\x08\n\x06resultB\t\n\x07version\"\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\"\xd6\x1e\n\x17GetGroupActionsResponse\x12Z\n\x02v0\x18\x01 \x01(\x0b\x32L.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0H\x00\x1a\xd3\x1d\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\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\xd1\x07\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\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\"\xf4\x01\n GetShieldedEncryptedNotesRequest\x12l\n\x02v0\x18\x01 \x01(\x0b\x32^.org.dash.platform.dapi.v0.GetShieldedEncryptedNotesRequest.GetShieldedEncryptedNotesRequestV0H\x00\x1aW\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\x42\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\"\xb4\x01\n\x19GetShieldedAnchorsRequest\x12^\n\x02v0\x18\x01 \x01(\x0b\x32P.org.dash.platform.dapi.v0.GetShieldedAnchorsRequest.GetShieldedAnchorsRequestV0H\x00\x1a,\n\x1bGetShieldedAnchorsRequestV0\x12\r\n\x05prove\x18\x01 \x01(\x08\x42\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\"\xd8\x01\n\"GetMostRecentShieldedAnchorRequest\x12p\n\x02v0\x18\x01 \x01(\x0b\x32\x62.org.dash.platform.dapi.v0.GetMostRecentShieldedAnchorRequest.GetMostRecentShieldedAnchorRequestV0H\x00\x1a\x35\n$GetMostRecentShieldedAnchorRequestV0\x12\r\n\x05prove\x18\x01 \x01(\x08\x42\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\"\xbc\x01\n\x1bGetShieldedPoolStateRequest\x12\x62\n\x02v0\x18\x01 \x01(\x0b\x32T.org.dash.platform.dapi.v0.GetShieldedPoolStateRequest.GetShieldedPoolStateRequestV0H\x00\x1a.\n\x1dGetShieldedPoolStateRequestV0\x12\r\n\x05prove\x18\x01 \x01(\x08\x42\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\"\xc0\x01\n\x1cGetShieldedNotesCountRequest\x12\x64\n\x02v0\x18\x01 \x01(\x0b\x32V.org.dash.platform.dapi.v0.GetShieldedNotesCountRequest.GetShieldedNotesCountRequestV0H\x00\x1a/\n\x1eGetShieldedNotesCountRequestV0\x12\r\n\x05prove\x18\x01 \x01(\x08\x42\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\"\xd4\x01\n\x1cGetShieldedNullifiersRequest\x12\x64\n\x02v0\x18\x01 \x01(\x0b\x32V.org.dash.platform.dapi.v0.GetShieldedNullifiersRequest.GetShieldedNullifiersRequestV0H\x00\x1a\x43\n\x1eGetShieldedNullifiersRequestV0\x12\x12\n\nnullifiers\x18\x01 \x03(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\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*\x92\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\x32\xd0P\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\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' , 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=77362, - serialized_end=77452, + serialized_start=78708, + serialized_end=78798, ) _sym_db.RegisterEnumDescriptor(_KEYPURPOSE) @@ -93,8 +93,8 @@ ], containing_type=None, serialized_options=None, - serialized_start=77455, - serialized_end=77601, + serialized_start=78801, + serialized_end=78947, ) _sym_db.RegisterEnumDescriptor(_CONTRACTMODERATIONLIST) @@ -159,8 +159,8 @@ ], containing_type=None, serialized_options=None, - serialized_start=21287, - serialized_end=21335, + serialized_start=22633, + serialized_end=22681, ) _sym_db.RegisterEnumDescriptor(_GETDOCUMENTSREQUEST_TIMERANGESELECTION_SELECTOR) @@ -189,8 +189,8 @@ ], containing_type=None, serialized_options=None, - serialized_start=21756, - serialized_end=21795, + serialized_start=23102, + serialized_end=23141, ) _sym_db.RegisterEnumDescriptor(_GETDOCUMENTSREQUEST_HAVINGAGGREGATE_FUNCTION) @@ -259,8 +259,8 @@ ], containing_type=None, serialized_options=None, - serialized_start=22070, - serialized_end=22294, + serialized_start=23416, + serialized_end=23640, ) _sym_db.RegisterEnumDescriptor(_GETDOCUMENTSREQUEST_HAVINGCLAUSE_OPERATOR) @@ -304,8 +304,8 @@ ], containing_type=None, serialized_options=None, - serialized_start=23495, - serialized_end=23567, + serialized_start=24841, + serialized_end=24913, ) _sym_db.RegisterEnumDescriptor(_GETDOCUMENTSREQUEST_GETDOCUMENTSREQUESTV1_SELECT_FUNCTION) @@ -329,8 +329,8 @@ ], containing_type=None, serialized_options=None, - serialized_start=24145, - serialized_end=24177, + serialized_start=25491, + serialized_end=25523, ) _sym_db.RegisterEnumDescriptor(_GETDOCUMENTSREQUEST_GETDOCUMENTSREQUESTV1_SUBQUERY_KIND) @@ -404,8 +404,8 @@ ], containing_type=None, serialized_options=None, - serialized_start=24220, - serialized_end=24470, + serialized_start=25566, + serialized_end=25816, ) _sym_db.RegisterEnumDescriptor(_GETDOCUMENTSREQUEST_WHEREOPERATOR) @@ -434,8 +434,8 @@ ], containing_type=None, serialized_options=None, - serialized_start=40072, - serialized_end=40145, + serialized_start=41418, + serialized_end=41491, ) _sym_db.RegisterEnumDescriptor(_GETCONTESTEDRESOURCEVOTESTATEREQUEST_GETCONTESTEDRESOURCEVOTESTATEREQUESTV0_RESULTTYPE) @@ -464,8 +464,8 @@ ], containing_type=None, serialized_options=None, - serialized_start=41067, - serialized_end=41146, + serialized_start=42413, + serialized_end=42492, ) _sym_db.RegisterEnumDescriptor(_GETCONTESTEDRESOURCEVOTESTATERESPONSE_GETCONTESTEDRESOURCEVOTESTATERESPONSEV0_FINISHEDVOTEINFO_FINISHEDVOTEOUTCOME) @@ -494,8 +494,8 @@ ], containing_type=None, serialized_options=None, - serialized_start=44775, - serialized_end=44836, + serialized_start=46121, + serialized_end=46182, ) _sym_db.RegisterEnumDescriptor(_GETCONTESTEDRESOURCEIDENTITYVOTESRESPONSE_GETCONTESTEDRESOURCEIDENTITYVOTESRESPONSEV0_RESOURCEVOTECHOICE_VOTECHOICETYPE) @@ -519,8 +519,8 @@ ], containing_type=None, serialized_options=None, - serialized_start=63400, - serialized_end=63438, + serialized_start=64746, + serialized_end=64784, ) _sym_db.RegisterEnumDescriptor(_GETGROUPACTIONSREQUEST_ACTIONSTATUS) @@ -544,8 +544,8 @@ ], containing_type=None, serialized_options=None, - serialized_start=64685, - serialized_end=64720, + serialized_start=66031, + serialized_end=66066, ) _sym_db.RegisterEnumDescriptor(_GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_EMERGENCYACTIONEVENT_ACTIONTYPE) @@ -569,8 +569,8 @@ ], containing_type=None, serialized_options=None, - serialized_start=63400, - serialized_end=63438, + serialized_start=64746, + serialized_end=64784, ) _sym_db.RegisterEnumDescriptor(_GETGROUPACTIONSIGNERSREQUEST_ACTIONSTATUS) @@ -4965,6 +4965,363 @@ ) +_GETCONTRACTDOCUMENTREMOVALSREQUEST_DOCUMENTIDS = _descriptor.Descriptor( + name='DocumentIds', + full_name='org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.DocumentIds', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='document_ids', full_name='org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.DocumentIds.document_ids', index=0, + number=1, type=12, cpp_type=9, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=16324, + serialized_end=16359, +) + +_GETCONTRACTDOCUMENTREMOVALSREQUEST_PAGE = _descriptor.Descriptor( + name='Page', + full_name='org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.Page', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='start_after', full_name='org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.Page.start_after', 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='limit', full_name='org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.Page.limit', index=1, + number=2, 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), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + _descriptor.OneofDescriptor( + name='_start_after', full_name='org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.Page._start_after', + index=0, containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[]), + _descriptor.OneofDescriptor( + name='_limit', full_name='org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.Page._limit', + index=1, containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[]), + ], + serialized_start=16361, + serialized_end=16439, +) + +_GETCONTRACTDOCUMENTREMOVALSREQUEST_GETCONTRACTDOCUMENTREMOVALSREQUESTV0 = _descriptor.Descriptor( + name='GetContractDocumentRemovalsRequestV0', + full_name='org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='contract_id', full_name='org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0.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.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0.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='document_ids', full_name='org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0.document_ids', index=2, + number=3, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='page', full_name='org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0.page', index=3, + number=4, 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='prove', full_name='org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0.prove', index=4, + number=5, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + _descriptor.OneofDescriptor( + name='selection', full_name='org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0.selection', + index=0, containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[]), + ], + serialized_start=16442, + serialized_end=16740, +) + +_GETCONTRACTDOCUMENTREMOVALSREQUEST = _descriptor.Descriptor( + name='GetContractDocumentRemovalsRequest', + full_name='org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest', + 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.GetContractDocumentRemovalsRequest.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=[_GETCONTRACTDOCUMENTREMOVALSREQUEST_DOCUMENTIDS, _GETCONTRACTDOCUMENTREMOVALSREQUEST_PAGE, _GETCONTRACTDOCUMENTREMOVALSREQUEST_GETCONTRACTDOCUMENTREMOVALSREQUESTV0, ], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + _descriptor.OneofDescriptor( + name='version', full_name='org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.version', + index=0, containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[]), + ], + serialized_start=16172, + serialized_end=16751, +) + + +_GETCONTRACTDOCUMENTREMOVALSRESPONSE_CONTRACTDOCUMENTREMOVAL = _descriptor.Descriptor( + name='ContractDocumentRemoval', + full_name='org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='document_id', full_name='org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval.document_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_owner_id', full_name='org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval.document_owner_id', index=1, + number=2, 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='moderator_id', full_name='org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval.moderator_id', index=2, + number=3, 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='removed_at', full_name='org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval.removed_at', index=3, + number=4, type=4, cpp_type=4, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='reason', full_name='org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval.reason', 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=[ + ], + serialized_start=16910, + serialized_end=17094, +) + +_GETCONTRACTDOCUMENTREMOVALSRESPONSE_CONTRACTDOCUMENTREMOVALS = _descriptor.Descriptor( + name='ContractDocumentRemovals', + full_name='org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemovals', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='removals', full_name='org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemovals.removals', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=17097, + serialized_end=17229, +) + +_GETCONTRACTDOCUMENTREMOVALSRESPONSE_GETCONTRACTDOCUMENTREMOVALSRESPONSEV0 = _descriptor.Descriptor( + name='GetContractDocumentRemovalsResponseV0', + full_name='org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='removals', full_name='org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0.removals', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='proof', full_name='org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0.proof', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='metadata', full_name='org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0.metadata', index=2, + number=3, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + _descriptor.OneofDescriptor( + name='result', full_name='org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0.result', + index=0, containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[]), + ], + serialized_start=17232, + serialized_end=17504, +) + +_GETCONTRACTDOCUMENTREMOVALSRESPONSE = _descriptor.Descriptor( + name='GetContractDocumentRemovalsResponse', + full_name='org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse', + 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.GetContractDocumentRemovalsResponse.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=[_GETCONTRACTDOCUMENTREMOVALSRESPONSE_CONTRACTDOCUMENTREMOVAL, _GETCONTRACTDOCUMENTREMOVALSRESPONSE_CONTRACTDOCUMENTREMOVALS, _GETCONTRACTDOCUMENTREMOVALSRESPONSE_GETCONTRACTDOCUMENTREMOVALSRESPONSEV0, ], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + _descriptor.OneofDescriptor( + name='version', full_name='org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.version', + index=0, containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[]), + ], + serialized_start=16754, + serialized_end=17515, +) + + _GETCONTRACTFEEPOTSREQUEST_GETCONTRACTFEEPOTSREQUESTV0 = _descriptor.Descriptor( name='GetContractFeePotsRequestV0', full_name='org.dash.platform.dapi.v0.GetContractFeePotsRequest.GetContractFeePotsRequestV0', @@ -4999,8 +5356,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=16297, - serialized_end=16362, + serialized_start=17643, + serialized_end=17708, ) _GETCONTRACTFEEPOTSREQUEST = _descriptor.Descriptor( @@ -5035,8 +5392,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=16172, - serialized_end=16373, + serialized_start=17518, + serialized_end=17719, ) @@ -5081,8 +5438,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=16504, - serialized_end=16586, + serialized_start=17850, + serialized_end=17932, ) _GETCONTRACTFEEPOTSRESPONSE_CONTRACTFEEPOT = _descriptor.Descriptor( @@ -5119,8 +5476,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=16589, - serialized_end=16725, + serialized_start=17935, + serialized_end=18071, ) _GETCONTRACTFEEPOTSRESPONSE_CONTRACTFEEPOTS = _descriptor.Descriptor( @@ -5157,8 +5514,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=16728, - serialized_end=16920, + serialized_start=18074, + serialized_end=18266, ) _GETCONTRACTFEEPOTSRESPONSE_GETCONTRACTFEEPOTSRESPONSEV0 = _descriptor.Descriptor( @@ -5207,8 +5564,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=16923, - serialized_end=17164, + serialized_start=18269, + serialized_end=18510, ) _GETCONTRACTFEEPOTSRESPONSE = _descriptor.Descriptor( @@ -5243,8 +5600,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=16376, - serialized_end=17175, + serialized_start=17722, + serialized_end=18521, ) @@ -5282,8 +5639,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=17333, - serialized_end=17408, + serialized_start=18679, + serialized_end=18754, ) _GETCONTRACTGROUPSFORCONTRACTREQUEST = _descriptor.Descriptor( @@ -5318,8 +5675,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=17178, - serialized_end=17419, + serialized_start=18524, + serialized_end=18765, ) @@ -5357,8 +5714,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=17580, - serialized_end=17661, + serialized_start=18926, + serialized_end=19007, ) _GETCONTRACTGROUPSFORCONTRACTRESPONSE_TOKENMEMBERSHIPS = _descriptor.Descriptor( @@ -5395,8 +5752,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=17663, - serialized_end=17733, + serialized_start=19009, + serialized_end=19079, ) _GETCONTRACTGROUPSFORCONTRACTRESPONSE_CONTRACTGROUPMEMBERSHIPS = _descriptor.Descriptor( @@ -5440,8 +5797,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=17736, - serialized_end=18001, + serialized_start=19082, + serialized_end=19347, ) _GETCONTRACTGROUPSFORCONTRACTRESPONSE_GETCONTRACTGROUPSFORCONTRACTRESPONSEV0 = _descriptor.Descriptor( @@ -5490,8 +5847,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=18004, - serialized_end=18296, + serialized_start=19350, + serialized_end=19642, ) _GETCONTRACTGROUPSFORCONTRACTRESPONSE = _descriptor.Descriptor( @@ -5526,8 +5883,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=17422, - serialized_end=18307, + serialized_start=18768, + serialized_end=19653, ) @@ -5565,8 +5922,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=18429, - serialized_end=18484, + serialized_start=19775, + serialized_end=19830, ) _GETDATACONTRACTSREQUEST = _descriptor.Descriptor( @@ -5601,8 +5958,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=18310, - serialized_end=18495, + serialized_start=19656, + serialized_end=19841, ) @@ -5671,8 +6028,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=18639, - serialized_end=18788, + serialized_start=19985, + serialized_end=20134, ) _GETDATACONTRACTSBYRANGEREQUEST = _descriptor.Descriptor( @@ -5707,8 +6064,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=18498, - serialized_end=18799, + serialized_start=19844, + serialized_end=20145, ) @@ -5746,8 +6103,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=18924, - serialized_end=19015, + serialized_start=20270, + serialized_end=20361, ) _GETDATACONTRACTSRESPONSE_DATACONTRACTS = _descriptor.Descriptor( @@ -5777,8 +6134,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=19017, - serialized_end=19134, + serialized_start=20363, + serialized_end=20480, ) _GETDATACONTRACTSRESPONSE_GETDATACONTRACTSRESPONSEV0 = _descriptor.Descriptor( @@ -5827,8 +6184,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=19137, - serialized_end=19382, + serialized_start=20483, + serialized_end=20728, ) _GETDATACONTRACTSRESPONSE = _descriptor.Descriptor( @@ -5863,8 +6220,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=18802, - serialized_end=19393, + serialized_start=20148, + serialized_end=20739, ) @@ -5923,8 +6280,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=19534, - serialized_end=19710, + serialized_start=20880, + serialized_end=21056, ) _GETDATACONTRACTHISTORYREQUEST = _descriptor.Descriptor( @@ -5959,8 +6316,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=19396, - serialized_end=19721, + serialized_start=20742, + serialized_end=21067, ) @@ -5998,8 +6355,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=20161, - serialized_end=20220, + serialized_start=21507, + serialized_end=21566, ) _GETDATACONTRACTHISTORYRESPONSE_GETDATACONTRACTHISTORYRESPONSEV0_DATACONTRACTHISTORY = _descriptor.Descriptor( @@ -6029,8 +6386,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=20223, - serialized_end=20393, + serialized_start=21569, + serialized_end=21739, ) _GETDATACONTRACTHISTORYRESPONSE_GETDATACONTRACTHISTORYRESPONSEV0 = _descriptor.Descriptor( @@ -6079,8 +6436,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=19865, - serialized_end=20403, + serialized_start=21211, + serialized_end=21749, ) _GETDATACONTRACTHISTORYRESPONSE = _descriptor.Descriptor( @@ -6115,8 +6472,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=19724, - serialized_end=20414, + serialized_start=21070, + serialized_end=21760, ) @@ -6147,8 +6504,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=20886, - serialized_end=20980, + serialized_start=22232, + serialized_end=22326, ) _GETDOCUMENTSREQUEST_DOCUMENTFIELDVALUE = _descriptor.Descriptor( @@ -6232,8 +6589,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=20609, - serialized_end=20991, + serialized_start=21955, + serialized_end=22337, ) _GETDOCUMENTSREQUEST_TIMERANGESELECTION_GRID = _descriptor.Descriptor( @@ -6277,8 +6634,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=21223, - serialized_end=21285, + serialized_start=22569, + serialized_end=22631, ) _GETDOCUMENTSREQUEST_TIMERANGESELECTION = _descriptor.Descriptor( @@ -6328,8 +6685,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=20994, - serialized_end=21348, + serialized_start=22340, + serialized_end=22694, ) _GETDOCUMENTSREQUEST_WHERECLAUSE = _descriptor.Descriptor( @@ -6380,8 +6737,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=21351, - serialized_end=21628, + serialized_start=22697, + serialized_end=22974, ) _GETDOCUMENTSREQUEST_HAVINGAGGREGATE = _descriptor.Descriptor( @@ -6419,8 +6776,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=21631, - serialized_end=21795, + serialized_start=22977, + serialized_end=23141, ) _GETDOCUMENTSREQUEST_HAVINGCLAUSE = _descriptor.Descriptor( @@ -6470,8 +6827,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=21798, - serialized_end=22303, + serialized_start=23144, + serialized_end=23649, ) _GETDOCUMENTSREQUEST_ORDERCLAUSE = _descriptor.Descriptor( @@ -6520,8 +6877,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=22306, - serialized_end=22450, + serialized_start=23652, + serialized_end=23796, ) _GETDOCUMENTSREQUEST_GETDOCUMENTSREQUESTV0 = _descriptor.Descriptor( @@ -6605,8 +6962,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=22453, - serialized_end=22640, + serialized_start=23799, + serialized_end=23986, ) _GETDOCUMENTSREQUEST_GETDOCUMENTSREQUESTV1_SELECT = _descriptor.Descriptor( @@ -6644,8 +7001,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=23366, - serialized_end=23567, + serialized_start=24712, + serialized_end=24913, ) _GETDOCUMENTSREQUEST_GETDOCUMENTSREQUESTV1_CHAINEDJOIN = _descriptor.Descriptor( @@ -6682,8 +7039,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=23569, - serialized_end=23634, + serialized_start=24915, + serialized_end=24980, ) _GETDOCUMENTSREQUEST_GETDOCUMENTSREQUESTV1_SUBQUERY_BINDING = _descriptor.Descriptor( @@ -6727,8 +7084,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=24078, - serialized_end=24143, + serialized_start=25424, + serialized_end=25489, ) _GETDOCUMENTSREQUEST_GETDOCUMENTSREQUESTV1_SUBQUERY = _descriptor.Descriptor( @@ -6806,8 +7163,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=23637, - serialized_end=24187, + serialized_start=24983, + serialized_end=25533, ) _GETDOCUMENTSREQUEST_GETDOCUMENTSREQUESTV1 = _descriptor.Descriptor( @@ -6943,8 +7300,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=22643, - serialized_end=24217, + serialized_start=23989, + serialized_end=25563, ) _GETDOCUMENTSREQUEST = _descriptor.Descriptor( @@ -6987,8 +7344,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=20417, - serialized_end=24481, + serialized_start=21763, + serialized_end=25827, ) @@ -7019,8 +7376,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=24924, - serialized_end=24954, + serialized_start=26270, + serialized_end=26300, ) _GETDOCUMENTSRESPONSE_GETDOCUMENTSRESPONSEV0 = _descriptor.Descriptor( @@ -7069,8 +7426,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=24681, - serialized_end=24964, + serialized_start=26027, + serialized_end=26310, ) _GETDOCUMENTSRESPONSE_GETDOCUMENTSRESPONSEV1_DOCUMENTS = _descriptor.Descriptor( @@ -7100,8 +7457,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=24924, - serialized_end=24954, + serialized_start=26270, + serialized_end=26300, ) _GETDOCUMENTSRESPONSE_GETDOCUMENTSRESPONSEV1_COUNTENTRY = _descriptor.Descriptor( @@ -7150,8 +7507,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=25238, - serialized_end=25314, + serialized_start=26584, + serialized_end=26660, ) _GETDOCUMENTSRESPONSE_GETDOCUMENTSRESPONSEV1_COUNTENTRIES = _descriptor.Descriptor( @@ -7181,8 +7538,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=25316, - serialized_end=25430, + serialized_start=26662, + serialized_end=26776, ) _GETDOCUMENTSRESPONSE_GETDOCUMENTSRESPONSEV1_COUNTRESULTS = _descriptor.Descriptor( @@ -7224,8 +7581,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=25433, - serialized_end=25593, + serialized_start=26779, + serialized_end=26939, ) _GETDOCUMENTSRESPONSE_GETDOCUMENTSRESPONSEV1_SUMENTRY = _descriptor.Descriptor( @@ -7274,8 +7631,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=25595, - serialized_end=25667, + serialized_start=26941, + serialized_end=27013, ) _GETDOCUMENTSRESPONSE_GETDOCUMENTSRESPONSEV1_SUMENTRIES = _descriptor.Descriptor( @@ -7305,8 +7662,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=25669, - serialized_end=25779, + serialized_start=27015, + serialized_end=27125, ) _GETDOCUMENTSRESPONSE_GETDOCUMENTSRESPONSEV1_SUMRESULTS = _descriptor.Descriptor( @@ -7348,8 +7705,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=25782, - serialized_end=25936, + serialized_start=27128, + serialized_end=27282, ) _GETDOCUMENTSRESPONSE_GETDOCUMENTSRESPONSEV1_AVERAGEENTRY = _descriptor.Descriptor( @@ -7405,8 +7762,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=25938, - serialized_end=26033, + serialized_start=27284, + serialized_end=27379, ) _GETDOCUMENTSRESPONSE_GETDOCUMENTSRESPONSEV1_AVERAGEENTRIES = _descriptor.Descriptor( @@ -7436,8 +7793,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=26035, - serialized_end=26153, + serialized_start=27381, + serialized_end=27499, ) _GETDOCUMENTSRESPONSE_GETDOCUMENTSRESPONSEV1_AVERAGEAGGREGATE = _descriptor.Descriptor( @@ -7474,8 +7831,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=26155, - serialized_end=26209, + serialized_start=27501, + serialized_end=27555, ) _GETDOCUMENTSRESPONSE_GETDOCUMENTSRESPONSEV1_AVERAGERESULTS = _descriptor.Descriptor( @@ -7517,8 +7874,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=26212, - serialized_end=26463, + serialized_start=27558, + serialized_end=27809, ) _GETDOCUMENTSRESPONSE_GETDOCUMENTSRESPONSEV1_RANKEDENTRY = _descriptor.Descriptor( @@ -7586,8 +7943,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=26465, - serialized_end=26587, + serialized_start=27811, + serialized_end=27933, ) _GETDOCUMENTSRESPONSE_GETDOCUMENTSRESPONSEV1_RANKEDENTRIES = _descriptor.Descriptor( @@ -7629,8 +7986,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=26590, - serialized_end=26744, + serialized_start=27936, + serialized_end=28090, ) _GETDOCUMENTSRESPONSE_GETDOCUMENTSRESPONSEV1_RESULTDATA = _descriptor.Descriptor( @@ -7707,8 +8064,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=26747, - serialized_end=27506, + serialized_start=28093, + serialized_end=28852, ) _GETDOCUMENTSRESPONSE_GETDOCUMENTSRESPONSEV1_CHAINEDDOCUMENTS = _descriptor.Descriptor( @@ -7752,8 +8109,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=27508, - serialized_end=27603, + serialized_start=28854, + serialized_end=28949, ) _GETDOCUMENTSRESPONSE_GETDOCUMENTSRESPONSEV1_COMPOSITEDOCUMENTS_SUBQUERYRESULT = _descriptor.Descriptor( @@ -7802,8 +8159,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=27780, - serialized_end=28033, + serialized_start=29126, + serialized_end=29379, ) _GETDOCUMENTSRESPONSE_GETDOCUMENTSRESPONSEV1_COMPOSITEDOCUMENTS = _descriptor.Descriptor( @@ -7840,8 +8197,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=27606, - serialized_end=28033, + serialized_start=28952, + serialized_end=29379, ) _GETDOCUMENTSRESPONSE_GETDOCUMENTSRESPONSEV1 = _descriptor.Descriptor( @@ -7890,8 +8247,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=24967, - serialized_end=28043, + serialized_start=26313, + serialized_end=29389, ) _GETDOCUMENTSRESPONSE = _descriptor.Descriptor( @@ -7933,8 +8290,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=24484, - serialized_end=28054, + serialized_start=25830, + serialized_end=29400, ) @@ -8007,8 +8364,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=28183, - serialized_end=28418, + serialized_start=29529, + serialized_end=29764, ) _GETDOCUMENTHISTORYREQUEST = _descriptor.Descriptor( @@ -8043,8 +8400,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=28057, - serialized_end=28429, + serialized_start=29403, + serialized_end=29775, ) @@ -8082,8 +8439,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=28835, - serialized_end=28890, + serialized_start=30181, + serialized_end=30236, ) _GETDOCUMENTHISTORYRESPONSE_GETDOCUMENTHISTORYRESPONSEV0_DOCUMENTHISTORY = _descriptor.Descriptor( @@ -8113,8 +8470,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=28893, - serialized_end=29042, + serialized_start=30239, + serialized_end=30388, ) _GETDOCUMENTHISTORYRESPONSE_GETDOCUMENTHISTORYRESPONSEV0 = _descriptor.Descriptor( @@ -8163,8 +8520,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=28561, - serialized_end=29052, + serialized_start=29907, + serialized_end=30398, ) _GETDOCUMENTHISTORYRESPONSE = _descriptor.Descriptor( @@ -8199,8 +8556,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=28432, - serialized_end=29063, + serialized_start=29778, + serialized_end=30409, ) @@ -8238,8 +8595,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=29215, - serialized_end=29292, + serialized_start=30561, + serialized_end=30638, ) _GETIDENTITYBYPUBLICKEYHASHREQUEST = _descriptor.Descriptor( @@ -8274,8 +8631,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=29066, - serialized_end=29303, + serialized_start=30412, + serialized_end=30649, ) @@ -8325,8 +8682,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=29459, - serialized_end=29641, + serialized_start=30805, + serialized_end=30987, ) _GETIDENTITYBYPUBLICKEYHASHRESPONSE = _descriptor.Descriptor( @@ -8361,8 +8718,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=29306, - serialized_end=29652, + serialized_start=30652, + serialized_end=30998, ) @@ -8412,8 +8769,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=29833, - serialized_end=29961, + serialized_start=31179, + serialized_end=31307, ) _GETIDENTITYBYNONUNIQUEPUBLICKEYHASHREQUEST = _descriptor.Descriptor( @@ -8448,8 +8805,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=29655, - serialized_end=29972, + serialized_start=31001, + serialized_end=31318, ) @@ -8485,8 +8842,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=30585, - serialized_end=30639, + serialized_start=31931, + serialized_end=31985, ) _GETIDENTITYBYNONUNIQUEPUBLICKEYHASHRESPONSE_GETIDENTITYBYNONUNIQUEPUBLICKEYHASHRESPONSEV0_IDENTITYPROVEDRESPONSE = _descriptor.Descriptor( @@ -8528,8 +8885,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=30642, - serialized_end=30808, + serialized_start=31988, + serialized_end=32154, ) _GETIDENTITYBYNONUNIQUEPUBLICKEYHASHRESPONSE_GETIDENTITYBYNONUNIQUEPUBLICKEYHASHRESPONSEV0 = _descriptor.Descriptor( @@ -8578,8 +8935,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=30156, - serialized_end=30818, + serialized_start=31502, + serialized_end=32164, ) _GETIDENTITYBYNONUNIQUEPUBLICKEYHASHRESPONSE = _descriptor.Descriptor( @@ -8614,8 +8971,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=29975, - serialized_end=30829, + serialized_start=31321, + serialized_end=32175, ) @@ -8653,8 +9010,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=30987, - serialized_end=31072, + serialized_start=32333, + serialized_end=32418, ) _WAITFORSTATETRANSITIONRESULTREQUEST = _descriptor.Descriptor( @@ -8689,8 +9046,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=30832, - serialized_end=31083, + serialized_start=32178, + serialized_end=32429, ) @@ -8740,8 +9097,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=31245, - serialized_end=31484, + serialized_start=32591, + serialized_end=32830, ) _WAITFORSTATETRANSITIONRESULTRESPONSE = _descriptor.Descriptor( @@ -8776,8 +9133,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=31086, - serialized_end=31495, + serialized_start=32432, + serialized_end=32841, ) @@ -8815,8 +9172,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=31623, - serialized_end=31683, + serialized_start=32969, + serialized_end=33029, ) _GETCONSENSUSPARAMSREQUEST = _descriptor.Descriptor( @@ -8851,8 +9208,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=31498, - serialized_end=31694, + serialized_start=32844, + serialized_end=33040, ) @@ -8897,8 +9254,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=31825, - serialized_end=31905, + serialized_start=33171, + serialized_end=33251, ) _GETCONSENSUSPARAMSRESPONSE_CONSENSUSPARAMSEVIDENCE = _descriptor.Descriptor( @@ -8942,8 +9299,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=31907, - serialized_end=32005, + serialized_start=33253, + serialized_end=33351, ) _GETCONSENSUSPARAMSRESPONSE_GETCONSENSUSPARAMSRESPONSEV0 = _descriptor.Descriptor( @@ -8980,8 +9337,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=32008, - serialized_end=32226, + serialized_start=33354, + serialized_end=33572, ) _GETCONSENSUSPARAMSRESPONSE = _descriptor.Descriptor( @@ -9016,8 +9373,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=31697, - serialized_end=32237, + serialized_start=33043, + serialized_end=33583, ) @@ -9048,8 +9405,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=32401, - serialized_end=32457, + serialized_start=33747, + serialized_end=33803, ) _GETPROTOCOLVERSIONUPGRADESTATEREQUEST = _descriptor.Descriptor( @@ -9084,8 +9441,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=32240, - serialized_end=32468, + serialized_start=33586, + serialized_end=33814, ) @@ -9116,8 +9473,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=32933, - serialized_end=33083, + serialized_start=34279, + serialized_end=34429, ) _GETPROTOCOLVERSIONUPGRADESTATERESPONSE_GETPROTOCOLVERSIONUPGRADESTATERESPONSEV0_VERSIONENTRY = _descriptor.Descriptor( @@ -9154,8 +9511,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=33085, - serialized_end=33143, + serialized_start=34431, + serialized_end=34489, ) _GETPROTOCOLVERSIONUPGRADESTATERESPONSE_GETPROTOCOLVERSIONUPGRADESTATERESPONSEV0 = _descriptor.Descriptor( @@ -9204,8 +9561,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=32636, - serialized_end=33153, + serialized_start=33982, + serialized_end=34499, ) _GETPROTOCOLVERSIONUPGRADESTATERESPONSE = _descriptor.Descriptor( @@ -9240,8 +9597,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=32471, - serialized_end=33164, + serialized_start=33817, + serialized_end=34510, ) @@ -9286,8 +9643,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=33344, - serialized_end=33447, + serialized_start=34690, + serialized_end=34793, ) _GETPROTOCOLVERSIONUPGRADEVOTESTATUSREQUEST = _descriptor.Descriptor( @@ -9322,8 +9679,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=33167, - serialized_end=33458, + serialized_start=34513, + serialized_end=34804, ) @@ -9354,8 +9711,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=33961, - serialized_end=34136, + serialized_start=35307, + serialized_end=35482, ) _GETPROTOCOLVERSIONUPGRADEVOTESTATUSRESPONSE_GETPROTOCOLVERSIONUPGRADEVOTESTATUSRESPONSEV0_VERSIONSIGNAL = _descriptor.Descriptor( @@ -9392,8 +9749,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=34138, - serialized_end=34191, + serialized_start=35484, + serialized_end=35537, ) _GETPROTOCOLVERSIONUPGRADEVOTESTATUSRESPONSE_GETPROTOCOLVERSIONUPGRADEVOTESTATUSRESPONSEV0 = _descriptor.Descriptor( @@ -9442,8 +9799,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=33642, - serialized_end=34201, + serialized_start=34988, + serialized_end=35547, ) _GETPROTOCOLVERSIONUPGRADEVOTESTATUSRESPONSE = _descriptor.Descriptor( @@ -9478,8 +9835,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=33461, - serialized_end=34212, + serialized_start=34807, + serialized_end=35558, ) @@ -9531,8 +9888,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=34325, - serialized_end=34449, + serialized_start=35671, + serialized_end=35795, ) _GETEPOCHSINFOREQUEST = _descriptor.Descriptor( @@ -9567,8 +9924,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=34215, - serialized_end=34460, + serialized_start=35561, + serialized_end=35806, ) @@ -9599,8 +9956,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=34821, - serialized_end=34938, + serialized_start=36167, + serialized_end=36284, ) _GETEPOCHSINFORESPONSE_GETEPOCHSINFORESPONSEV0_EPOCHINFO = _descriptor.Descriptor( @@ -9665,8 +10022,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=34941, - serialized_end=35107, + serialized_start=36287, + serialized_end=36453, ) _GETEPOCHSINFORESPONSE_GETEPOCHSINFORESPONSEV0 = _descriptor.Descriptor( @@ -9715,8 +10072,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=34577, - serialized_end=35117, + serialized_start=35923, + serialized_end=36463, ) _GETEPOCHSINFORESPONSE = _descriptor.Descriptor( @@ -9751,8 +10108,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=34463, - serialized_end=35128, + serialized_start=35809, + serialized_end=36474, ) @@ -9811,8 +10168,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=35269, - serialized_end=35439, + serialized_start=36615, + serialized_end=36785, ) _GETFINALIZEDEPOCHINFOSREQUEST = _descriptor.Descriptor( @@ -9847,8 +10204,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=35131, - serialized_end=35450, + serialized_start=36477, + serialized_end=36796, ) @@ -9879,8 +10236,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=35876, - serialized_end=36040, + serialized_start=37222, + serialized_end=37386, ) _GETFINALIZEDEPOCHINFOSRESPONSE_GETFINALIZEDEPOCHINFOSRESPONSEV0_FINALIZEDEPOCHINFO = _descriptor.Descriptor( @@ -9994,8 +10351,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=36043, - serialized_end=36586, + serialized_start=37389, + serialized_end=37932, ) _GETFINALIZEDEPOCHINFOSRESPONSE_GETFINALIZEDEPOCHINFOSRESPONSEV0_BLOCKPROPOSER = _descriptor.Descriptor( @@ -10032,8 +10389,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=36588, - serialized_end=36645, + serialized_start=37934, + serialized_end=37991, ) _GETFINALIZEDEPOCHINFOSRESPONSE_GETFINALIZEDEPOCHINFOSRESPONSEV0 = _descriptor.Descriptor( @@ -10082,8 +10439,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=35594, - serialized_end=36655, + serialized_start=36940, + serialized_end=38001, ) _GETFINALIZEDEPOCHINFOSRESPONSE = _descriptor.Descriptor( @@ -10118,8 +10475,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=35453, - serialized_end=36666, + serialized_start=36799, + serialized_end=38012, ) @@ -10157,8 +10514,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=37161, - serialized_end=37230, + serialized_start=38507, + serialized_end=38576, ) _GETCONTESTEDRESOURCESREQUEST_GETCONTESTEDRESOURCESREQUESTV0 = _descriptor.Descriptor( @@ -10254,8 +10611,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=36804, - serialized_end=37264, + serialized_start=38150, + serialized_end=38610, ) _GETCONTESTEDRESOURCESREQUEST = _descriptor.Descriptor( @@ -10290,8 +10647,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=36669, - serialized_end=37275, + serialized_start=38015, + serialized_end=38621, ) @@ -10322,8 +10679,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=37717, - serialized_end=37777, + serialized_start=39063, + serialized_end=39123, ) _GETCONTESTEDRESOURCESRESPONSE_GETCONTESTEDRESOURCESRESPONSEV0 = _descriptor.Descriptor( @@ -10372,8 +10729,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=37416, - serialized_end=37787, + serialized_start=38762, + serialized_end=39133, ) _GETCONTESTEDRESOURCESRESPONSE = _descriptor.Descriptor( @@ -10408,8 +10765,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=37278, - serialized_end=37798, + serialized_start=38624, + serialized_end=39144, ) @@ -10447,8 +10804,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=38311, - serialized_end=38384, + serialized_start=39657, + serialized_end=39730, ) _GETVOTEPOLLSBYENDDATEREQUEST_GETVOTEPOLLSBYENDDATEREQUESTV0_ENDATTIMEINFO = _descriptor.Descriptor( @@ -10485,8 +10842,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=38386, - serialized_end=38453, + serialized_start=39732, + serialized_end=39799, ) _GETVOTEPOLLSBYENDDATEREQUEST_GETVOTEPOLLSBYENDDATEREQUESTV0 = _descriptor.Descriptor( @@ -10571,8 +10928,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=37936, - serialized_end=38512, + serialized_start=39282, + serialized_end=39858, ) _GETVOTEPOLLSBYENDDATEREQUEST = _descriptor.Descriptor( @@ -10607,8 +10964,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=37801, - serialized_end=38523, + serialized_start=39147, + serialized_end=39869, ) @@ -10646,8 +11003,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=38972, - serialized_end=39058, + serialized_start=40318, + serialized_end=40404, ) _GETVOTEPOLLSBYENDDATERESPONSE_GETVOTEPOLLSBYENDDATERESPONSEV0_SERIALIZEDVOTEPOLLSBYTIMESTAMPS = _descriptor.Descriptor( @@ -10684,8 +11041,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=39061, - serialized_end=39276, + serialized_start=40407, + serialized_end=40622, ) _GETVOTEPOLLSBYENDDATERESPONSE_GETVOTEPOLLSBYENDDATERESPONSEV0 = _descriptor.Descriptor( @@ -10734,8 +11091,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=38664, - serialized_end=39286, + serialized_start=40010, + serialized_end=40632, ) _GETVOTEPOLLSBYENDDATERESPONSE = _descriptor.Descriptor( @@ -10770,8 +11127,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=38526, - serialized_end=39297, + serialized_start=39872, + serialized_end=40643, ) @@ -10809,8 +11166,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=39986, - serialized_end=40070, + serialized_start=41332, + serialized_end=41416, ) _GETCONTESTEDRESOURCEVOTESTATEREQUEST_GETCONTESTEDRESOURCEVOTESTATEREQUESTV0 = _descriptor.Descriptor( @@ -10907,8 +11264,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=39459, - serialized_end=40184, + serialized_start=40805, + serialized_end=41530, ) _GETCONTESTEDRESOURCEVOTESTATEREQUEST = _descriptor.Descriptor( @@ -10943,8 +11300,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=39300, - serialized_end=40195, + serialized_start=40646, + serialized_end=41541, ) @@ -11016,8 +11373,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=40695, - serialized_end=41169, + serialized_start=42041, + serialized_end=42515, ) _GETCONTESTEDRESOURCEVOTESTATERESPONSE_GETCONTESTEDRESOURCEVOTESTATERESPONSEV0_CONTESTEDRESOURCECONTENDERS = _descriptor.Descriptor( @@ -11083,8 +11440,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=41172, - serialized_end=41624, + serialized_start=42518, + serialized_end=42970, ) _GETCONTESTEDRESOURCEVOTESTATERESPONSE_GETCONTESTEDRESOURCEVOTESTATERESPONSEV0_CONTENDER = _descriptor.Descriptor( @@ -11138,8 +11495,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=41626, - serialized_end=41733, + serialized_start=42972, + serialized_end=43079, ) _GETCONTESTEDRESOURCEVOTESTATERESPONSE_GETCONTESTEDRESOURCEVOTESTATERESPONSEV0 = _descriptor.Descriptor( @@ -11188,8 +11545,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=40360, - serialized_end=41743, + serialized_start=41706, + serialized_end=43089, ) _GETCONTESTEDRESOURCEVOTESTATERESPONSE = _descriptor.Descriptor( @@ -11224,8 +11581,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=40198, - serialized_end=41754, + serialized_start=41544, + serialized_end=43100, ) @@ -11263,8 +11620,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=39986, - serialized_end=40070, + serialized_start=41332, + serialized_end=41416, ) _GETCONTESTEDRESOURCEVOTERSFORIDENTITYREQUEST_GETCONTESTEDRESOURCEVOTERSFORIDENTITYREQUESTV0 = _descriptor.Descriptor( @@ -11360,8 +11717,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=41941, - serialized_end=42471, + serialized_start=43287, + serialized_end=43817, ) _GETCONTESTEDRESOURCEVOTERSFORIDENTITYREQUEST = _descriptor.Descriptor( @@ -11396,8 +11753,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=41757, - serialized_end=42482, + serialized_start=43103, + serialized_end=43828, ) @@ -11435,8 +11792,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=43022, - serialized_end=43089, + serialized_start=44368, + serialized_end=44435, ) _GETCONTESTEDRESOURCEVOTERSFORIDENTITYRESPONSE_GETCONTESTEDRESOURCEVOTERSFORIDENTITYRESPONSEV0 = _descriptor.Descriptor( @@ -11485,8 +11842,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=42672, - serialized_end=43099, + serialized_start=44018, + serialized_end=44445, ) _GETCONTESTEDRESOURCEVOTERSFORIDENTITYRESPONSE = _descriptor.Descriptor( @@ -11521,8 +11878,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=42485, - serialized_end=43110, + serialized_start=43831, + serialized_end=44456, ) @@ -11560,8 +11917,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=43659, - serialized_end=43756, + serialized_start=45005, + serialized_end=45102, ) _GETCONTESTEDRESOURCEIDENTITYVOTESREQUEST_GETCONTESTEDRESOURCEIDENTITYVOTESREQUESTV0 = _descriptor.Descriptor( @@ -11631,8 +11988,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=43284, - serialized_end=43787, + serialized_start=44630, + serialized_end=45133, ) _GETCONTESTEDRESOURCEIDENTITYVOTESREQUEST = _descriptor.Descriptor( @@ -11667,8 +12024,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=43113, - serialized_end=43798, + serialized_start=44459, + serialized_end=45144, ) @@ -11706,8 +12063,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=44301, - serialized_end=44548, + serialized_start=45647, + serialized_end=45894, ) _GETCONTESTEDRESOURCEIDENTITYVOTESRESPONSE_GETCONTESTEDRESOURCEIDENTITYVOTESRESPONSEV0_RESOURCEVOTECHOICE = _descriptor.Descriptor( @@ -11750,8 +12107,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=44551, - serialized_end=44852, + serialized_start=45897, + serialized_end=46198, ) _GETCONTESTEDRESOURCEIDENTITYVOTESRESPONSE_GETCONTESTEDRESOURCEIDENTITYVOTESRESPONSEV0_CONTESTEDRESOURCEIDENTITYVOTE = _descriptor.Descriptor( @@ -11802,8 +12159,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=44855, - serialized_end=45132, + serialized_start=46201, + serialized_end=46478, ) _GETCONTESTEDRESOURCEIDENTITYVOTESRESPONSE_GETCONTESTEDRESOURCEIDENTITYVOTESRESPONSEV0 = _descriptor.Descriptor( @@ -11852,8 +12209,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=43975, - serialized_end=45142, + serialized_start=45321, + serialized_end=46488, ) _GETCONTESTEDRESOURCEIDENTITYVOTESRESPONSE = _descriptor.Descriptor( @@ -11888,8 +12245,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=43801, - serialized_end=45153, + serialized_start=45147, + serialized_end=46499, ) @@ -11927,8 +12284,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=45317, - serialized_end=45385, + serialized_start=46663, + serialized_end=46731, ) _GETPREFUNDEDSPECIALIZEDBALANCEREQUEST = _descriptor.Descriptor( @@ -11963,8 +12320,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=45156, - serialized_end=45396, + serialized_start=46502, + serialized_end=46742, ) @@ -12014,8 +12371,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=45564, - serialized_end=45753, + serialized_start=46910, + serialized_end=47099, ) _GETPREFUNDEDSPECIALIZEDBALANCERESPONSE = _descriptor.Descriptor( @@ -12050,8 +12407,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=45399, - serialized_end=45764, + serialized_start=46745, + serialized_end=47110, ) @@ -12082,8 +12439,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=45913, - serialized_end=45964, + serialized_start=47259, + serialized_end=47310, ) _GETTOTALCREDITSINPLATFORMREQUEST = _descriptor.Descriptor( @@ -12118,8 +12475,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=45767, - serialized_end=45975, + serialized_start=47113, + serialized_end=47321, ) @@ -12169,8 +12526,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=46128, - serialized_end=46312, + serialized_start=47474, + serialized_end=47658, ) _GETTOTALCREDITSINPLATFORMRESPONSE = _descriptor.Descriptor( @@ -12205,8 +12562,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=45978, - serialized_end=46323, + serialized_start=47324, + serialized_end=47669, ) @@ -12251,8 +12608,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=46442, - serialized_end=46511, + serialized_start=47788, + serialized_end=47857, ) _GETPATHELEMENTSREQUEST = _descriptor.Descriptor( @@ -12287,8 +12644,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=46326, - serialized_end=46522, + serialized_start=47672, + serialized_end=47868, ) @@ -12319,8 +12676,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=46895, - serialized_end=46923, + serialized_start=48241, + serialized_end=48269, ) _GETPATHELEMENTSRESPONSE_GETPATHELEMENTSRESPONSEV0 = _descriptor.Descriptor( @@ -12369,8 +12726,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=46645, - serialized_end=46933, + serialized_start=47991, + serialized_end=48279, ) _GETPATHELEMENTSRESPONSE = _descriptor.Descriptor( @@ -12405,8 +12762,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=46525, - serialized_end=46944, + serialized_start=47871, + serialized_end=48290, ) @@ -12430,8 +12787,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=47045, - serialized_end=47065, + serialized_start=48391, + serialized_end=48411, ) _GETSTATUSREQUEST = _descriptor.Descriptor( @@ -12466,8 +12823,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=46947, - serialized_end=47076, + serialized_start=48293, + serialized_end=48422, ) @@ -12522,8 +12879,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=47953, - serialized_end=48047, + serialized_start=49299, + serialized_end=49393, ) _GETSTATUSRESPONSE_GETSTATUSRESPONSEV0_VERSION_PROTOCOL_TENDERDASH = _descriptor.Descriptor( @@ -12560,8 +12917,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=48280, - serialized_end=48320, + serialized_start=49626, + serialized_end=49666, ) _GETSTATUSRESPONSE_GETSTATUSRESPONSEV0_VERSION_PROTOCOL_DRIVE = _descriptor.Descriptor( @@ -12605,8 +12962,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=48322, - serialized_end=48382, + serialized_start=49668, + serialized_end=49728, ) _GETSTATUSRESPONSE_GETSTATUSRESPONSEV0_VERSION_PROTOCOL = _descriptor.Descriptor( @@ -12643,8 +13000,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=48050, - serialized_end=48382, + serialized_start=49396, + serialized_end=49728, ) _GETSTATUSRESPONSE_GETSTATUSRESPONSEV0_VERSION = _descriptor.Descriptor( @@ -12681,8 +13038,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=47740, - serialized_end=48382, + serialized_start=49086, + serialized_end=49728, ) _GETSTATUSRESPONSE_GETSTATUSRESPONSEV0_TIME = _descriptor.Descriptor( @@ -12748,8 +13105,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=48384, - serialized_end=48511, + serialized_start=49730, + serialized_end=49857, ) _GETSTATUSRESPONSE_GETSTATUSRESPONSEV0_NODE = _descriptor.Descriptor( @@ -12791,8 +13148,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=48513, - serialized_end=48573, + serialized_start=49859, + serialized_end=49919, ) _GETSTATUSRESPONSE_GETSTATUSRESPONSEV0_CHAIN = _descriptor.Descriptor( @@ -12883,8 +13240,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=48576, - serialized_end=48883, + serialized_start=49922, + serialized_end=50229, ) _GETSTATUSRESPONSE_GETSTATUSRESPONSEV0_NETWORK = _descriptor.Descriptor( @@ -12928,8 +13285,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=48885, - serialized_end=48952, + serialized_start=50231, + serialized_end=50298, ) _GETSTATUSRESPONSE_GETSTATUSRESPONSEV0_STATESYNC = _descriptor.Descriptor( @@ -13008,8 +13365,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=48955, - serialized_end=49216, + serialized_start=50301, + serialized_end=50562, ) _GETSTATUSRESPONSE_GETSTATUSRESPONSEV0 = _descriptor.Descriptor( @@ -13074,8 +13431,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=47181, - serialized_end=49216, + serialized_start=48527, + serialized_end=50562, ) _GETSTATUSRESPONSE = _descriptor.Descriptor( @@ -13110,8 +13467,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=47079, - serialized_end=49227, + serialized_start=48425, + serialized_end=50573, ) @@ -13135,8 +13492,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=49364, - serialized_end=49396, + serialized_start=50710, + serialized_end=50742, ) _GETCURRENTQUORUMSINFOREQUEST = _descriptor.Descriptor( @@ -13171,8 +13528,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=49230, - serialized_end=49407, + serialized_start=50576, + serialized_end=50753, ) @@ -13217,8 +13574,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=49547, - serialized_end=49617, + serialized_start=50893, + serialized_end=50963, ) _GETCURRENTQUORUMSINFORESPONSE_VALIDATORSETV0 = _descriptor.Descriptor( @@ -13269,8 +13626,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=49620, - serialized_end=49795, + serialized_start=50966, + serialized_end=51141, ) _GETCURRENTQUORUMSINFORESPONSE_GETCURRENTQUORUMSINFORESPONSEV0 = _descriptor.Descriptor( @@ -13328,8 +13685,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=49798, - serialized_end=50072, + serialized_start=51144, + serialized_end=51418, ) _GETCURRENTQUORUMSINFORESPONSE = _descriptor.Descriptor( @@ -13364,8 +13721,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=49410, - serialized_end=50083, + serialized_start=50756, + serialized_end=51429, ) @@ -13410,8 +13767,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=50229, - serialized_end=50319, + serialized_start=51575, + serialized_end=51665, ) _GETIDENTITYTOKENBALANCESREQUEST = _descriptor.Descriptor( @@ -13446,8 +13803,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=50086, - serialized_end=50330, + serialized_start=51432, + serialized_end=51676, ) @@ -13490,8 +13847,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=50769, - serialized_end=50840, + serialized_start=52115, + serialized_end=52186, ) _GETIDENTITYTOKENBALANCESRESPONSE_GETIDENTITYTOKENBALANCESRESPONSEV0_TOKENBALANCES = _descriptor.Descriptor( @@ -13521,8 +13878,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=50843, - serialized_end=50997, + serialized_start=52189, + serialized_end=52343, ) _GETIDENTITYTOKENBALANCESRESPONSE_GETIDENTITYTOKENBALANCESRESPONSEV0 = _descriptor.Descriptor( @@ -13571,8 +13928,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=50480, - serialized_end=51007, + serialized_start=51826, + serialized_end=52353, ) _GETIDENTITYTOKENBALANCESRESPONSE = _descriptor.Descriptor( @@ -13607,8 +13964,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=50333, - serialized_end=51018, + serialized_start=51679, + serialized_end=52364, ) @@ -13653,8 +14010,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=51170, - serialized_end=51262, + serialized_start=52516, + serialized_end=52608, ) _GETIDENTITIESTOKENBALANCESREQUEST = _descriptor.Descriptor( @@ -13689,8 +14046,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=51021, - serialized_end=51273, + serialized_start=52367, + serialized_end=52619, ) @@ -13733,8 +14090,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=51741, - serialized_end=51823, + serialized_start=53087, + serialized_end=53169, ) _GETIDENTITIESTOKENBALANCESRESPONSE_GETIDENTITIESTOKENBALANCESRESPONSEV0_IDENTITYTOKENBALANCES = _descriptor.Descriptor( @@ -13764,8 +14121,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=51826, - serialized_end=52009, + serialized_start=53172, + serialized_end=53355, ) _GETIDENTITIESTOKENBALANCESRESPONSE_GETIDENTITIESTOKENBALANCESRESPONSEV0 = _descriptor.Descriptor( @@ -13814,8 +14171,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=51429, - serialized_end=52019, + serialized_start=52775, + serialized_end=53365, ) _GETIDENTITIESTOKENBALANCESRESPONSE = _descriptor.Descriptor( @@ -13850,8 +14207,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=51276, - serialized_end=52030, + serialized_start=52622, + serialized_end=53376, ) @@ -13896,8 +14253,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=52167, - serialized_end=52254, + serialized_start=53513, + serialized_end=53600, ) _GETIDENTITYTOKENINFOSREQUEST = _descriptor.Descriptor( @@ -13932,8 +14289,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=52033, - serialized_end=52265, + serialized_start=53379, + serialized_end=53611, ) @@ -13964,8 +14321,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=52679, - serialized_end=52719, + serialized_start=54025, + serialized_end=54065, ) _GETIDENTITYTOKENINFOSRESPONSE_GETIDENTITYTOKENINFOSRESPONSEV0_TOKENINFOENTRY = _descriptor.Descriptor( @@ -14007,8 +14364,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=52722, - serialized_end=52898, + serialized_start=54068, + serialized_end=54244, ) _GETIDENTITYTOKENINFOSRESPONSE_GETIDENTITYTOKENINFOSRESPONSEV0_TOKENINFOS = _descriptor.Descriptor( @@ -14038,8 +14395,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=52901, - serialized_end=53039, + serialized_start=54247, + serialized_end=54385, ) _GETIDENTITYTOKENINFOSRESPONSE_GETIDENTITYTOKENINFOSRESPONSEV0 = _descriptor.Descriptor( @@ -14088,8 +14445,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=52406, - serialized_end=53049, + serialized_start=53752, + serialized_end=54395, ) _GETIDENTITYTOKENINFOSRESPONSE = _descriptor.Descriptor( @@ -14124,8 +14481,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=52268, - serialized_end=53060, + serialized_start=53614, + serialized_end=54406, ) @@ -14170,8 +14527,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=53203, - serialized_end=53292, + serialized_start=54549, + serialized_end=54638, ) _GETIDENTITIESTOKENINFOSREQUEST = _descriptor.Descriptor( @@ -14206,8 +14563,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=53063, - serialized_end=53303, + serialized_start=54409, + serialized_end=54649, ) @@ -14238,8 +14595,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=52679, - serialized_end=52719, + serialized_start=54025, + serialized_end=54065, ) _GETIDENTITIESTOKENINFOSRESPONSE_GETIDENTITIESTOKENINFOSRESPONSEV0_TOKENINFOENTRY = _descriptor.Descriptor( @@ -14281,8 +14638,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=53790, - serialized_end=53973, + serialized_start=55136, + serialized_end=55319, ) _GETIDENTITIESTOKENINFOSRESPONSE_GETIDENTITIESTOKENINFOSRESPONSEV0_IDENTITYTOKENINFOS = _descriptor.Descriptor( @@ -14312,8 +14669,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=53976, - serialized_end=54127, + serialized_start=55322, + serialized_end=55473, ) _GETIDENTITIESTOKENINFOSRESPONSE_GETIDENTITIESTOKENINFOSRESPONSEV0 = _descriptor.Descriptor( @@ -14362,8 +14719,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=53450, - serialized_end=54137, + serialized_start=54796, + serialized_end=55483, ) _GETIDENTITIESTOKENINFOSRESPONSE = _descriptor.Descriptor( @@ -14398,8 +14755,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=53306, - serialized_end=54148, + serialized_start=54652, + serialized_end=55494, ) @@ -14437,8 +14794,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=54270, - serialized_end=54331, + serialized_start=55616, + serialized_end=55677, ) _GETTOKENSTATUSESREQUEST = _descriptor.Descriptor( @@ -14473,8 +14830,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=54151, - serialized_end=54342, + serialized_start=55497, + serialized_end=55688, ) @@ -14517,8 +14874,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=54732, - serialized_end=54800, + serialized_start=56078, + serialized_end=56146, ) _GETTOKENSTATUSESRESPONSE_GETTOKENSTATUSESRESPONSEV0_TOKENSTATUSES = _descriptor.Descriptor( @@ -14548,8 +14905,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=54803, - serialized_end=54939, + serialized_start=56149, + serialized_end=56285, ) _GETTOKENSTATUSESRESPONSE_GETTOKENSTATUSESRESPONSEV0 = _descriptor.Descriptor( @@ -14598,8 +14955,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=54468, - serialized_end=54949, + serialized_start=55814, + serialized_end=56295, ) _GETTOKENSTATUSESRESPONSE = _descriptor.Descriptor( @@ -14634,8 +14991,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=54345, - serialized_end=54960, + serialized_start=55691, + serialized_end=56306, ) @@ -14673,8 +15030,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=55118, - serialized_end=55191, + serialized_start=56464, + serialized_end=56537, ) _GETTOKENDIRECTPURCHASEPRICESREQUEST = _descriptor.Descriptor( @@ -14709,8 +15066,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=54963, - serialized_end=55202, + serialized_start=56309, + serialized_end=56548, ) @@ -14748,8 +15105,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=55692, - serialized_end=55743, + serialized_start=57038, + serialized_end=57089, ) _GETTOKENDIRECTPURCHASEPRICESRESPONSE_GETTOKENDIRECTPURCHASEPRICESRESPONSEV0_PRICINGSCHEDULE = _descriptor.Descriptor( @@ -14779,8 +15136,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=55746, - serialized_end=55913, + serialized_start=57092, + serialized_end=57259, ) _GETTOKENDIRECTPURCHASEPRICESRESPONSE_GETTOKENDIRECTPURCHASEPRICESRESPONSEV0_TOKENDIRECTPURCHASEPRICEENTRY = _descriptor.Descriptor( @@ -14829,8 +15186,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=55916, - serialized_end=56144, + serialized_start=57262, + serialized_end=57490, ) _GETTOKENDIRECTPURCHASEPRICESRESPONSE_GETTOKENDIRECTPURCHASEPRICESRESPONSEV0_TOKENDIRECTPURCHASEPRICES = _descriptor.Descriptor( @@ -14860,8 +15217,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=56147, - serialized_end=56347, + serialized_start=57493, + serialized_end=57693, ) _GETTOKENDIRECTPURCHASEPRICESRESPONSE_GETTOKENDIRECTPURCHASEPRICESRESPONSEV0 = _descriptor.Descriptor( @@ -14910,8 +15267,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=55364, - serialized_end=56357, + serialized_start=56710, + serialized_end=57703, ) _GETTOKENDIRECTPURCHASEPRICESRESPONSE = _descriptor.Descriptor( @@ -14946,8 +15303,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=55205, - serialized_end=56368, + serialized_start=56551, + serialized_end=57714, ) @@ -14985,8 +15342,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=56502, - serialized_end=56566, + serialized_start=57848, + serialized_end=57912, ) _GETTOKENCONTRACTINFOREQUEST = _descriptor.Descriptor( @@ -15021,8 +15378,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=56371, - serialized_end=56577, + serialized_start=57717, + serialized_end=57923, ) @@ -15060,8 +15417,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=56989, - serialized_end=57066, + serialized_start=58335, + serialized_end=58412, ) _GETTOKENCONTRACTINFORESPONSE_GETTOKENCONTRACTINFORESPONSEV0 = _descriptor.Descriptor( @@ -15110,8 +15467,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=56715, - serialized_end=57076, + serialized_start=58061, + serialized_end=58422, ) _GETTOKENCONTRACTINFORESPONSE = _descriptor.Descriptor( @@ -15146,8 +15503,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=56580, - serialized_end=57087, + serialized_start=57926, + serialized_end=58433, ) @@ -15202,8 +15559,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=57520, - serialized_end=57674, + serialized_start=58866, + serialized_end=59020, ) _GETTOKENPREPROGRAMMEDDISTRIBUTIONSREQUEST_GETTOKENPREPROGRAMMEDDISTRIBUTIONSREQUESTV0 = _descriptor.Descriptor( @@ -15264,8 +15621,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=57264, - serialized_end=57702, + serialized_start=58610, + serialized_end=59048, ) _GETTOKENPREPROGRAMMEDDISTRIBUTIONSREQUEST = _descriptor.Descriptor( @@ -15300,8 +15657,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=57090, - serialized_end=57713, + serialized_start=58436, + serialized_end=59059, ) @@ -15339,8 +15696,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=58224, - serialized_end=58286, + serialized_start=59570, + serialized_end=59632, ) _GETTOKENPREPROGRAMMEDDISTRIBUTIONSRESPONSE_GETTOKENPREPROGRAMMEDDISTRIBUTIONSRESPONSEV0_TOKENTIMEDDISTRIBUTIONENTRY = _descriptor.Descriptor( @@ -15377,8 +15734,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=58289, - serialized_end=58501, + serialized_start=59635, + serialized_end=59847, ) _GETTOKENPREPROGRAMMEDDISTRIBUTIONSRESPONSE_GETTOKENPREPROGRAMMEDDISTRIBUTIONSRESPONSEV0_TOKENDISTRIBUTIONS = _descriptor.Descriptor( @@ -15408,8 +15765,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=58504, - serialized_end=58699, + serialized_start=59850, + serialized_end=60045, ) _GETTOKENPREPROGRAMMEDDISTRIBUTIONSRESPONSE_GETTOKENPREPROGRAMMEDDISTRIBUTIONSRESPONSEV0 = _descriptor.Descriptor( @@ -15458,8 +15815,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=57894, - serialized_end=58709, + serialized_start=59240, + serialized_end=60055, ) _GETTOKENPREPROGRAMMEDDISTRIBUTIONSRESPONSE = _descriptor.Descriptor( @@ -15494,8 +15851,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=57716, - serialized_end=58720, + serialized_start=59062, + serialized_end=60066, ) @@ -15533,8 +15890,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=58909, - serialized_end=58982, + serialized_start=60255, + serialized_end=60328, ) _GETTOKENPERPETUALDISTRIBUTIONLASTCLAIMREQUEST_GETTOKENPERPETUALDISTRIBUTIONLASTCLAIMREQUESTV0 = _descriptor.Descriptor( @@ -15590,8 +15947,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=58985, - serialized_end=59226, + serialized_start=60331, + serialized_end=60572, ) _GETTOKENPERPETUALDISTRIBUTIONLASTCLAIMREQUEST = _descriptor.Descriptor( @@ -15626,8 +15983,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=58723, - serialized_end=59237, + serialized_start=60069, + serialized_end=60583, ) @@ -15684,8 +16041,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=59758, - serialized_end=59878, + serialized_start=61104, + serialized_end=61224, ) _GETTOKENPERPETUALDISTRIBUTIONLASTCLAIMRESPONSE_GETTOKENPERPETUALDISTRIBUTIONLASTCLAIMRESPONSEV0 = _descriptor.Descriptor( @@ -15734,8 +16091,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=59430, - serialized_end=59888, + serialized_start=60776, + serialized_end=61234, ) _GETTOKENPERPETUALDISTRIBUTIONLASTCLAIMRESPONSE = _descriptor.Descriptor( @@ -15770,8 +16127,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=59240, - serialized_end=59899, + serialized_start=60586, + serialized_end=61245, ) @@ -15809,8 +16166,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=60030, - serialized_end=60093, + serialized_start=61376, + serialized_end=61439, ) _GETTOKENTOTALSUPPLYREQUEST = _descriptor.Descriptor( @@ -15845,8 +16202,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=59902, - serialized_end=60104, + serialized_start=61248, + serialized_end=61450, ) @@ -15891,8 +16248,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=60525, - serialized_end=60645, + serialized_start=61871, + serialized_end=61991, ) _GETTOKENTOTALSUPPLYRESPONSE_GETTOKENTOTALSUPPLYRESPONSEV0 = _descriptor.Descriptor( @@ -15941,8 +16298,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=60239, - serialized_end=60655, + serialized_start=61585, + serialized_end=62001, ) _GETTOKENTOTALSUPPLYRESPONSE = _descriptor.Descriptor( @@ -15977,8 +16334,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=60107, - serialized_end=60666, + serialized_start=61453, + serialized_end=62012, ) @@ -16023,8 +16380,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=60776, - serialized_end=60868, + serialized_start=62122, + serialized_end=62214, ) _GETGROUPINFOREQUEST = _descriptor.Descriptor( @@ -16059,8 +16416,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=60669, - serialized_end=60879, + serialized_start=62015, + serialized_end=62225, ) @@ -16098,8 +16455,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=61237, - serialized_end=61289, + serialized_start=62583, + serialized_end=62635, ) _GETGROUPINFORESPONSE_GETGROUPINFORESPONSEV0_GROUPINFOENTRY = _descriptor.Descriptor( @@ -16136,8 +16493,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=61292, - serialized_end=61444, + serialized_start=62638, + serialized_end=62790, ) _GETGROUPINFORESPONSE_GETGROUPINFORESPONSEV0_GROUPINFO = _descriptor.Descriptor( @@ -16172,8 +16529,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=61447, - serialized_end=61585, + serialized_start=62793, + serialized_end=62931, ) _GETGROUPINFORESPONSE_GETGROUPINFORESPONSEV0 = _descriptor.Descriptor( @@ -16222,8 +16579,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=60993, - serialized_end=61595, + serialized_start=62339, + serialized_end=62941, ) _GETGROUPINFORESPONSE = _descriptor.Descriptor( @@ -16258,8 +16615,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=60882, - serialized_end=61606, + serialized_start=62228, + serialized_end=62952, ) @@ -16297,8 +16654,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=61719, - serialized_end=61836, + serialized_start=63065, + serialized_end=63182, ) _GETGROUPINFOSREQUEST_GETGROUPINFOSREQUESTV0 = _descriptor.Descriptor( @@ -16359,8 +16716,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=61839, - serialized_end=62091, + serialized_start=63185, + serialized_end=63437, ) _GETGROUPINFOSREQUEST = _descriptor.Descriptor( @@ -16395,8 +16752,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=61609, - serialized_end=62102, + serialized_start=62955, + serialized_end=63448, ) @@ -16434,8 +16791,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=61237, - serialized_end=61289, + serialized_start=62583, + serialized_end=62635, ) _GETGROUPINFOSRESPONSE_GETGROUPINFOSRESPONSEV0_GROUPPOSITIONINFOENTRY = _descriptor.Descriptor( @@ -16479,8 +16836,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=62523, - serialized_end=62718, + serialized_start=63869, + serialized_end=64064, ) _GETGROUPINFOSRESPONSE_GETGROUPINFOSRESPONSEV0_GROUPINFOS = _descriptor.Descriptor( @@ -16510,8 +16867,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=62721, - serialized_end=62851, + serialized_start=64067, + serialized_end=64197, ) _GETGROUPINFOSRESPONSE_GETGROUPINFOSRESPONSEV0 = _descriptor.Descriptor( @@ -16560,8 +16917,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=62219, - serialized_end=62861, + serialized_start=63565, + serialized_end=64207, ) _GETGROUPINFOSRESPONSE = _descriptor.Descriptor( @@ -16596,8 +16953,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=62105, - serialized_end=62872, + serialized_start=63451, + serialized_end=64218, ) @@ -16635,8 +16992,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=62991, - serialized_end=63067, + serialized_start=64337, + serialized_end=64413, ) _GETGROUPACTIONSREQUEST_GETGROUPACTIONSREQUESTV0 = _descriptor.Descriptor( @@ -16711,8 +17068,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=63070, - serialized_end=63398, + serialized_start=64416, + serialized_end=64744, ) _GETGROUPACTIONSREQUEST = _descriptor.Descriptor( @@ -16748,8 +17105,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=62875, - serialized_end=63449, + serialized_start=64221, + serialized_end=64795, ) @@ -16799,8 +17156,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=63831, - serialized_end=63922, + serialized_start=65177, + serialized_end=65268, ) _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_BURNEVENT = _descriptor.Descriptor( @@ -16849,8 +17206,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=63924, - serialized_end=64015, + serialized_start=65270, + serialized_end=65361, ) _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_FREEZEEVENT = _descriptor.Descriptor( @@ -16892,8 +17249,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=64017, - serialized_end=64091, + serialized_start=65363, + serialized_end=65437, ) _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_UNFREEZEEVENT = _descriptor.Descriptor( @@ -16935,8 +17292,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=64093, - serialized_end=64169, + serialized_start=65439, + serialized_end=65515, ) _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_DESTROYFROZENFUNDSEVENT = _descriptor.Descriptor( @@ -16985,8 +17342,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=64171, - serialized_end=64273, + serialized_start=65517, + serialized_end=65619, ) _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_SHAREDENCRYPTEDNOTE = _descriptor.Descriptor( @@ -17030,8 +17387,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=64275, - serialized_end=64375, + serialized_start=65621, + serialized_end=65721, ) _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_PERSONALENCRYPTEDNOTE = _descriptor.Descriptor( @@ -17075,8 +17432,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=64377, - serialized_end=64500, + serialized_start=65723, + serialized_end=65846, ) _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_EMERGENCYACTIONEVENT = _descriptor.Descriptor( @@ -17119,8 +17476,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=64503, - serialized_end=64736, + serialized_start=65849, + serialized_end=66082, ) _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_TOKENCONFIGUPDATEEVENT = _descriptor.Descriptor( @@ -17162,8 +17519,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=64738, - serialized_end=64838, + serialized_start=66084, + serialized_end=66184, ) _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_UPDATEDIRECTPURCHASEPRICEEVENT_PRICEFORQUANTITY = _descriptor.Descriptor( @@ -17200,8 +17557,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=55692, - serialized_end=55743, + serialized_start=57038, + serialized_end=57089, ) _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_UPDATEDIRECTPURCHASEPRICEEVENT_PRICINGSCHEDULE = _descriptor.Descriptor( @@ -17231,8 +17588,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=65130, - serialized_end=65302, + serialized_start=66476, + serialized_end=66648, ) _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_UPDATEDIRECTPURCHASEPRICEEVENT = _descriptor.Descriptor( @@ -17286,8 +17643,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=64841, - serialized_end=65327, + serialized_start=66187, + serialized_end=66673, ) _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_GROUPACTIONEVENT = _descriptor.Descriptor( @@ -17336,8 +17693,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=65330, - serialized_end=65710, + serialized_start=66676, + serialized_end=67056, ) _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_DOCUMENTEVENT = _descriptor.Descriptor( @@ -17372,8 +17729,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=65713, - serialized_end=65852, + serialized_start=67059, + serialized_end=67198, ) _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_DOCUMENTCREATEEVENT = _descriptor.Descriptor( @@ -17403,8 +17760,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=65854, - serialized_end=65901, + serialized_start=67200, + serialized_end=67247, ) _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_CONTRACTUPDATEEVENT = _descriptor.Descriptor( @@ -17434,8 +17791,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=65903, - serialized_end=65950, + serialized_start=67249, + serialized_end=67296, ) _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_CONTRACTEVENT = _descriptor.Descriptor( @@ -17470,8 +17827,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=65953, - serialized_end=66092, + serialized_start=67299, + serialized_end=67438, ) _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_TOKENEVENT = _descriptor.Descriptor( @@ -17555,8 +17912,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=66095, - serialized_end=67072, + serialized_start=67441, + serialized_end=68418, ) _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_GROUPACTIONENTRY = _descriptor.Descriptor( @@ -17593,8 +17950,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=67075, - serialized_end=67222, + serialized_start=68421, + serialized_end=68568, ) _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_GROUPACTIONS = _descriptor.Descriptor( @@ -17624,8 +17981,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=67225, - serialized_end=67357, + serialized_start=68571, + serialized_end=68703, ) _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0 = _descriptor.Descriptor( @@ -17674,8 +18031,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=63572, - serialized_end=67367, + serialized_start=64918, + serialized_end=68713, ) _GETGROUPACTIONSRESPONSE = _descriptor.Descriptor( @@ -17710,8 +18067,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=63452, - serialized_end=67378, + serialized_start=64798, + serialized_end=68724, ) @@ -17770,8 +18127,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=67516, - serialized_end=67722, + serialized_start=68862, + serialized_end=69068, ) _GETGROUPACTIONSIGNERSREQUEST = _descriptor.Descriptor( @@ -17807,8 +18164,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=67381, - serialized_end=67773, + serialized_start=68727, + serialized_end=69119, ) @@ -17846,8 +18203,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=68205, - serialized_end=68258, + serialized_start=69551, + serialized_end=69604, ) _GETGROUPACTIONSIGNERSRESPONSE_GETGROUPACTIONSIGNERSRESPONSEV0_GROUPACTIONSIGNERS = _descriptor.Descriptor( @@ -17877,8 +18234,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=68261, - serialized_end=68406, + serialized_start=69607, + serialized_end=69752, ) _GETGROUPACTIONSIGNERSRESPONSE_GETGROUPACTIONSIGNERSRESPONSEV0 = _descriptor.Descriptor( @@ -17927,8 +18284,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=67914, - serialized_end=68416, + serialized_start=69260, + serialized_end=69762, ) _GETGROUPACTIONSIGNERSRESPONSE = _descriptor.Descriptor( @@ -17963,8 +18320,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=67776, - serialized_end=68427, + serialized_start=69122, + serialized_end=69773, ) @@ -18002,8 +18359,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=68543, - serialized_end=68600, + serialized_start=69889, + serialized_end=69946, ) _GETADDRESSINFOREQUEST = _descriptor.Descriptor( @@ -18038,8 +18395,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=68430, - serialized_end=68611, + serialized_start=69776, + serialized_end=69957, ) @@ -18082,8 +18439,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=68614, - serialized_end=68747, + serialized_start=69960, + serialized_end=70093, ) @@ -18121,8 +18478,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=68749, - serialized_end=68798, + serialized_start=70095, + serialized_end=70144, ) @@ -18153,8 +18510,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=68800, - serialized_end=68895, + serialized_start=70146, + serialized_end=70241, ) @@ -18204,8 +18561,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=68897, - serialized_end=69006, + serialized_start=70243, + serialized_end=70352, ) @@ -18243,8 +18600,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=69008, - serialized_end=69128, + serialized_start=70354, + serialized_end=70474, ) @@ -18275,8 +18632,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=69130, - serialized_end=69237, + serialized_start=70476, + serialized_end=70583, ) @@ -18326,8 +18683,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=69357, - serialized_end=69582, + serialized_start=70703, + serialized_end=70928, ) _GETADDRESSINFORESPONSE = _descriptor.Descriptor( @@ -18362,8 +18719,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=69240, - serialized_end=69593, + serialized_start=70586, + serialized_end=70939, ) @@ -18401,8 +18758,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=69718, - serialized_end=69780, + serialized_start=71064, + serialized_end=71126, ) _GETADDRESSESINFOSREQUEST = _descriptor.Descriptor( @@ -18437,8 +18794,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=69596, - serialized_end=69791, + serialized_start=70942, + serialized_end=71137, ) @@ -18488,8 +18845,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=69920, - serialized_end=70152, + serialized_start=71266, + serialized_end=71498, ) _GETADDRESSESINFOSRESPONSE = _descriptor.Descriptor( @@ -18524,8 +18881,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=69794, - serialized_end=70163, + serialized_start=71140, + serialized_end=71509, ) @@ -18549,8 +18906,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=70303, - serialized_end=70336, + serialized_start=71649, + serialized_end=71682, ) _GETADDRESSESTRUNKSTATEREQUEST = _descriptor.Descriptor( @@ -18585,8 +18942,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=70166, - serialized_end=70347, + serialized_start=71512, + serialized_end=71693, ) @@ -18624,8 +18981,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=70491, - serialized_end=70637, + serialized_start=71837, + serialized_end=71983, ) _GETADDRESSESTRUNKSTATERESPONSE = _descriptor.Descriptor( @@ -18660,8 +19017,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=70350, - serialized_end=70648, + serialized_start=71696, + serialized_end=71994, ) @@ -18706,8 +19063,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=70791, - serialized_end=70880, + serialized_start=72137, + serialized_end=72226, ) _GETADDRESSESBRANCHSTATEREQUEST = _descriptor.Descriptor( @@ -18742,8 +19099,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=70651, - serialized_end=70891, + serialized_start=71997, + serialized_end=72237, ) @@ -18774,8 +19131,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=71037, - serialized_end=71092, + serialized_start=72383, + serialized_end=72438, ) _GETADDRESSESBRANCHSTATERESPONSE = _descriptor.Descriptor( @@ -18810,8 +19167,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=70894, - serialized_end=71103, + serialized_start=72240, + serialized_end=72449, ) @@ -18856,8 +19213,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=71267, - serialized_end=71381, + serialized_start=72613, + serialized_end=72727, ) _GETRECENTADDRESSBALANCECHANGESREQUEST = _descriptor.Descriptor( @@ -18892,8 +19249,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=71106, - serialized_end=71392, + serialized_start=72452, + serialized_end=72738, ) @@ -18943,8 +19300,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=71560, - serialized_end=71824, + serialized_start=72906, + serialized_end=73170, ) _GETRECENTADDRESSBALANCECHANGESRESPONSE = _descriptor.Descriptor( @@ -18979,8 +19336,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=71395, - serialized_end=71835, + serialized_start=72741, + serialized_end=73181, ) @@ -19018,8 +19375,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=71837, - serialized_end=71908, + serialized_start=73183, + serialized_end=73254, ) @@ -19069,8 +19426,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=71911, - serialized_end=72087, + serialized_start=73257, + serialized_end=73433, ) @@ -19101,8 +19458,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=72089, - serialized_end=72181, + serialized_start=73435, + serialized_end=73527, ) @@ -19147,8 +19504,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=72184, - serialized_end=72358, + serialized_start=73530, + serialized_end=73704, ) @@ -19179,8 +19536,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=72361, - serialized_end=72496, + serialized_start=73707, + serialized_end=73842, ) @@ -19218,8 +19575,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=72688, - serialized_end=72785, + serialized_start=74034, + serialized_end=74131, ) _GETRECENTCOMPACTEDADDRESSBALANCECHANGESREQUEST = _descriptor.Descriptor( @@ -19254,8 +19611,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=72499, - serialized_end=72796, + serialized_start=73845, + serialized_end=74142, ) @@ -19305,8 +19662,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=72992, - serialized_end=73284, + serialized_start=74338, + serialized_end=74630, ) _GETRECENTCOMPACTEDADDRESSBALANCECHANGESRESPONSE = _descriptor.Descriptor( @@ -19341,8 +19698,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=72799, - serialized_end=73295, + serialized_start=74145, + serialized_end=74641, ) @@ -19387,8 +19744,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=73444, - serialized_end=73531, + serialized_start=74790, + serialized_end=74877, ) _GETSHIELDEDENCRYPTEDNOTESREQUEST = _descriptor.Descriptor( @@ -19423,8 +19780,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=73298, - serialized_end=73542, + serialized_start=74644, + serialized_end=74888, ) @@ -19476,8 +19833,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=73989, - serialized_end=74076, + serialized_start=75335, + serialized_end=75422, ) _GETSHIELDEDENCRYPTEDNOTESRESPONSE_GETSHIELDEDENCRYPTEDNOTESRESPONSEV0_ENCRYPTEDNOTES = _descriptor.Descriptor( @@ -19507,8 +19864,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=74079, - serialized_end=74224, + serialized_start=75425, + serialized_end=75570, ) _GETSHIELDEDENCRYPTEDNOTESRESPONSE_GETSHIELDEDENCRYPTEDNOTESRESPONSEV0 = _descriptor.Descriptor( @@ -19557,8 +19914,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=73695, - serialized_end=74234, + serialized_start=75041, + serialized_end=75580, ) _GETSHIELDEDENCRYPTEDNOTESRESPONSE = _descriptor.Descriptor( @@ -19593,8 +19950,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=73545, - serialized_end=74245, + serialized_start=74891, + serialized_end=75591, ) @@ -19625,8 +19982,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=74373, - serialized_end=74417, + serialized_start=75719, + serialized_end=75763, ) _GETSHIELDEDANCHORSREQUEST = _descriptor.Descriptor( @@ -19661,8 +20018,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=74248, - serialized_end=74428, + serialized_start=75594, + serialized_end=75774, ) @@ -19693,8 +20050,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=74817, - serialized_end=74843, + serialized_start=76163, + serialized_end=76189, ) _GETSHIELDEDANCHORSRESPONSE_GETSHIELDEDANCHORSRESPONSEV0 = _descriptor.Descriptor( @@ -19743,8 +20100,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=74560, - serialized_end=74853, + serialized_start=75906, + serialized_end=76199, ) _GETSHIELDEDANCHORSRESPONSE = _descriptor.Descriptor( @@ -19779,8 +20136,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=74431, - serialized_end=74864, + serialized_start=75777, + serialized_end=76210, ) @@ -19811,8 +20168,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=75019, - serialized_end=75072, + serialized_start=76365, + serialized_end=76418, ) _GETMOSTRECENTSHIELDEDANCHORREQUEST = _descriptor.Descriptor( @@ -19847,8 +20204,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=74867, - serialized_end=75083, + serialized_start=76213, + serialized_end=76429, ) @@ -19898,8 +20255,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=75242, - serialized_end=75423, + serialized_start=76588, + serialized_end=76769, ) _GETMOSTRECENTSHIELDEDANCHORRESPONSE = _descriptor.Descriptor( @@ -19934,8 +20291,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=75086, - serialized_end=75434, + serialized_start=76432, + serialized_end=76780, ) @@ -19966,8 +20323,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=75568, - serialized_end=75614, + serialized_start=76914, + serialized_end=76960, ) _GETSHIELDEDPOOLSTATEREQUEST = _descriptor.Descriptor( @@ -20002,8 +20359,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=75437, - serialized_end=75625, + serialized_start=76783, + serialized_end=76971, ) @@ -20053,8 +20410,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=75763, - serialized_end=75948, + serialized_start=77109, + serialized_end=77294, ) _GETSHIELDEDPOOLSTATERESPONSE = _descriptor.Descriptor( @@ -20089,8 +20446,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=75628, - serialized_end=75959, + serialized_start=76974, + serialized_end=77305, ) @@ -20121,8 +20478,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=76096, - serialized_end=76143, + serialized_start=77442, + serialized_end=77489, ) _GETSHIELDEDNOTESCOUNTREQUEST = _descriptor.Descriptor( @@ -20157,8 +20514,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=75962, - serialized_end=76154, + serialized_start=77308, + serialized_end=77500, ) @@ -20208,8 +20565,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=76295, - serialized_end=76485, + serialized_start=77641, + serialized_end=77831, ) _GETSHIELDEDNOTESCOUNTRESPONSE = _descriptor.Descriptor( @@ -20244,8 +20601,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=76157, - serialized_end=76496, + serialized_start=77503, + serialized_end=77842, ) @@ -20283,8 +20640,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=76633, - serialized_end=76700, + serialized_start=77979, + serialized_end=78046, ) _GETSHIELDEDNULLIFIERSREQUEST = _descriptor.Descriptor( @@ -20319,8 +20676,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=76499, - serialized_end=76711, + serialized_start=77845, + serialized_end=78057, ) @@ -20358,8 +20715,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=77140, - serialized_end=77194, + serialized_start=78486, + serialized_end=78540, ) _GETSHIELDEDNULLIFIERSRESPONSE_GETSHIELDEDNULLIFIERSRESPONSEV0_NULLIFIERSTATUSES = _descriptor.Descriptor( @@ -20389,8 +20746,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=77197, - serialized_end=77339, + serialized_start=78543, + serialized_end=78685, ) _GETSHIELDEDNULLIFIERSRESPONSE_GETSHIELDEDNULLIFIERSRESPONSEV0 = _descriptor.Descriptor( @@ -20439,8 +20796,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=76852, - serialized_end=77349, + serialized_start=78198, + serialized_end=78695, ) _GETSHIELDEDNULLIFIERSRESPONSE = _descriptor.Descriptor( @@ -20475,8 +20832,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=76714, - serialized_end=77360, + serialized_start=78060, + serialized_end=78706, ) _GETIDENTITYREQUEST_GETIDENTITYREQUESTV0.containing_type = _GETIDENTITYREQUEST @@ -20939,6 +21296,45 @@ _GETCONTRACTMODERATIONENTRIESRESPONSE.oneofs_by_name['version'].fields.append( _GETCONTRACTMODERATIONENTRIESRESPONSE.fields_by_name['v0']) _GETCONTRACTMODERATIONENTRIESRESPONSE.fields_by_name['v0'].containing_oneof = _GETCONTRACTMODERATIONENTRIESRESPONSE.oneofs_by_name['version'] +_GETCONTRACTDOCUMENTREMOVALSREQUEST_DOCUMENTIDS.containing_type = _GETCONTRACTDOCUMENTREMOVALSREQUEST +_GETCONTRACTDOCUMENTREMOVALSREQUEST_PAGE.containing_type = _GETCONTRACTDOCUMENTREMOVALSREQUEST +_GETCONTRACTDOCUMENTREMOVALSREQUEST_PAGE.oneofs_by_name['_start_after'].fields.append( + _GETCONTRACTDOCUMENTREMOVALSREQUEST_PAGE.fields_by_name['start_after']) +_GETCONTRACTDOCUMENTREMOVALSREQUEST_PAGE.fields_by_name['start_after'].containing_oneof = _GETCONTRACTDOCUMENTREMOVALSREQUEST_PAGE.oneofs_by_name['_start_after'] +_GETCONTRACTDOCUMENTREMOVALSREQUEST_PAGE.oneofs_by_name['_limit'].fields.append( + _GETCONTRACTDOCUMENTREMOVALSREQUEST_PAGE.fields_by_name['limit']) +_GETCONTRACTDOCUMENTREMOVALSREQUEST_PAGE.fields_by_name['limit'].containing_oneof = _GETCONTRACTDOCUMENTREMOVALSREQUEST_PAGE.oneofs_by_name['_limit'] +_GETCONTRACTDOCUMENTREMOVALSREQUEST_GETCONTRACTDOCUMENTREMOVALSREQUESTV0.fields_by_name['document_ids'].message_type = _GETCONTRACTDOCUMENTREMOVALSREQUEST_DOCUMENTIDS +_GETCONTRACTDOCUMENTREMOVALSREQUEST_GETCONTRACTDOCUMENTREMOVALSREQUESTV0.fields_by_name['page'].message_type = _GETCONTRACTDOCUMENTREMOVALSREQUEST_PAGE +_GETCONTRACTDOCUMENTREMOVALSREQUEST_GETCONTRACTDOCUMENTREMOVALSREQUESTV0.containing_type = _GETCONTRACTDOCUMENTREMOVALSREQUEST +_GETCONTRACTDOCUMENTREMOVALSREQUEST_GETCONTRACTDOCUMENTREMOVALSREQUESTV0.oneofs_by_name['selection'].fields.append( + _GETCONTRACTDOCUMENTREMOVALSREQUEST_GETCONTRACTDOCUMENTREMOVALSREQUESTV0.fields_by_name['document_ids']) +_GETCONTRACTDOCUMENTREMOVALSREQUEST_GETCONTRACTDOCUMENTREMOVALSREQUESTV0.fields_by_name['document_ids'].containing_oneof = _GETCONTRACTDOCUMENTREMOVALSREQUEST_GETCONTRACTDOCUMENTREMOVALSREQUESTV0.oneofs_by_name['selection'] +_GETCONTRACTDOCUMENTREMOVALSREQUEST_GETCONTRACTDOCUMENTREMOVALSREQUESTV0.oneofs_by_name['selection'].fields.append( + _GETCONTRACTDOCUMENTREMOVALSREQUEST_GETCONTRACTDOCUMENTREMOVALSREQUESTV0.fields_by_name['page']) +_GETCONTRACTDOCUMENTREMOVALSREQUEST_GETCONTRACTDOCUMENTREMOVALSREQUESTV0.fields_by_name['page'].containing_oneof = _GETCONTRACTDOCUMENTREMOVALSREQUEST_GETCONTRACTDOCUMENTREMOVALSREQUESTV0.oneofs_by_name['selection'] +_GETCONTRACTDOCUMENTREMOVALSREQUEST.fields_by_name['v0'].message_type = _GETCONTRACTDOCUMENTREMOVALSREQUEST_GETCONTRACTDOCUMENTREMOVALSREQUESTV0 +_GETCONTRACTDOCUMENTREMOVALSREQUEST.oneofs_by_name['version'].fields.append( + _GETCONTRACTDOCUMENTREMOVALSREQUEST.fields_by_name['v0']) +_GETCONTRACTDOCUMENTREMOVALSREQUEST.fields_by_name['v0'].containing_oneof = _GETCONTRACTDOCUMENTREMOVALSREQUEST.oneofs_by_name['version'] +_GETCONTRACTDOCUMENTREMOVALSRESPONSE_CONTRACTDOCUMENTREMOVAL.fields_by_name['reason'].message_type = _CONTRACTMODERATIONREASON +_GETCONTRACTDOCUMENTREMOVALSRESPONSE_CONTRACTDOCUMENTREMOVAL.containing_type = _GETCONTRACTDOCUMENTREMOVALSRESPONSE +_GETCONTRACTDOCUMENTREMOVALSRESPONSE_CONTRACTDOCUMENTREMOVALS.fields_by_name['removals'].message_type = _GETCONTRACTDOCUMENTREMOVALSRESPONSE_CONTRACTDOCUMENTREMOVAL +_GETCONTRACTDOCUMENTREMOVALSRESPONSE_CONTRACTDOCUMENTREMOVALS.containing_type = _GETCONTRACTDOCUMENTREMOVALSRESPONSE +_GETCONTRACTDOCUMENTREMOVALSRESPONSE_GETCONTRACTDOCUMENTREMOVALSRESPONSEV0.fields_by_name['removals'].message_type = _GETCONTRACTDOCUMENTREMOVALSRESPONSE_CONTRACTDOCUMENTREMOVALS +_GETCONTRACTDOCUMENTREMOVALSRESPONSE_GETCONTRACTDOCUMENTREMOVALSRESPONSEV0.fields_by_name['proof'].message_type = _PROOF +_GETCONTRACTDOCUMENTREMOVALSRESPONSE_GETCONTRACTDOCUMENTREMOVALSRESPONSEV0.fields_by_name['metadata'].message_type = _RESPONSEMETADATA +_GETCONTRACTDOCUMENTREMOVALSRESPONSE_GETCONTRACTDOCUMENTREMOVALSRESPONSEV0.containing_type = _GETCONTRACTDOCUMENTREMOVALSRESPONSE +_GETCONTRACTDOCUMENTREMOVALSRESPONSE_GETCONTRACTDOCUMENTREMOVALSRESPONSEV0.oneofs_by_name['result'].fields.append( + _GETCONTRACTDOCUMENTREMOVALSRESPONSE_GETCONTRACTDOCUMENTREMOVALSRESPONSEV0.fields_by_name['removals']) +_GETCONTRACTDOCUMENTREMOVALSRESPONSE_GETCONTRACTDOCUMENTREMOVALSRESPONSEV0.fields_by_name['removals'].containing_oneof = _GETCONTRACTDOCUMENTREMOVALSRESPONSE_GETCONTRACTDOCUMENTREMOVALSRESPONSEV0.oneofs_by_name['result'] +_GETCONTRACTDOCUMENTREMOVALSRESPONSE_GETCONTRACTDOCUMENTREMOVALSRESPONSEV0.oneofs_by_name['result'].fields.append( + _GETCONTRACTDOCUMENTREMOVALSRESPONSE_GETCONTRACTDOCUMENTREMOVALSRESPONSEV0.fields_by_name['proof']) +_GETCONTRACTDOCUMENTREMOVALSRESPONSE_GETCONTRACTDOCUMENTREMOVALSRESPONSEV0.fields_by_name['proof'].containing_oneof = _GETCONTRACTDOCUMENTREMOVALSRESPONSE_GETCONTRACTDOCUMENTREMOVALSRESPONSEV0.oneofs_by_name['result'] +_GETCONTRACTDOCUMENTREMOVALSRESPONSE.fields_by_name['v0'].message_type = _GETCONTRACTDOCUMENTREMOVALSRESPONSE_GETCONTRACTDOCUMENTREMOVALSRESPONSEV0 +_GETCONTRACTDOCUMENTREMOVALSRESPONSE.oneofs_by_name['version'].fields.append( + _GETCONTRACTDOCUMENTREMOVALSRESPONSE.fields_by_name['v0']) +_GETCONTRACTDOCUMENTREMOVALSRESPONSE.fields_by_name['v0'].containing_oneof = _GETCONTRACTDOCUMENTREMOVALSRESPONSE.oneofs_by_name['version'] _GETCONTRACTFEEPOTSREQUEST_GETCONTRACTFEEPOTSREQUESTV0.containing_type = _GETCONTRACTFEEPOTSREQUEST _GETCONTRACTFEEPOTSREQUEST.fields_by_name['v0'].message_type = _GETCONTRACTFEEPOTSREQUEST_GETCONTRACTFEEPOTSREQUESTV0 _GETCONTRACTFEEPOTSREQUEST.oneofs_by_name['version'].fields.append( @@ -22574,6 +22970,8 @@ DESCRIPTOR.message_types_by_name['GetContractModerationStatusResponse'] = _GETCONTRACTMODERATIONSTATUSRESPONSE DESCRIPTOR.message_types_by_name['GetContractModerationEntriesRequest'] = _GETCONTRACTMODERATIONENTRIESREQUEST DESCRIPTOR.message_types_by_name['GetContractModerationEntriesResponse'] = _GETCONTRACTMODERATIONENTRIESRESPONSE +DESCRIPTOR.message_types_by_name['GetContractDocumentRemovalsRequest'] = _GETCONTRACTDOCUMENTREMOVALSREQUEST +DESCRIPTOR.message_types_by_name['GetContractDocumentRemovalsResponse'] = _GETCONTRACTDOCUMENTREMOVALSRESPONSE DESCRIPTOR.message_types_by_name['GetContractFeePotsRequest'] = _GETCONTRACTFEEPOTSREQUEST DESCRIPTOR.message_types_by_name['GetContractFeePotsResponse'] = _GETCONTRACTFEEPOTSRESPONSE DESCRIPTOR.message_types_by_name['GetContractGroupsForContractRequest'] = _GETCONTRACTGROUPSFORCONTRACTREQUEST @@ -23476,6 +23874,68 @@ _sym_db.RegisterMessage(GetContractModerationEntriesResponse.ContractModerationEntries) _sym_db.RegisterMessage(GetContractModerationEntriesResponse.GetContractModerationEntriesResponseV0) +GetContractDocumentRemovalsRequest = _reflection.GeneratedProtocolMessageType('GetContractDocumentRemovalsRequest', (_message.Message,), { + + 'DocumentIds' : _reflection.GeneratedProtocolMessageType('DocumentIds', (_message.Message,), { + 'DESCRIPTOR' : _GETCONTRACTDOCUMENTREMOVALSREQUEST_DOCUMENTIDS, + '__module__' : 'platform_pb2' + # @@protoc_insertion_point(class_scope:org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.DocumentIds) + }) + , + + 'Page' : _reflection.GeneratedProtocolMessageType('Page', (_message.Message,), { + 'DESCRIPTOR' : _GETCONTRACTDOCUMENTREMOVALSREQUEST_PAGE, + '__module__' : 'platform_pb2' + # @@protoc_insertion_point(class_scope:org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.Page) + }) + , + + 'GetContractDocumentRemovalsRequestV0' : _reflection.GeneratedProtocolMessageType('GetContractDocumentRemovalsRequestV0', (_message.Message,), { + 'DESCRIPTOR' : _GETCONTRACTDOCUMENTREMOVALSREQUEST_GETCONTRACTDOCUMENTREMOVALSREQUESTV0, + '__module__' : 'platform_pb2' + # @@protoc_insertion_point(class_scope:org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0) + }) + , + 'DESCRIPTOR' : _GETCONTRACTDOCUMENTREMOVALSREQUEST, + '__module__' : 'platform_pb2' + # @@protoc_insertion_point(class_scope:org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest) + }) +_sym_db.RegisterMessage(GetContractDocumentRemovalsRequest) +_sym_db.RegisterMessage(GetContractDocumentRemovalsRequest.DocumentIds) +_sym_db.RegisterMessage(GetContractDocumentRemovalsRequest.Page) +_sym_db.RegisterMessage(GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0) + +GetContractDocumentRemovalsResponse = _reflection.GeneratedProtocolMessageType('GetContractDocumentRemovalsResponse', (_message.Message,), { + + 'ContractDocumentRemoval' : _reflection.GeneratedProtocolMessageType('ContractDocumentRemoval', (_message.Message,), { + 'DESCRIPTOR' : _GETCONTRACTDOCUMENTREMOVALSRESPONSE_CONTRACTDOCUMENTREMOVAL, + '__module__' : 'platform_pb2' + # @@protoc_insertion_point(class_scope:org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval) + }) + , + + 'ContractDocumentRemovals' : _reflection.GeneratedProtocolMessageType('ContractDocumentRemovals', (_message.Message,), { + 'DESCRIPTOR' : _GETCONTRACTDOCUMENTREMOVALSRESPONSE_CONTRACTDOCUMENTREMOVALS, + '__module__' : 'platform_pb2' + # @@protoc_insertion_point(class_scope:org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemovals) + }) + , + + 'GetContractDocumentRemovalsResponseV0' : _reflection.GeneratedProtocolMessageType('GetContractDocumentRemovalsResponseV0', (_message.Message,), { + 'DESCRIPTOR' : _GETCONTRACTDOCUMENTREMOVALSRESPONSE_GETCONTRACTDOCUMENTREMOVALSRESPONSEV0, + '__module__' : 'platform_pb2' + # @@protoc_insertion_point(class_scope:org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0) + }) + , + 'DESCRIPTOR' : _GETCONTRACTDOCUMENTREMOVALSRESPONSE, + '__module__' : 'platform_pb2' + # @@protoc_insertion_point(class_scope:org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse) + }) +_sym_db.RegisterMessage(GetContractDocumentRemovalsResponse) +_sym_db.RegisterMessage(GetContractDocumentRemovalsResponse.ContractDocumentRemoval) +_sym_db.RegisterMessage(GetContractDocumentRemovalsResponse.ContractDocumentRemovals) +_sym_db.RegisterMessage(GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0) + GetContractFeePotsRequest = _reflection.GeneratedProtocolMessageType('GetContractFeePotsRequest', (_message.Message,), { 'GetContractFeePotsRequestV0' : _reflection.GeneratedProtocolMessageType('GetContractFeePotsRequestV0', (_message.Message,), { @@ -26315,8 +26775,8 @@ index=0, serialized_options=None, create_key=_descriptor._internal_create_key, - serialized_start=77604, - serialized_end=87765, + serialized_start=78950, + serialized_end=89270, methods=[ _descriptor.MethodDescriptor( name='broadcastStateTransition', @@ -26538,10 +26998,20 @@ serialized_options=None, create_key=_descriptor._internal_create_key, ), + _descriptor.MethodDescriptor( + name='getContractDocumentRemovals', + full_name='org.dash.platform.dapi.v0.Platform.getContractDocumentRemovals', + index=22, + containing_service=None, + input_type=_GETCONTRACTDOCUMENTREMOVALSREQUEST, + output_type=_GETCONTRACTDOCUMENTREMOVALSRESPONSE, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), _descriptor.MethodDescriptor( name='getContractFeePots', full_name='org.dash.platform.dapi.v0.Platform.getContractFeePots', - index=22, + index=23, containing_service=None, input_type=_GETCONTRACTFEEPOTSREQUEST, output_type=_GETCONTRACTFEEPOTSRESPONSE, @@ -26551,7 +27021,7 @@ _descriptor.MethodDescriptor( name='getDocumentHistory', full_name='org.dash.platform.dapi.v0.Platform.getDocumentHistory', - index=23, + index=24, containing_service=None, input_type=_GETDOCUMENTHISTORYREQUEST, output_type=_GETDOCUMENTHISTORYRESPONSE, @@ -26561,7 +27031,7 @@ _descriptor.MethodDescriptor( name='getDocuments', full_name='org.dash.platform.dapi.v0.Platform.getDocuments', - index=24, + index=25, containing_service=None, input_type=_GETDOCUMENTSREQUEST, output_type=_GETDOCUMENTSRESPONSE, @@ -26571,7 +27041,7 @@ _descriptor.MethodDescriptor( name='getIdentityByPublicKeyHash', full_name='org.dash.platform.dapi.v0.Platform.getIdentityByPublicKeyHash', - index=25, + index=26, containing_service=None, input_type=_GETIDENTITYBYPUBLICKEYHASHREQUEST, output_type=_GETIDENTITYBYPUBLICKEYHASHRESPONSE, @@ -26581,7 +27051,7 @@ _descriptor.MethodDescriptor( name='getIdentityByNonUniquePublicKeyHash', full_name='org.dash.platform.dapi.v0.Platform.getIdentityByNonUniquePublicKeyHash', - index=26, + index=27, containing_service=None, input_type=_GETIDENTITYBYNONUNIQUEPUBLICKEYHASHREQUEST, output_type=_GETIDENTITYBYNONUNIQUEPUBLICKEYHASHRESPONSE, @@ -26591,7 +27061,7 @@ _descriptor.MethodDescriptor( name='waitForStateTransitionResult', full_name='org.dash.platform.dapi.v0.Platform.waitForStateTransitionResult', - index=27, + index=28, containing_service=None, input_type=_WAITFORSTATETRANSITIONRESULTREQUEST, output_type=_WAITFORSTATETRANSITIONRESULTRESPONSE, @@ -26601,7 +27071,7 @@ _descriptor.MethodDescriptor( name='getConsensusParams', full_name='org.dash.platform.dapi.v0.Platform.getConsensusParams', - index=28, + index=29, containing_service=None, input_type=_GETCONSENSUSPARAMSREQUEST, output_type=_GETCONSENSUSPARAMSRESPONSE, @@ -26611,7 +27081,7 @@ _descriptor.MethodDescriptor( name='getProtocolVersionUpgradeState', full_name='org.dash.platform.dapi.v0.Platform.getProtocolVersionUpgradeState', - index=29, + index=30, containing_service=None, input_type=_GETPROTOCOLVERSIONUPGRADESTATEREQUEST, output_type=_GETPROTOCOLVERSIONUPGRADESTATERESPONSE, @@ -26621,7 +27091,7 @@ _descriptor.MethodDescriptor( name='getProtocolVersionUpgradeVoteStatus', full_name='org.dash.platform.dapi.v0.Platform.getProtocolVersionUpgradeVoteStatus', - index=30, + index=31, containing_service=None, input_type=_GETPROTOCOLVERSIONUPGRADEVOTESTATUSREQUEST, output_type=_GETPROTOCOLVERSIONUPGRADEVOTESTATUSRESPONSE, @@ -26631,7 +27101,7 @@ _descriptor.MethodDescriptor( name='getEpochsInfo', full_name='org.dash.platform.dapi.v0.Platform.getEpochsInfo', - index=31, + index=32, containing_service=None, input_type=_GETEPOCHSINFOREQUEST, output_type=_GETEPOCHSINFORESPONSE, @@ -26641,7 +27111,7 @@ _descriptor.MethodDescriptor( name='getFinalizedEpochInfos', full_name='org.dash.platform.dapi.v0.Platform.getFinalizedEpochInfos', - index=32, + index=33, containing_service=None, input_type=_GETFINALIZEDEPOCHINFOSREQUEST, output_type=_GETFINALIZEDEPOCHINFOSRESPONSE, @@ -26651,7 +27121,7 @@ _descriptor.MethodDescriptor( name='getContestedResources', full_name='org.dash.platform.dapi.v0.Platform.getContestedResources', - index=33, + index=34, containing_service=None, input_type=_GETCONTESTEDRESOURCESREQUEST, output_type=_GETCONTESTEDRESOURCESRESPONSE, @@ -26661,7 +27131,7 @@ _descriptor.MethodDescriptor( name='getContestedResourceVoteState', full_name='org.dash.platform.dapi.v0.Platform.getContestedResourceVoteState', - index=34, + index=35, containing_service=None, input_type=_GETCONTESTEDRESOURCEVOTESTATEREQUEST, output_type=_GETCONTESTEDRESOURCEVOTESTATERESPONSE, @@ -26671,7 +27141,7 @@ _descriptor.MethodDescriptor( name='getContestedResourceVotersForIdentity', full_name='org.dash.platform.dapi.v0.Platform.getContestedResourceVotersForIdentity', - index=35, + index=36, containing_service=None, input_type=_GETCONTESTEDRESOURCEVOTERSFORIDENTITYREQUEST, output_type=_GETCONTESTEDRESOURCEVOTERSFORIDENTITYRESPONSE, @@ -26681,7 +27151,7 @@ _descriptor.MethodDescriptor( name='getContestedResourceIdentityVotes', full_name='org.dash.platform.dapi.v0.Platform.getContestedResourceIdentityVotes', - index=36, + index=37, containing_service=None, input_type=_GETCONTESTEDRESOURCEIDENTITYVOTESREQUEST, output_type=_GETCONTESTEDRESOURCEIDENTITYVOTESRESPONSE, @@ -26691,7 +27161,7 @@ _descriptor.MethodDescriptor( name='getVotePollsByEndDate', full_name='org.dash.platform.dapi.v0.Platform.getVotePollsByEndDate', - index=37, + index=38, containing_service=None, input_type=_GETVOTEPOLLSBYENDDATEREQUEST, output_type=_GETVOTEPOLLSBYENDDATERESPONSE, @@ -26701,7 +27171,7 @@ _descriptor.MethodDescriptor( name='getPrefundedSpecializedBalance', full_name='org.dash.platform.dapi.v0.Platform.getPrefundedSpecializedBalance', - index=38, + index=39, containing_service=None, input_type=_GETPREFUNDEDSPECIALIZEDBALANCEREQUEST, output_type=_GETPREFUNDEDSPECIALIZEDBALANCERESPONSE, @@ -26711,7 +27181,7 @@ _descriptor.MethodDescriptor( name='getTotalCreditsInPlatform', full_name='org.dash.platform.dapi.v0.Platform.getTotalCreditsInPlatform', - index=39, + index=40, containing_service=None, input_type=_GETTOTALCREDITSINPLATFORMREQUEST, output_type=_GETTOTALCREDITSINPLATFORMRESPONSE, @@ -26721,7 +27191,7 @@ _descriptor.MethodDescriptor( name='getPathElements', full_name='org.dash.platform.dapi.v0.Platform.getPathElements', - index=40, + index=41, containing_service=None, input_type=_GETPATHELEMENTSREQUEST, output_type=_GETPATHELEMENTSRESPONSE, @@ -26731,7 +27201,7 @@ _descriptor.MethodDescriptor( name='getStatus', full_name='org.dash.platform.dapi.v0.Platform.getStatus', - index=41, + index=42, containing_service=None, input_type=_GETSTATUSREQUEST, output_type=_GETSTATUSRESPONSE, @@ -26741,7 +27211,7 @@ _descriptor.MethodDescriptor( name='getCurrentQuorumsInfo', full_name='org.dash.platform.dapi.v0.Platform.getCurrentQuorumsInfo', - index=42, + index=43, containing_service=None, input_type=_GETCURRENTQUORUMSINFOREQUEST, output_type=_GETCURRENTQUORUMSINFORESPONSE, @@ -26751,7 +27221,7 @@ _descriptor.MethodDescriptor( name='getIdentityTokenBalances', full_name='org.dash.platform.dapi.v0.Platform.getIdentityTokenBalances', - index=43, + index=44, containing_service=None, input_type=_GETIDENTITYTOKENBALANCESREQUEST, output_type=_GETIDENTITYTOKENBALANCESRESPONSE, @@ -26761,7 +27231,7 @@ _descriptor.MethodDescriptor( name='getIdentitiesTokenBalances', full_name='org.dash.platform.dapi.v0.Platform.getIdentitiesTokenBalances', - index=44, + index=45, containing_service=None, input_type=_GETIDENTITIESTOKENBALANCESREQUEST, output_type=_GETIDENTITIESTOKENBALANCESRESPONSE, @@ -26771,7 +27241,7 @@ _descriptor.MethodDescriptor( name='getIdentityTokenInfos', full_name='org.dash.platform.dapi.v0.Platform.getIdentityTokenInfos', - index=45, + index=46, containing_service=None, input_type=_GETIDENTITYTOKENINFOSREQUEST, output_type=_GETIDENTITYTOKENINFOSRESPONSE, @@ -26781,7 +27251,7 @@ _descriptor.MethodDescriptor( name='getIdentitiesTokenInfos', full_name='org.dash.platform.dapi.v0.Platform.getIdentitiesTokenInfos', - index=46, + index=47, containing_service=None, input_type=_GETIDENTITIESTOKENINFOSREQUEST, output_type=_GETIDENTITIESTOKENINFOSRESPONSE, @@ -26791,7 +27261,7 @@ _descriptor.MethodDescriptor( name='getTokenStatuses', full_name='org.dash.platform.dapi.v0.Platform.getTokenStatuses', - index=47, + index=48, containing_service=None, input_type=_GETTOKENSTATUSESREQUEST, output_type=_GETTOKENSTATUSESRESPONSE, @@ -26801,7 +27271,7 @@ _descriptor.MethodDescriptor( name='getTokenDirectPurchasePrices', full_name='org.dash.platform.dapi.v0.Platform.getTokenDirectPurchasePrices', - index=48, + index=49, containing_service=None, input_type=_GETTOKENDIRECTPURCHASEPRICESREQUEST, output_type=_GETTOKENDIRECTPURCHASEPRICESRESPONSE, @@ -26811,7 +27281,7 @@ _descriptor.MethodDescriptor( name='getTokenContractInfo', full_name='org.dash.platform.dapi.v0.Platform.getTokenContractInfo', - index=49, + index=50, containing_service=None, input_type=_GETTOKENCONTRACTINFOREQUEST, output_type=_GETTOKENCONTRACTINFORESPONSE, @@ -26821,7 +27291,7 @@ _descriptor.MethodDescriptor( name='getTokenPreProgrammedDistributions', full_name='org.dash.platform.dapi.v0.Platform.getTokenPreProgrammedDistributions', - index=50, + index=51, containing_service=None, input_type=_GETTOKENPREPROGRAMMEDDISTRIBUTIONSREQUEST, output_type=_GETTOKENPREPROGRAMMEDDISTRIBUTIONSRESPONSE, @@ -26831,7 +27301,7 @@ _descriptor.MethodDescriptor( name='getTokenPerpetualDistributionLastClaim', full_name='org.dash.platform.dapi.v0.Platform.getTokenPerpetualDistributionLastClaim', - index=51, + index=52, containing_service=None, input_type=_GETTOKENPERPETUALDISTRIBUTIONLASTCLAIMREQUEST, output_type=_GETTOKENPERPETUALDISTRIBUTIONLASTCLAIMRESPONSE, @@ -26841,7 +27311,7 @@ _descriptor.MethodDescriptor( name='getTokenTotalSupply', full_name='org.dash.platform.dapi.v0.Platform.getTokenTotalSupply', - index=52, + index=53, containing_service=None, input_type=_GETTOKENTOTALSUPPLYREQUEST, output_type=_GETTOKENTOTALSUPPLYRESPONSE, @@ -26851,7 +27321,7 @@ _descriptor.MethodDescriptor( name='getGroupInfo', full_name='org.dash.platform.dapi.v0.Platform.getGroupInfo', - index=53, + index=54, containing_service=None, input_type=_GETGROUPINFOREQUEST, output_type=_GETGROUPINFORESPONSE, @@ -26861,7 +27331,7 @@ _descriptor.MethodDescriptor( name='getGroupInfos', full_name='org.dash.platform.dapi.v0.Platform.getGroupInfos', - index=54, + index=55, containing_service=None, input_type=_GETGROUPINFOSREQUEST, output_type=_GETGROUPINFOSRESPONSE, @@ -26871,7 +27341,7 @@ _descriptor.MethodDescriptor( name='getGroupActions', full_name='org.dash.platform.dapi.v0.Platform.getGroupActions', - index=55, + index=56, containing_service=None, input_type=_GETGROUPACTIONSREQUEST, output_type=_GETGROUPACTIONSRESPONSE, @@ -26881,7 +27351,7 @@ _descriptor.MethodDescriptor( name='getGroupActionSigners', full_name='org.dash.platform.dapi.v0.Platform.getGroupActionSigners', - index=56, + index=57, containing_service=None, input_type=_GETGROUPACTIONSIGNERSREQUEST, output_type=_GETGROUPACTIONSIGNERSRESPONSE, @@ -26891,7 +27361,7 @@ _descriptor.MethodDescriptor( name='getAddressInfo', full_name='org.dash.platform.dapi.v0.Platform.getAddressInfo', - index=57, + index=58, containing_service=None, input_type=_GETADDRESSINFOREQUEST, output_type=_GETADDRESSINFORESPONSE, @@ -26901,7 +27371,7 @@ _descriptor.MethodDescriptor( name='getAddressesInfos', full_name='org.dash.platform.dapi.v0.Platform.getAddressesInfos', - index=58, + index=59, containing_service=None, input_type=_GETADDRESSESINFOSREQUEST, output_type=_GETADDRESSESINFOSRESPONSE, @@ -26911,7 +27381,7 @@ _descriptor.MethodDescriptor( name='getAddressesTrunkState', full_name='org.dash.platform.dapi.v0.Platform.getAddressesTrunkState', - index=59, + index=60, containing_service=None, input_type=_GETADDRESSESTRUNKSTATEREQUEST, output_type=_GETADDRESSESTRUNKSTATERESPONSE, @@ -26921,7 +27391,7 @@ _descriptor.MethodDescriptor( name='getAddressesBranchState', full_name='org.dash.platform.dapi.v0.Platform.getAddressesBranchState', - index=60, + index=61, containing_service=None, input_type=_GETADDRESSESBRANCHSTATEREQUEST, output_type=_GETADDRESSESBRANCHSTATERESPONSE, @@ -26931,7 +27401,7 @@ _descriptor.MethodDescriptor( name='getRecentAddressBalanceChanges', full_name='org.dash.platform.dapi.v0.Platform.getRecentAddressBalanceChanges', - index=61, + index=62, containing_service=None, input_type=_GETRECENTADDRESSBALANCECHANGESREQUEST, output_type=_GETRECENTADDRESSBALANCECHANGESRESPONSE, @@ -26941,7 +27411,7 @@ _descriptor.MethodDescriptor( name='getRecentCompactedAddressBalanceChanges', full_name='org.dash.platform.dapi.v0.Platform.getRecentCompactedAddressBalanceChanges', - index=62, + index=63, containing_service=None, input_type=_GETRECENTCOMPACTEDADDRESSBALANCECHANGESREQUEST, output_type=_GETRECENTCOMPACTEDADDRESSBALANCECHANGESRESPONSE, @@ -26951,7 +27421,7 @@ _descriptor.MethodDescriptor( name='getShieldedEncryptedNotes', full_name='org.dash.platform.dapi.v0.Platform.getShieldedEncryptedNotes', - index=63, + index=64, containing_service=None, input_type=_GETSHIELDEDENCRYPTEDNOTESREQUEST, output_type=_GETSHIELDEDENCRYPTEDNOTESRESPONSE, @@ -26961,7 +27431,7 @@ _descriptor.MethodDescriptor( name='getShieldedAnchors', full_name='org.dash.platform.dapi.v0.Platform.getShieldedAnchors', - index=64, + index=65, containing_service=None, input_type=_GETSHIELDEDANCHORSREQUEST, output_type=_GETSHIELDEDANCHORSRESPONSE, @@ -26971,7 +27441,7 @@ _descriptor.MethodDescriptor( name='getMostRecentShieldedAnchor', full_name='org.dash.platform.dapi.v0.Platform.getMostRecentShieldedAnchor', - index=65, + index=66, containing_service=None, input_type=_GETMOSTRECENTSHIELDEDANCHORREQUEST, output_type=_GETMOSTRECENTSHIELDEDANCHORRESPONSE, @@ -26981,7 +27451,7 @@ _descriptor.MethodDescriptor( name='getShieldedPoolState', full_name='org.dash.platform.dapi.v0.Platform.getShieldedPoolState', - index=66, + index=67, containing_service=None, input_type=_GETSHIELDEDPOOLSTATEREQUEST, output_type=_GETSHIELDEDPOOLSTATERESPONSE, @@ -26991,7 +27461,7 @@ _descriptor.MethodDescriptor( name='getShieldedNotesCount', full_name='org.dash.platform.dapi.v0.Platform.getShieldedNotesCount', - index=67, + index=68, containing_service=None, input_type=_GETSHIELDEDNOTESCOUNTREQUEST, output_type=_GETSHIELDEDNOTESCOUNTRESPONSE, @@ -27001,7 +27471,7 @@ _descriptor.MethodDescriptor( name='getShieldedNullifiers', full_name='org.dash.platform.dapi.v0.Platform.getShieldedNullifiers', - index=68, + index=69, containing_service=None, input_type=_GETSHIELDEDNULLIFIERSREQUEST, output_type=_GETSHIELDEDNULLIFIERSRESPONSE, 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 c3b5319accd..4037342aaf2 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 @@ -124,6 +124,11 @@ def __init__(self, channel): request_serializer=platform__pb2.GetContractModerationEntriesRequest.SerializeToString, response_deserializer=platform__pb2.GetContractModerationEntriesResponse.FromString, ) + self.getContractDocumentRemovals = channel.unary_unary( + '/org.dash.platform.dapi.v0.Platform/getContractDocumentRemovals', + request_serializer=platform__pb2.GetContractDocumentRemovalsRequest.SerializeToString, + response_deserializer=platform__pb2.GetContractDocumentRemovalsResponse.FromString, + ) self.getContractFeePots = channel.unary_unary( '/org.dash.platform.dapi.v0.Platform/getContractFeePots', request_serializer=platform__pb2.GetContractFeePotsRequest.SerializeToString, @@ -497,6 +502,12 @@ def getContractModerationEntries(self, request, context): context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') + def getContractDocumentRemovals(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + def getContractFeePots(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) @@ -898,6 +909,11 @@ def add_PlatformServicer_to_server(servicer, server): request_deserializer=platform__pb2.GetContractModerationEntriesRequest.FromString, response_serializer=platform__pb2.GetContractModerationEntriesResponse.SerializeToString, ), + 'getContractDocumentRemovals': grpc.unary_unary_rpc_method_handler( + servicer.getContractDocumentRemovals, + request_deserializer=platform__pb2.GetContractDocumentRemovalsRequest.FromString, + response_serializer=platform__pb2.GetContractDocumentRemovalsResponse.SerializeToString, + ), 'getContractFeePots': grpc.unary_unary_rpc_method_handler( servicer.getContractFeePots, request_deserializer=platform__pb2.GetContractFeePotsRequest.FromString, @@ -1517,6 +1533,23 @@ def getContractModerationEntries(request, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + @staticmethod + def getContractDocumentRemovals(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/org.dash.platform.dapi.v0.Platform/getContractDocumentRemovals', + platform__pb2.GetContractDocumentRemovalsRequest.SerializeToString, + platform__pb2.GetContractDocumentRemovalsResponse.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + @staticmethod def getContractFeePots(request, target, diff --git a/packages/dapi-grpc/clients/platform/v0/web/platform_pb.d.ts b/packages/dapi-grpc/clients/platform/v0/web/platform_pb.d.ts index 87c066fe5a2..622498c4d27 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 @@ -3172,6 +3172,272 @@ export namespace GetContractModerationEntriesResponse { } } +export class GetContractDocumentRemovalsRequest extends jspb.Message { + hasV0(): boolean; + clearV0(): void; + getV0(): GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0 | undefined; + setV0(value?: GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0): void; + + getVersionCase(): GetContractDocumentRemovalsRequest.VersionCase; + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): GetContractDocumentRemovalsRequest.AsObject; + static toObject(includeInstance: boolean, msg: GetContractDocumentRemovalsRequest): GetContractDocumentRemovalsRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: GetContractDocumentRemovalsRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): GetContractDocumentRemovalsRequest; + static deserializeBinaryFromReader(message: GetContractDocumentRemovalsRequest, reader: jspb.BinaryReader): GetContractDocumentRemovalsRequest; +} + +export namespace GetContractDocumentRemovalsRequest { + export type AsObject = { + v0?: GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0.AsObject, + } + + export class DocumentIds extends jspb.Message { + clearDocumentIdsList(): void; + getDocumentIdsList(): Array; + getDocumentIdsList_asU8(): Array; + getDocumentIdsList_asB64(): Array; + setDocumentIdsList(value: Array): void; + addDocumentIds(value: Uint8Array | string, index?: number): Uint8Array | string; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): DocumentIds.AsObject; + static toObject(includeInstance: boolean, msg: DocumentIds): DocumentIds.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: DocumentIds, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): DocumentIds; + static deserializeBinaryFromReader(message: DocumentIds, reader: jspb.BinaryReader): DocumentIds; + } + + export namespace DocumentIds { + export type AsObject = { + documentIdsList: Array, + } + } + + export class Page extends jspb.Message { + hasStartAfter(): boolean; + clearStartAfter(): void; + getStartAfter(): Uint8Array | string; + getStartAfter_asU8(): Uint8Array; + getStartAfter_asB64(): string; + setStartAfter(value: Uint8Array | string): void; + + hasLimit(): boolean; + clearLimit(): void; + getLimit(): number; + setLimit(value: number): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): Page.AsObject; + static toObject(includeInstance: boolean, msg: Page): Page.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: Page, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): Page; + static deserializeBinaryFromReader(message: Page, reader: jspb.BinaryReader): Page; + } + + export namespace Page { + export type AsObject = { + startAfter: Uint8Array | string, + limit: number, + } + } + + export class GetContractDocumentRemovalsRequestV0 extends jspb.Message { + getContractId(): Uint8Array | string; + getContractId_asU8(): Uint8Array; + getContractId_asB64(): string; + setContractId(value: Uint8Array | string): void; + + getDocumentTypeName(): string; + setDocumentTypeName(value: string): void; + + hasDocumentIds(): boolean; + clearDocumentIds(): void; + getDocumentIds(): GetContractDocumentRemovalsRequest.DocumentIds | undefined; + setDocumentIds(value?: GetContractDocumentRemovalsRequest.DocumentIds): void; + + hasPage(): boolean; + clearPage(): void; + getPage(): GetContractDocumentRemovalsRequest.Page | undefined; + setPage(value?: GetContractDocumentRemovalsRequest.Page): void; + + getProve(): boolean; + setProve(value: boolean): void; + + getSelectionCase(): GetContractDocumentRemovalsRequestV0.SelectionCase; + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): GetContractDocumentRemovalsRequestV0.AsObject; + static toObject(includeInstance: boolean, msg: GetContractDocumentRemovalsRequestV0): GetContractDocumentRemovalsRequestV0.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: GetContractDocumentRemovalsRequestV0, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): GetContractDocumentRemovalsRequestV0; + static deserializeBinaryFromReader(message: GetContractDocumentRemovalsRequestV0, reader: jspb.BinaryReader): GetContractDocumentRemovalsRequestV0; + } + + export namespace GetContractDocumentRemovalsRequestV0 { + export type AsObject = { + contractId: Uint8Array | string, + documentTypeName: string, + documentIds?: GetContractDocumentRemovalsRequest.DocumentIds.AsObject, + page?: GetContractDocumentRemovalsRequest.Page.AsObject, + prove: boolean, + } + + export enum SelectionCase { + SELECTION_NOT_SET = 0, + DOCUMENT_IDS = 3, + PAGE = 4, + } + } + + export enum VersionCase { + VERSION_NOT_SET = 0, + V0 = 1, + } +} + +export class GetContractDocumentRemovalsResponse extends jspb.Message { + hasV0(): boolean; + clearV0(): void; + getV0(): GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0 | undefined; + setV0(value?: GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0): void; + + getVersionCase(): GetContractDocumentRemovalsResponse.VersionCase; + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): GetContractDocumentRemovalsResponse.AsObject; + static toObject(includeInstance: boolean, msg: GetContractDocumentRemovalsResponse): GetContractDocumentRemovalsResponse.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: GetContractDocumentRemovalsResponse, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): GetContractDocumentRemovalsResponse; + static deserializeBinaryFromReader(message: GetContractDocumentRemovalsResponse, reader: jspb.BinaryReader): GetContractDocumentRemovalsResponse; +} + +export namespace GetContractDocumentRemovalsResponse { + export type AsObject = { + v0?: GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0.AsObject, + } + + export class ContractDocumentRemoval extends jspb.Message { + getDocumentId(): Uint8Array | string; + getDocumentId_asU8(): Uint8Array; + getDocumentId_asB64(): string; + setDocumentId(value: Uint8Array | string): void; + + getDocumentOwnerId(): Uint8Array | string; + getDocumentOwnerId_asU8(): Uint8Array; + getDocumentOwnerId_asB64(): string; + setDocumentOwnerId(value: Uint8Array | string): void; + + getModeratorId(): Uint8Array | string; + getModeratorId_asU8(): Uint8Array; + getModeratorId_asB64(): string; + setModeratorId(value: Uint8Array | string): void; + + getRemovedAt(): number; + setRemovedAt(value: number): void; + + hasReason(): boolean; + clearReason(): void; + getReason(): ContractModerationReason | undefined; + setReason(value?: ContractModerationReason): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): ContractDocumentRemoval.AsObject; + static toObject(includeInstance: boolean, msg: ContractDocumentRemoval): ContractDocumentRemoval.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: ContractDocumentRemoval, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): ContractDocumentRemoval; + static deserializeBinaryFromReader(message: ContractDocumentRemoval, reader: jspb.BinaryReader): ContractDocumentRemoval; + } + + export namespace ContractDocumentRemoval { + export type AsObject = { + documentId: Uint8Array | string, + documentOwnerId: Uint8Array | string, + moderatorId: Uint8Array | string, + removedAt: number, + reason?: ContractModerationReason.AsObject, + } + } + + export class ContractDocumentRemovals extends jspb.Message { + clearRemovalsList(): void; + getRemovalsList(): Array; + setRemovalsList(value: Array): void; + addRemovals(value?: GetContractDocumentRemovalsResponse.ContractDocumentRemoval, index?: number): GetContractDocumentRemovalsResponse.ContractDocumentRemoval; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): ContractDocumentRemovals.AsObject; + static toObject(includeInstance: boolean, msg: ContractDocumentRemovals): ContractDocumentRemovals.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: ContractDocumentRemovals, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): ContractDocumentRemovals; + static deserializeBinaryFromReader(message: ContractDocumentRemovals, reader: jspb.BinaryReader): ContractDocumentRemovals; + } + + export namespace ContractDocumentRemovals { + export type AsObject = { + removalsList: Array, + } + } + + export class GetContractDocumentRemovalsResponseV0 extends jspb.Message { + hasRemovals(): boolean; + clearRemovals(): void; + getRemovals(): GetContractDocumentRemovalsResponse.ContractDocumentRemovals | undefined; + setRemovals(value?: GetContractDocumentRemovalsResponse.ContractDocumentRemovals): void; + + hasProof(): boolean; + clearProof(): void; + getProof(): Proof | undefined; + setProof(value?: Proof): void; + + hasMetadata(): boolean; + clearMetadata(): void; + getMetadata(): ResponseMetadata | undefined; + setMetadata(value?: ResponseMetadata): void; + + getResultCase(): GetContractDocumentRemovalsResponseV0.ResultCase; + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): GetContractDocumentRemovalsResponseV0.AsObject; + static toObject(includeInstance: boolean, msg: GetContractDocumentRemovalsResponseV0): GetContractDocumentRemovalsResponseV0.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: GetContractDocumentRemovalsResponseV0, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): GetContractDocumentRemovalsResponseV0; + static deserializeBinaryFromReader(message: GetContractDocumentRemovalsResponseV0, reader: jspb.BinaryReader): GetContractDocumentRemovalsResponseV0; + } + + export namespace GetContractDocumentRemovalsResponseV0 { + export type AsObject = { + removals?: GetContractDocumentRemovalsResponse.ContractDocumentRemovals.AsObject, + proof?: Proof.AsObject, + metadata?: ResponseMetadata.AsObject, + } + + export enum ResultCase { + RESULT_NOT_SET = 0, + REMOVALS = 1, + PROOF = 2, + } + } + + export enum VersionCase { + VERSION_NOT_SET = 0, + V0 = 1, + } +} + export class GetContractFeePotsRequest extends jspb.Message { hasV0(): boolean; clearV0(): void; diff --git a/packages/dapi-grpc/clients/platform/v0/web/platform_pb.js b/packages/dapi-grpc/clients/platform/v0/web/platform_pb.js index 532de357dde..150c073de43 100644 --- a/packages/dapi-grpc/clients/platform/v0/web/platform_pb.js +++ b/packages/dapi-grpc/clients/platform/v0/web/platform_pb.js @@ -118,6 +118,18 @@ goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetContestedResourcesResponse goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValues', null, { proto }); goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ResultCase', null, { proto }); goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetContestedResourcesResponse.VersionCase', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.DocumentIds', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0.SelectionCase', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.Page', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.VersionCase', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemovals', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0.ResultCase', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.VersionCase', null, { proto }); goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetContractFeePotsRequest', null, { proto }); goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetContractFeePotsRequest.GetContractFeePotsRequestV0', null, { proto }); goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetContractFeePotsRequest.VersionCase', null, { proto }); @@ -2858,6 +2870,174 @@ if (goog.DEBUG && !COMPILED) { */ proto.org.dash.platform.dapi.v0.GetContractModerationEntriesResponse.GetContractModerationEntriesResponseV0.displayName = 'proto.org.dash.platform.dapi.v0.GetContractModerationEntriesResponse.GetContractModerationEntriesResponseV0'; } +/** + * 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.GetContractDocumentRemovalsRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.oneofGroups_); +}; +goog.inherits(proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.displayName = 'proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest'; +} +/** + * 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.GetContractDocumentRemovalsRequest.DocumentIds = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.DocumentIds.repeatedFields_, null); +}; +goog.inherits(proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.DocumentIds, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.DocumentIds.displayName = 'proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.DocumentIds'; +} +/** + * 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.GetContractDocumentRemovalsRequest.Page = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.Page, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.Page.displayName = 'proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.Page'; +} +/** + * 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.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0 = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0.oneofGroups_); +}; +goog.inherits(proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0.displayName = 'proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0'; +} +/** + * 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.GetContractDocumentRemovalsResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.oneofGroups_); +}; +goog.inherits(proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.displayName = 'proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse'; +} +/** + * 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.GetContractDocumentRemovalsResponse.ContractDocumentRemoval = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval.displayName = 'proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval'; +} +/** + * 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.GetContractDocumentRemovalsResponse.ContractDocumentRemovals = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemovals.repeatedFields_, null); +}; +goog.inherits(proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemovals, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemovals.displayName = 'proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemovals'; +} +/** + * 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.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0 = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0.oneofGroups_); +}; +goog.inherits(proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0.displayName = 'proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0'; +} /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a @@ -32175,6 +32355,1882 @@ proto.org.dash.platform.dapi.v0.GetContractModerationEntriesResponse.prototype.h +/** + * 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.GetContractDocumentRemovalsRequest.oneofGroups_ = [[1]]; + +/** + * @enum {number} + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.VersionCase = { + VERSION_NOT_SET: 0, + V0: 1 +}; + +/** + * @return {proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.VersionCase} + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.prototype.getVersionCase = function() { + return /** @type {proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.VersionCase} */(jspb.Message.computeOneofCase(this, proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.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.GetContractDocumentRemovalsRequest.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.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.GetContractDocumentRemovalsRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.toObject = function(includeInstance, msg) { + var f, obj = { + v0: (f = msg.getV0()) && proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0.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.GetContractDocumentRemovalsRequest} + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest; + return proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.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.GetContractDocumentRemovalsRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest} + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.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.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0.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.GetContractDocumentRemovalsRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.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.GetContractDocumentRemovalsRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getV0(); + if (f != null) { + writer.writeMessage( + 1, + f, + proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0.serializeBinaryToWriter + ); + } +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.DocumentIds.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.GetContractDocumentRemovalsRequest.DocumentIds.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.DocumentIds.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.GetContractDocumentRemovalsRequest.DocumentIds} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.DocumentIds.toObject = function(includeInstance, msg) { + var f, obj = { + documentIdsList: msg.getDocumentIdsList_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.GetContractDocumentRemovalsRequest.DocumentIds} + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.DocumentIds.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.DocumentIds; + return proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.DocumentIds.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.GetContractDocumentRemovalsRequest.DocumentIds} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.DocumentIds} + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.DocumentIds.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.addDocumentIds(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.GetContractDocumentRemovalsRequest.DocumentIds.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.DocumentIds.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.GetContractDocumentRemovalsRequest.DocumentIds} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.DocumentIds.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getDocumentIdsList_asU8(); + if (f.length > 0) { + writer.writeRepeatedBytes( + 1, + f + ); + } +}; + + +/** + * repeated bytes document_ids = 1; + * @return {!Array} + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.DocumentIds.prototype.getDocumentIdsList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 1)); +}; + + +/** + * repeated bytes document_ids = 1; + * This is a type-conversion wrapper around `getDocumentIdsList()` + * @return {!Array} + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.DocumentIds.prototype.getDocumentIdsList_asB64 = function() { + return /** @type {!Array} */ (jspb.Message.bytesListAsB64( + this.getDocumentIdsList())); +}; + + +/** + * repeated bytes document_ids = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getDocumentIdsList()` + * @return {!Array} + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.DocumentIds.prototype.getDocumentIdsList_asU8 = function() { + return /** @type {!Array} */ (jspb.Message.bytesListAsU8( + this.getDocumentIdsList())); +}; + + +/** + * @param {!(Array|Array)} value + * @return {!proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.DocumentIds} returns this + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.DocumentIds.prototype.setDocumentIdsList = function(value) { + return jspb.Message.setField(this, 1, value || []); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @param {number=} opt_index + * @return {!proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.DocumentIds} returns this + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.DocumentIds.prototype.addDocumentIds = 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.GetContractDocumentRemovalsRequest.DocumentIds} returns this + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.DocumentIds.prototype.clearDocumentIdsList = function() { + return this.setDocumentIdsList([]); +}; + + + + + +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.GetContractDocumentRemovalsRequest.Page.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.Page.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.GetContractDocumentRemovalsRequest.Page} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.Page.toObject = function(includeInstance, msg) { + var f, obj = { + startAfter: msg.getStartAfter_asB64(), + limit: 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.GetContractDocumentRemovalsRequest.Page} + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.Page.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.Page; + return proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.Page.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.GetContractDocumentRemovalsRequest.Page} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.Page} + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.Page.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.setStartAfter(value); + break; + case 2: + var value = /** @type {number} */ (reader.readUint32()); + msg.setLimit(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.GetContractDocumentRemovalsRequest.Page.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.Page.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.GetContractDocumentRemovalsRequest.Page} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.Page.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = /** @type {!(string|Uint8Array)} */ (jspb.Message.getField(message, 1)); + if (f != null) { + writer.writeBytes( + 1, + f + ); + } + f = /** @type {number} */ (jspb.Message.getField(message, 2)); + if (f != null) { + writer.writeUint32( + 2, + f + ); + } +}; + + +/** + * optional bytes start_after = 1; + * @return {string} + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.Page.prototype.getStartAfter = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * optional bytes start_after = 1; + * This is a type-conversion wrapper around `getStartAfter()` + * @return {string} + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.Page.prototype.getStartAfter_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getStartAfter())); +}; + + +/** + * optional bytes start_after = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getStartAfter()` + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.Page.prototype.getStartAfter_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getStartAfter())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.Page} returns this + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.Page.prototype.setStartAfter = function(value) { + return jspb.Message.setField(this, 1, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.Page} returns this + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.Page.prototype.clearStartAfter = function() { + return jspb.Message.setField(this, 1, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.Page.prototype.hasStartAfter = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * optional uint32 limit = 2; + * @return {number} + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.Page.prototype.getLimit = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.Page} returns this + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.Page.prototype.setLimit = function(value) { + return jspb.Message.setField(this, 2, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.Page} returns this + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.Page.prototype.clearLimit = function() { + return jspb.Message.setField(this, 2, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.Page.prototype.hasLimit = function() { + return jspb.Message.getField(this, 2) != 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.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0.oneofGroups_ = [[3,4]]; + +/** + * @enum {number} + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0.SelectionCase = { + SELECTION_NOT_SET: 0, + DOCUMENT_IDS: 3, + PAGE: 4 +}; + +/** + * @return {proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0.SelectionCase} + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0.prototype.getSelectionCase = function() { + return /** @type {proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0.SelectionCase} */(jspb.Message.computeOneofCase(this, proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0.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.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0.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.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0.toObject = function(includeInstance, msg) { + var f, obj = { + contractId: msg.getContractId_asB64(), + documentTypeName: jspb.Message.getFieldWithDefault(msg, 2, ""), + documentIds: (f = msg.getDocumentIds()) && proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.DocumentIds.toObject(includeInstance, f), + page: (f = msg.getPage()) && proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.Page.toObject(includeInstance, f), + prove: jspb.Message.getBooleanFieldWithDefault(msg, 5, false) + }; + + 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.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0} + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0; + return proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0.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.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0} + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setContractId(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setDocumentTypeName(value); + break; + case 3: + var value = new proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.DocumentIds; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.DocumentIds.deserializeBinaryFromReader); + msg.setDocumentIds(value); + break; + case 4: + var value = new proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.Page; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.Page.deserializeBinaryFromReader); + msg.setPage(value); + break; + case 5: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setProve(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.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0.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.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getContractId_asU8(); + if (f.length > 0) { + writer.writeBytes( + 1, + f + ); + } + f = message.getDocumentTypeName(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getDocumentIds(); + if (f != null) { + writer.writeMessage( + 3, + f, + proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.DocumentIds.serializeBinaryToWriter + ); + } + f = message.getPage(); + if (f != null) { + writer.writeMessage( + 4, + f, + proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.Page.serializeBinaryToWriter + ); + } + f = message.getProve(); + if (f) { + writer.writeBool( + 5, + f + ); + } +}; + + +/** + * optional bytes contract_id = 1; + * @return {string} + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0.prototype.getContractId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * optional bytes contract_id = 1; + * This is a type-conversion wrapper around `getContractId()` + * @return {string} + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0.prototype.getContractId_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getContractId())); +}; + + +/** + * optional bytes contract_id = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getContractId()` + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0.prototype.getContractId_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getContractId())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0} returns this + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0.prototype.setContractId = function(value) { + return jspb.Message.setProto3BytesField(this, 1, value); +}; + + +/** + * optional string document_type_name = 2; + * @return {string} + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0.prototype.getDocumentTypeName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0} returns this + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0.prototype.setDocumentTypeName = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * optional DocumentIds document_ids = 3; + * @return {?proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.DocumentIds} + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0.prototype.getDocumentIds = function() { + return /** @type{?proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.DocumentIds} */ ( + jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.DocumentIds, 3)); +}; + + +/** + * @param {?proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.DocumentIds|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0} returns this +*/ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0.prototype.setDocumentIds = function(value) { + return jspb.Message.setOneofWrapperField(this, 3, proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0} returns this + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0.prototype.clearDocumentIds = function() { + return this.setDocumentIds(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0.prototype.hasDocumentIds = function() { + return jspb.Message.getField(this, 3) != null; +}; + + +/** + * optional Page page = 4; + * @return {?proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.Page} + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0.prototype.getPage = function() { + return /** @type{?proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.Page} */ ( + jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.Page, 4)); +}; + + +/** + * @param {?proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.Page|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0} returns this +*/ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0.prototype.setPage = function(value) { + return jspb.Message.setOneofWrapperField(this, 4, proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0} returns this + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0.prototype.clearPage = function() { + return this.setPage(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0.prototype.hasPage = function() { + return jspb.Message.getField(this, 4) != null; +}; + + +/** + * optional bool prove = 5; + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0.prototype.getProve = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 5, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0} returns this + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0.prototype.setProve = function(value) { + return jspb.Message.setProto3BooleanField(this, 5, value); +}; + + +/** + * optional GetContractDocumentRemovalsRequestV0 v0 = 1; + * @return {?proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0} + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.prototype.getV0 = function() { + return /** @type{?proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0} */ ( + jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0, 1)); +}; + + +/** + * @param {?proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.GetContractDocumentRemovalsRequestV0|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest} returns this +*/ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.prototype.setV0 = function(value) { + return jspb.Message.setOneofWrapperField(this, 1, proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest} returns this + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.prototype.clearV0 = function() { + return this.setV0(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsRequest.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.GetContractDocumentRemovalsResponse.oneofGroups_ = [[1]]; + +/** + * @enum {number} + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.VersionCase = { + VERSION_NOT_SET: 0, + V0: 1 +}; + +/** + * @return {proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.VersionCase} + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.prototype.getVersionCase = function() { + return /** @type {proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.VersionCase} */(jspb.Message.computeOneofCase(this, proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.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.GetContractDocumentRemovalsResponse.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.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.GetContractDocumentRemovalsResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.toObject = function(includeInstance, msg) { + var f, obj = { + v0: (f = msg.getV0()) && proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0.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.GetContractDocumentRemovalsResponse} + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse; + return proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.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.GetContractDocumentRemovalsResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse} + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.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.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0.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.GetContractDocumentRemovalsResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.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.GetContractDocumentRemovalsResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getV0(); + if (f != null) { + writer.writeMessage( + 1, + f, + proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0.serializeBinaryToWriter + ); + } +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval.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.GetContractDocumentRemovalsResponse.ContractDocumentRemoval} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval.toObject = function(includeInstance, msg) { + var f, obj = { + documentId: msg.getDocumentId_asB64(), + documentOwnerId: msg.getDocumentOwnerId_asB64(), + moderatorId: msg.getModeratorId_asB64(), + removedAt: jspb.Message.getFieldWithDefault(msg, 4, 0), + reason: (f = msg.getReason()) && proto.org.dash.platform.dapi.v0.ContractModerationReason.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.GetContractDocumentRemovalsResponse.ContractDocumentRemoval} + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval; + return proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval.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.GetContractDocumentRemovalsResponse.ContractDocumentRemoval} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval} + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval.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.setDocumentId(value); + break; + case 2: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setDocumentOwnerId(value); + break; + case 3: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setModeratorId(value); + break; + case 4: + var value = /** @type {number} */ (reader.readUint64()); + msg.setRemovedAt(value); + break; + case 5: + var value = new proto.org.dash.platform.dapi.v0.ContractModerationReason; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.ContractModerationReason.deserializeBinaryFromReader); + msg.setReason(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.GetContractDocumentRemovalsResponse.ContractDocumentRemoval.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval.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.GetContractDocumentRemovalsResponse.ContractDocumentRemoval} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getDocumentId_asU8(); + if (f.length > 0) { + writer.writeBytes( + 1, + f + ); + } + f = message.getDocumentOwnerId_asU8(); + if (f.length > 0) { + writer.writeBytes( + 2, + f + ); + } + f = message.getModeratorId_asU8(); + if (f.length > 0) { + writer.writeBytes( + 3, + f + ); + } + f = message.getRemovedAt(); + if (f !== 0) { + writer.writeUint64( + 4, + f + ); + } + f = message.getReason(); + if (f != null) { + writer.writeMessage( + 5, + f, + proto.org.dash.platform.dapi.v0.ContractModerationReason.serializeBinaryToWriter + ); + } +}; + + +/** + * optional bytes document_id = 1; + * @return {string} + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval.prototype.getDocumentId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * optional bytes document_id = 1; + * This is a type-conversion wrapper around `getDocumentId()` + * @return {string} + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval.prototype.getDocumentId_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getDocumentId())); +}; + + +/** + * optional bytes document_id = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getDocumentId()` + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval.prototype.getDocumentId_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getDocumentId())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval} returns this + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval.prototype.setDocumentId = function(value) { + return jspb.Message.setProto3BytesField(this, 1, value); +}; + + +/** + * optional bytes document_owner_id = 2; + * @return {string} + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval.prototype.getDocumentOwnerId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * optional bytes document_owner_id = 2; + * This is a type-conversion wrapper around `getDocumentOwnerId()` + * @return {string} + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval.prototype.getDocumentOwnerId_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getDocumentOwnerId())); +}; + + +/** + * optional bytes document_owner_id = 2; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getDocumentOwnerId()` + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval.prototype.getDocumentOwnerId_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getDocumentOwnerId())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval} returns this + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval.prototype.setDocumentOwnerId = function(value) { + return jspb.Message.setProto3BytesField(this, 2, value); +}; + + +/** + * optional bytes moderator_id = 3; + * @return {string} + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval.prototype.getModeratorId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * optional bytes moderator_id = 3; + * This is a type-conversion wrapper around `getModeratorId()` + * @return {string} + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval.prototype.getModeratorId_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getModeratorId())); +}; + + +/** + * optional bytes moderator_id = 3; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getModeratorId()` + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval.prototype.getModeratorId_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getModeratorId())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval} returns this + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval.prototype.setModeratorId = function(value) { + return jspb.Message.setProto3BytesField(this, 3, value); +}; + + +/** + * optional uint64 removed_at = 4; + * @return {number} + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval.prototype.getRemovedAt = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval} returns this + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval.prototype.setRemovedAt = function(value) { + return jspb.Message.setProto3IntField(this, 4, value); +}; + + +/** + * optional ContractModerationReason reason = 5; + * @return {?proto.org.dash.platform.dapi.v0.ContractModerationReason} + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval.prototype.getReason = function() { + return /** @type{?proto.org.dash.platform.dapi.v0.ContractModerationReason} */ ( + jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.ContractModerationReason, 5)); +}; + + +/** + * @param {?proto.org.dash.platform.dapi.v0.ContractModerationReason|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval} returns this +*/ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval.prototype.setReason = function(value) { + return jspb.Message.setWrapperField(this, 5, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval} returns this + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval.prototype.clearReason = function() { + return this.setReason(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval.prototype.hasReason = function() { + return jspb.Message.getField(this, 5) != null; +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemovals.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.GetContractDocumentRemovalsResponse.ContractDocumentRemovals.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemovals.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.GetContractDocumentRemovalsResponse.ContractDocumentRemovals} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemovals.toObject = function(includeInstance, msg) { + var f, obj = { + removalsList: jspb.Message.toObjectList(msg.getRemovalsList(), + proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval.toObject, includeInstance) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemovals} + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemovals.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemovals; + return proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemovals.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.GetContractDocumentRemovalsResponse.ContractDocumentRemovals} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemovals} + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemovals.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.GetContractDocumentRemovalsResponse.ContractDocumentRemoval; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval.deserializeBinaryFromReader); + msg.addRemovals(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.GetContractDocumentRemovalsResponse.ContractDocumentRemovals.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemovals.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.GetContractDocumentRemovalsResponse.ContractDocumentRemovals} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemovals.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getRemovalsList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 1, + f, + proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval.serializeBinaryToWriter + ); + } +}; + + +/** + * repeated ContractDocumentRemoval removals = 1; + * @return {!Array} + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemovals.prototype.getRemovalsList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval, 1)); +}; + + +/** + * @param {!Array} value + * @return {!proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemovals} returns this +*/ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemovals.prototype.setRemovalsList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 1, value); +}; + + +/** + * @param {!proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval=} opt_value + * @param {number=} opt_index + * @return {!proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval} + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemovals.prototype.addRemovals = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemoval, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemovals} returns this + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemovals.prototype.clearRemovalsList = function() { + return this.setRemovalsList([]); +}; + + + +/** + * 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.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0.oneofGroups_ = [[1,2]]; + +/** + * @enum {number} + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0.ResultCase = { + RESULT_NOT_SET: 0, + REMOVALS: 1, + PROOF: 2 +}; + +/** + * @return {proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0.ResultCase} + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0.prototype.getResultCase = function() { + return /** @type {proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0.ResultCase} */(jspb.Message.computeOneofCase(this, proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0.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.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0.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.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0.toObject = function(includeInstance, msg) { + var f, obj = { + removals: (f = msg.getRemovals()) && proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemovals.toObject(includeInstance, f), + proof: (f = msg.getProof()) && proto.org.dash.platform.dapi.v0.Proof.toObject(includeInstance, f), + metadata: (f = msg.getMetadata()) && proto.org.dash.platform.dapi.v0.ResponseMetadata.toObject(includeInstance, f) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0} + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0; + return proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0.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.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0} + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0.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.GetContractDocumentRemovalsResponse.ContractDocumentRemovals; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemovals.deserializeBinaryFromReader); + msg.setRemovals(value); + break; + case 2: + var value = new proto.org.dash.platform.dapi.v0.Proof; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.Proof.deserializeBinaryFromReader); + msg.setProof(value); + break; + case 3: + var value = new proto.org.dash.platform.dapi.v0.ResponseMetadata; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.ResponseMetadata.deserializeBinaryFromReader); + msg.setMetadata(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0.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.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getRemovals(); + if (f != null) { + writer.writeMessage( + 1, + f, + proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemovals.serializeBinaryToWriter + ); + } + f = message.getProof(); + if (f != null) { + writer.writeMessage( + 2, + f, + proto.org.dash.platform.dapi.v0.Proof.serializeBinaryToWriter + ); + } + f = message.getMetadata(); + if (f != null) { + writer.writeMessage( + 3, + f, + proto.org.dash.platform.dapi.v0.ResponseMetadata.serializeBinaryToWriter + ); + } +}; + + +/** + * optional ContractDocumentRemovals removals = 1; + * @return {?proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemovals} + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0.prototype.getRemovals = function() { + return /** @type{?proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemovals} */ ( + jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemovals, 1)); +}; + + +/** + * @param {?proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.ContractDocumentRemovals|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0} returns this +*/ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0.prototype.setRemovals = function(value) { + return jspb.Message.setOneofWrapperField(this, 1, proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0} returns this + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0.prototype.clearRemovals = function() { + return this.setRemovals(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0.prototype.hasRemovals = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * optional Proof proof = 2; + * @return {?proto.org.dash.platform.dapi.v0.Proof} + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0.prototype.getProof = function() { + return /** @type{?proto.org.dash.platform.dapi.v0.Proof} */ ( + jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.Proof, 2)); +}; + + +/** + * @param {?proto.org.dash.platform.dapi.v0.Proof|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0} returns this +*/ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0.prototype.setProof = function(value) { + return jspb.Message.setOneofWrapperField(this, 2, proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0} returns this + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0.prototype.clearProof = function() { + return this.setProof(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0.prototype.hasProof = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * optional ResponseMetadata metadata = 3; + * @return {?proto.org.dash.platform.dapi.v0.ResponseMetadata} + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0.prototype.getMetadata = function() { + return /** @type{?proto.org.dash.platform.dapi.v0.ResponseMetadata} */ ( + jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.ResponseMetadata, 3)); +}; + + +/** + * @param {?proto.org.dash.platform.dapi.v0.ResponseMetadata|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0} returns this +*/ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0.prototype.setMetadata = function(value) { + return jspb.Message.setWrapperField(this, 3, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0} returns this + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0.prototype.clearMetadata = function() { + return this.setMetadata(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0.prototype.hasMetadata = function() { + return jspb.Message.getField(this, 3) != null; +}; + + +/** + * optional GetContractDocumentRemovalsResponseV0 v0 = 1; + * @return {?proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0} + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.prototype.getV0 = function() { + return /** @type{?proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0} */ ( + jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0, 1)); +}; + + +/** + * @param {?proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.GetContractDocumentRemovalsResponseV0|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse} returns this +*/ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.prototype.setV0 = function(value) { + return jspb.Message.setOneofWrapperField(this, 1, proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse} returns this + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.prototype.clearV0 = function() { + return this.setV0(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.GetContractDocumentRemovalsResponse.prototype.hasV0 = function() { + return jspb.Message.getField(this, 1) != null; +}; + + + /** * Oneof group definitions for this message. Each group defines the field * numbers belonging to that group. When of these fields' value is set, all diff --git a/packages/dapi-grpc/clients/platform/v0/web/platform_pb_service.d.ts b/packages/dapi-grpc/clients/platform/v0/web/platform_pb_service.d.ts index 70819c2ed26..68c347264a5 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 @@ -202,6 +202,15 @@ type PlatformgetContractModerationEntries = { readonly responseType: typeof platform_pb.GetContractModerationEntriesResponse; }; +type PlatformgetContractDocumentRemovals = { + readonly methodName: string; + readonly service: typeof Platform; + readonly requestStream: false; + readonly responseStream: false; + readonly requestType: typeof platform_pb.GetContractDocumentRemovalsRequest; + readonly responseType: typeof platform_pb.GetContractDocumentRemovalsResponse; +}; + type PlatformgetContractFeePots = { readonly methodName: string; readonly service: typeof Platform; @@ -649,6 +658,7 @@ export class Platform { static readonly getContractGroupsForContract: PlatformgetContractGroupsForContract; static readonly getContractModerationStatus: PlatformgetContractModerationStatus; static readonly getContractModerationEntries: PlatformgetContractModerationEntries; + static readonly getContractDocumentRemovals: PlatformgetContractDocumentRemovals; static readonly getContractFeePots: PlatformgetContractFeePots; static readonly getDocumentHistory: PlatformgetDocumentHistory; static readonly getDocuments: PlatformgetDocuments; @@ -928,6 +938,15 @@ export class PlatformClient { requestMessage: platform_pb.GetContractModerationEntriesRequest, callback: (error: ServiceError|null, responseMessage: platform_pb.GetContractModerationEntriesResponse|null) => void ): UnaryResponse; + getContractDocumentRemovals( + requestMessage: platform_pb.GetContractDocumentRemovalsRequest, + metadata: grpc.Metadata, + callback: (error: ServiceError|null, responseMessage: platform_pb.GetContractDocumentRemovalsResponse|null) => void + ): UnaryResponse; + getContractDocumentRemovals( + requestMessage: platform_pb.GetContractDocumentRemovalsRequest, + callback: (error: ServiceError|null, responseMessage: platform_pb.GetContractDocumentRemovalsResponse|null) => void + ): UnaryResponse; getContractFeePots( requestMessage: platform_pb.GetContractFeePotsRequest, metadata: grpc.Metadata, diff --git a/packages/dapi-grpc/clients/platform/v0/web/platform_pb_service.js b/packages/dapi-grpc/clients/platform/v0/web/platform_pb_service.js index 6dd389d4e40..6c9ad777260 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 @@ -208,6 +208,15 @@ Platform.getContractModerationEntries = { responseType: platform_pb.GetContractModerationEntriesResponse }; +Platform.getContractDocumentRemovals = { + methodName: "getContractDocumentRemovals", + service: Platform, + requestStream: false, + responseStream: false, + requestType: platform_pb.GetContractDocumentRemovalsRequest, + responseType: platform_pb.GetContractDocumentRemovalsResponse +}; + Platform.getContractFeePots = { methodName: "getContractFeePots", service: Platform, @@ -1320,6 +1329,37 @@ PlatformClient.prototype.getContractModerationEntries = function getContractMode }; }; +PlatformClient.prototype.getContractDocumentRemovals = function getContractDocumentRemovals(requestMessage, metadata, callback) { + if (arguments.length === 2) { + callback = arguments[1]; + } + var client = grpc.unary(Platform.getContractDocumentRemovals, { + request: requestMessage, + host: this.serviceHost, + metadata: metadata, + transport: this.options.transport, + debug: this.options.debug, + onEnd: function (response) { + if (callback) { + if (response.status !== grpc.Code.OK) { + var err = new Error(response.statusMessage); + err.code = response.status; + err.metadata = response.trailers; + callback(err, null); + } else { + callback(null, response.message); + } + } + } + }); + return { + cancel: function () { + callback = null; + client.close(); + } + }; +}; + PlatformClient.prototype.getContractFeePots = function getContractFeePots(requestMessage, metadata, callback) { if (arguments.length === 2) { callback = arguments[1]; diff --git a/packages/dapi-grpc/protos/platform/v0/platform.proto b/packages/dapi-grpc/protos/platform/v0/platform.proto index 238b011b811..e8902229b8e 100644 --- a/packages/dapi-grpc/protos/platform/v0/platform.proto +++ b/packages/dapi-grpc/protos/platform/v0/platform.proto @@ -51,6 +51,8 @@ service Platform { returns (GetContractModerationStatusResponse); rpc getContractModerationEntries(GetContractModerationEntriesRequest) returns (GetContractModerationEntriesResponse); + rpc getContractDocumentRemovals(GetContractDocumentRemovalsRequest) + returns (GetContractDocumentRemovalsResponse); rpc getContractFeePots(GetContractFeePotsRequest) returns (GetContractFeePotsResponse); rpc getDocumentHistory(GetDocumentHistoryRequest) @@ -797,6 +799,63 @@ message GetContractModerationEntriesResponse { oneof version { GetContractModerationEntriesResponseV0 v0 = 1; } } +// The records of the documents a contract's moderators deleted, within one +// document type whose documents they may delete (`canBeDeletedByModerators`): +// the ones of the document ids named, or one page in document id order. +message GetContractDocumentRemovalsRequest { + message DocumentIds { + repeated bytes document_ids = + 1; // 32-byte document ids, from 1 to the protocol's + // max_returned_elements (100), none twice; an id with no record is + // left out of the response, and proved absent when a proof is asked + } + + message Page { + optional bytes start_after = + 1; // 32-byte document id; the page starts after it + optional uint32 limit = + 2; // Maximum number of records to return, from 1 to the protocol's + // max_returned_elements (100); absent means that maximum + } + + message GetContractDocumentRemovalsRequestV0 { + bytes contract_id = 1; // The 32-byte id of the moderated contract + string document_type_name = + 2; // The document type, which must let moderators delete its documents + oneof selection { + DocumentIds document_ids = 3; // The records of these documents + Page page = 4; // One page of the type's records + } + bool prove = 5; // Flag to request a proof as the response + } + oneof version { GetContractDocumentRemovalsRequestV0 v0 = 1; } +} + +message GetContractDocumentRemovalsResponse { + message ContractDocumentRemoval { + bytes document_id = 1; // The id the removed document had + bytes document_owner_id = 2; // The identity that owned it + bytes moderator_id = 3; // The contract owner or moderator that removed it + uint64 removed_at = + 4; // The time of the block that removed it, in milliseconds + ContractModerationReason reason = 5; // Why the moderator removed it + } + + message ContractDocumentRemovals { + repeated ContractDocumentRemoval removals = + 1; // The records, in document id order + } + + message GetContractDocumentRemovalsResponseV0 { + oneof result { + ContractDocumentRemovals removals = 1; // The records read + Proof proof = 2; // Cryptographic proof of the records, if requested + } + ResponseMetadata metadata = 3; // Metadata about the blockchain state + } + oneof version { GetContractDocumentRemovalsResponseV0 v0 = 1; } +} + message GetContractFeePotsRequest { message GetContractFeePotsRequestV0 { bytes contract_id = 1; // The 32-byte id of the data contract diff --git a/packages/dapi/doc/endpoints/index.md b/packages/dapi/doc/endpoints/index.md index d1a1f7ef926..9c8e1609ffb 100644 --- a/packages/dapi/doc/endpoints/index.md +++ b/packages/dapi/doc/endpoints/index.md @@ -62,6 +62,7 @@ The following endpoints are defined in the gRPC service but are served by Drive - `getContractGroupsForContract` - `getContractModerationStatus` - `getContractModerationEntries` +- `getContractDocumentRemovals` - `getContractFeePots` - `getIdentityByPublicKeyHash` - `getIdentitiesByPublicKeyHashes` diff --git a/packages/js-evo-sdk/src/contracts/facade.ts b/packages/js-evo-sdk/src/contracts/facade.ts index faa8fe1551b..8db220dc720 100644 --- a/packages/js-evo-sdk/src/contracts/facade.ts +++ b/packages/js-evo-sdk/src/contracts/facade.ts @@ -142,6 +142,20 @@ export class ContractsFacade { return w.contractUnsuspendUser(options); } + /** + * Deletes one document on a moderated contract as a moderator, whoever owns it, except the + * contract owner and the moderators. The document type must set `canBeDeletedByModerators`. + * Signed like the other moderations. `options.reason` is optional here: left out, no code and + * an empty text are stored. Resolves with the record the deletion left under the contract; + * the document's owner gets no storage refund. + */ + async moderatorDeleteDocument( + options: wasm.ContractDeleteDocumentOptions, + ): Promise { + const w = await this.sdk.getWasmSdkConnected(); + return w.contractDeleteDocument(options); + } + /** * One identity's status on a moderated contract: whether it is banned, and until when it is * suspended. Every list named must be one the contract keeps. @@ -174,6 +188,24 @@ export class ContractsFacade { return w.getContractModerationEntriesWithProofInfo(query); } + /** + * The records of the documents a contract's moderators deleted within one document type, in + * document id order: the records of the `documentIds` named, where a document with no record + * is left out, or else one page of them all. Pass a page's `nextStartAfter` as the next + * query's `startAfter`; a page without one (it holds fewer records than the limit) is the last. + */ + async documentRemovals(query: wasm.ContractDocumentRemovalsQuery): Promise { + const w = await this.sdk.getWasmSdkConnected(); + return w.getContractDocumentRemovals(query); + } + + async documentRemovalsWithProof( + query: wasm.ContractDocumentRemovalsQuery, + ): Promise> { + const w = await this.sdk.getWasmSdkConnected(); + return w.getContractDocumentRemovalsWithProofInfo(query); + } + /** * What the document action fees of a contract (the `actionFees` keyword, protocol version * 14) have collected for its owner and for its moderation team, and the last claim of each diff --git a/packages/js-evo-sdk/tests/unit/facades/contracts.spec.ts b/packages/js-evo-sdk/tests/unit/facades/contracts.spec.ts index 331b96c95d9..6726511a16e 100644 --- a/packages/js-evo-sdk/tests/unit/facades/contracts.spec.ts +++ b/packages/js-evo-sdk/tests/unit/facades/contracts.spec.ts @@ -325,6 +325,89 @@ describe('ContractsFacade', () => { expect(stub).to.be.calledOnceWithExactly(query); expect(result).to.equal(response); }); + + // A deletion names a document, not an identity, and resolves to the record it left. + const documentTypeName = 'post'; + const documentId = '2QjL594djCH2NyDsn45vd6yQjEDHupMKo7CEGVTHtQxU'; + const removal = { + documentOwnerId: identityId, + moderatorId: contractId, + reason: { code: 2, text: 'spam' }, + removedAt: BigInt(1800000000000), + }; + + it('should forward moderatorDeleteDocument() to contractDeleteDocument() and return the removal record', async function run() { + const record = { + contractId, documentTypeName, documentId, ...removal, + }; + const stub = this.sinon.stub(wasmSdk, 'contractDeleteDocument').resolves(record); + const options = { + identity: Object.create(wasmSDKPackage.Identity.prototype), + contractId, + documentTypeName, + documentId, + reason: { code: 2, text: 'spam' }, + signer, + }; + + const result = await client.contracts.moderatorDeleteDocument(options); + + expect(stub).to.be.calledOnceWithExactly(options); + expect(result).to.equal(record); + }); + + it('should delete a document without a reason', async function run() { + const record = { + contractId, documentTypeName, documentId, ...removal, reason: { text: '' }, + }; + const stub = this.sinon.stub(wasmSdk, 'contractDeleteDocument').resolves(record); + const options = { + identity: Object.create(wasmSDKPackage.Identity.prototype), + contractId, + documentTypeName, + documentId, + signer, + }; + + const result = await client.contracts.moderatorDeleteDocument(options); + + expect(stub).to.be.calledOnceWithExactly(options); + expect(result.reason).to.deep.equal({ text: '' }); + }); + + it('should fetch the removal records of the documents named, which carry no cursor', async function run() { + const page = { removals: [{ documentId, ...removal }] }; + const stub = this.sinon.stub(wasmSdk, 'getContractDocumentRemovals').resolves(page); + const query = { contractId, documentTypeName, documentIds: [documentId] }; + + const result = await client.contracts.documentRemovals(query); + + expect(stub).to.be.calledOnceWithExactly(query); + expect(result.removals).to.deep.equal(page.removals); + expect(result.nextStartAfter).to.equal(undefined); + }); + + it('should fetch a page of removal records and its cursor', async function run() { + const page = { removals: [{ documentId, ...removal }], nextStartAfter: documentId }; + const stub = this.sinon.stub(wasmSdk, 'getContractDocumentRemovals').resolves(page); + const query = { contractId, documentTypeName, limit: 1 }; + + const result = await client.contracts.documentRemovals(query); + + expect(stub).to.be.calledOnceWithExactly(query); + expect(result.nextStartAfter).to.equal(documentId); + }); + + it('should fetch removal records with proof', async function run() { + const response = { data: { removals: [] }, proof: {}, metadata: {} }; + const stub = this.sinon.stub(wasmSdk, 'getContractDocumentRemovalsWithProofInfo').resolves(response); + const query = { contractId, documentTypeName, startAfter: documentId }; + + const result = await client.contracts.documentRemovalsWithProof(query); + + expect(stub).to.be.calledOnceWithExactly(query); + expect(result).to.equal(response); + }); }); describe('contract fee pots', () => { diff --git a/packages/rs-dapi-client/src/transport/grpc.rs b/packages/rs-dapi-client/src/transport/grpc.rs index 6a1dd3bd5f1..7e419e9930b 100644 --- a/packages/rs-dapi-client/src/transport/grpc.rs +++ b/packages/rs-dapi-client/src/transport/grpc.rs @@ -321,6 +321,15 @@ impl_transport_request_grpc!( get_contract_moderation_entries ); +// rpc getContractDocumentRemovals(GetContractDocumentRemovalsRequest) returns (GetContractDocumentRemovalsResponse); +impl_transport_request_grpc!( + platform_proto::GetContractDocumentRemovalsRequest, + platform_proto::GetContractDocumentRemovalsResponse, + PlatformGrpcClient, + RequestSettings::default(), + get_contract_document_removals +); + // rpc getContractFeePots(GetContractFeePotsRequest) returns (GetContractFeePotsResponse); impl_transport_request_grpc!( platform_proto::GetContractFeePotsRequest, diff --git a/packages/rs-dapi/src/metrics.rs b/packages/rs-dapi/src/metrics.rs index 887be2be0fe..dbfed8ce324 100644 --- a/packages/rs-dapi/src/metrics.rs +++ b/packages/rs-dapi/src/metrics.rs @@ -565,6 +565,7 @@ fn known_grpc_endpoint(path: &str) -> &'static str { "getContractGroupsForContract", "getContractModerationStatus", "getContractModerationEntries", + "getContractDocumentRemovals", "getContractFeePots", "getDataContracts", "getDataContractsByRange", diff --git a/packages/rs-dapi/src/services/platform_service/mod.rs b/packages/rs-dapi/src/services/platform_service/mod.rs index beb9dfbb4d9..dba80bf72f3 100644 --- a/packages/rs-dapi/src/services/platform_service/mod.rs +++ b/packages/rs-dapi/src/services/platform_service/mod.rs @@ -430,6 +430,12 @@ impl Platform for PlatformServiceImpl { dapi_grpc::platform::v0::GetContractModerationEntriesResponse ); + drive_method!( + get_contract_document_removals, + dapi_grpc::platform::v0::GetContractDocumentRemovalsRequest, + dapi_grpc::platform::v0::GetContractDocumentRemovalsResponse + ); + drive_method!( get_contract_fee_pots, dapi_grpc::platform::v0::GetContractFeePotsRequest, diff --git a/packages/rs-dpp/schema/meta_schemas/document/v3/document-meta.json b/packages/rs-dpp/schema/meta_schemas/document/v3/document-meta.json index 4ed150edb59..526044fc830 100644 --- a/packages/rs-dpp/schema/meta_schemas/document/v3/document-meta.json +++ b/packages/rs-dpp/schema/meta_schemas/document/v3/document-meta.json @@ -889,6 +889,10 @@ "type": "boolean", "description": "Syntactic sugar: `rangeAverageable: true` is shorthand for `rangeCountable: true` + `rangeSummable: true`. Requires `documentsAverageable` to be set. Same caveat as `rangeSummable` — rarely useful on the primary key; per-index `rangeAverageable` is what most callers want." }, + "canBeDeletedByModerators": { + "type": "boolean", + "description": "When true, the contract's moderators (its owner and the identities its moderation config appoints) may delete documents of this type with a contract user moderation transition, leaving a removal record under the contract. Independent of `canBeDeleted`, which rules what a document's own owner may do. Requires the contract to declare `moderation` in its config, and is refused on a type that keeps history, is indexOnly, or restricts document creation. Fixed when the document type is created. A type carrying it can not be the target of a permanentDocument reference. Available from protocol version 14." + }, "indexOnly": { "type": "boolean", "description": "When true, documents of this type are never written to primary storage: the index entries are the rows, each terminating in an Item keyed by the index's `terminal` property instead of a Reference keyed by the document id. Only what is in the indexes exists and is recoverable. Requires: every property required and appearing in at least one index (except a `skipIfAbsent` index's optional first property), $ownerId in at least one index (as a property or terminal), documentsMutable: false, no transfers/trading/history/transient properties, and no doctype-level aggregate keywords (use the index-level count flags). Available from protocol version 14." diff --git a/packages/rs-dpp/src/data_contract/config/moderation/document_removal.rs b/packages/rs-dpp/src/data_contract/config/moderation/document_removal.rs new file mode 100644 index 00000000000..7f628d7ee89 --- /dev/null +++ b/packages/rs-dpp/src/data_contract/config/moderation/document_removal.rs @@ -0,0 +1,28 @@ +use crate::data_contract::config::moderation::ContractModerationReason; +use crate::identity::TimestampMillis; +use bincode::{Decode, DecodeUntrusted, Encode}; +use platform_value::Identifier; +use serde::{Deserialize, Serialize}; + +/// The record a contract keeps of a document one of its moderators deleted. +/// +/// The document itself is gone; this is what is left to say that it was removed, not lost: +/// whose it was, who removed it, why and when. It is stored under the contract, by document +/// type then document id, paid for by the moderator, and never deleted. It is final: a +/// document id commits to the nonce of its create transition and is produced at most once, so +/// the removed id can not be created again and no second removal can replace the record. +#[derive( + Debug, Clone, PartialEq, Eq, Default, Encode, Decode, DecodeUntrusted, Serialize, Deserialize, +)] +#[serde(rename_all = "camelCase")] +pub struct ContractDocumentRemoval { + /// The identity that owned the document when it was removed. + pub document_owner_id: Identifier, + /// The contract owner or moderator that removed it. + pub moderator_id: Identifier, + /// Why the moderator removed it. The code is a number the moderator sets and nothing + /// checks; the text may be empty. + pub reason: ContractModerationReason, + /// The time of the block that removed it, in milliseconds. + pub removed_at: TimestampMillis, +} diff --git a/packages/rs-dpp/src/data_contract/config/moderation/mod.rs b/packages/rs-dpp/src/data_contract/config/moderation/mod.rs index 5b4056fc661..6c2539cd5ea 100644 --- a/packages/rs-dpp/src/data_contract/config/moderation/mod.rs +++ b/packages/rs-dpp/src/data_contract/config/moderation/mod.rs @@ -6,6 +6,10 @@ //! the contract is refused. Token transitions are not affected. The lists live under the //! contract's own subtree in Drive (keys `128` and `192` of its other tree, `[64, id, 2]`) and are edited by the //! `ContractUserModeration` state transition. +//! +//! The same moderators may delete the documents of the document types that say so +//! (`canBeDeletedByModerators`), with the same transition. Each removal leaves a +//! [`ContractDocumentRemoval`] under the contract (key `16` of its other tree). use crate::consensus::basic::contract_moderation::InvalidContractModerationConfigError; use crate::identity::TimestampMillis; @@ -20,7 +24,9 @@ use serde::{Deserialize, Serialize}; use std::collections::BTreeSet; use std::fmt; +mod document_removal; mod reason; +pub use document_removal::ContractDocumentRemoval; pub use reason::ContractModerationReason; /// Who may send a `ContractUserModeration` transition for the contract. @@ -259,13 +265,17 @@ impl ContractModerationConfig { self.moderators.team(owner_id) } - /// The pure-data rules of the declaration: at least one list is kept, and a moderator set - /// is non-empty and within `SystemLimits::max_contract_moderators` (a named owner counts). + /// The pure-data rules of the declaration: it gives the moderators something to do, and a + /// moderator set is non-empty and within `SystemLimits::max_contract_moderators` (a named + /// owner counts). Something to do is a list to edit or, failing that, a document type whose + /// documents they may delete (`has_document_type_deletable_by_moderators`, which the + /// caller reads from the contract the declaration belongs to). /// Whether the named identities exist is state validation, done by the contract create /// and update transitions: a moderator that does not exist can never sign, so naming one /// is a mistake, caught where it is cheapest. pub fn validate( &self, + has_document_type_deletable_by_moderators: bool, platform_version: &PlatformVersion, ) -> Result { match platform_version @@ -274,7 +284,7 @@ impl ContractModerationConfig { .methods .validate_moderation_config { - 0 => Ok(self.validate_v0(platform_version)), + 0 => Ok(self.validate_v0(has_document_type_deletable_by_moderators, platform_version)), version => Err(ProtocolError::UnknownVersionMismatch { method: "ContractModerationConfig::validate".to_string(), known_versions: vec![0], @@ -284,11 +294,17 @@ impl ContractModerationConfig { } #[inline(always)] - fn validate_v0(&self, platform_version: &PlatformVersion) -> SimpleConsensusValidationResult { - if !self.banlist && !self.suspensions { + fn validate_v0( + &self, + has_document_type_deletable_by_moderators: bool, + platform_version: &PlatformVersion, + ) -> SimpleConsensusValidationResult { + if !self.banlist && !self.suspensions && !has_document_type_deletable_by_moderators { return SimpleConsensusValidationResult::new_with_error( InvalidContractModerationConfigError::new( - "moderation declares neither a banlist nor a suspension list".to_string(), + "moderation declares neither a banlist nor a suspension list, and no \ + document type can be deleted by moderators" + .to_string(), ) .into(), ); @@ -551,11 +567,25 @@ mod tests { moderators: ContractModerators::ContractOwner, }; let result = config - .validate(PlatformVersion::latest()) + .validate(false, PlatformVersion::latest()) .expect("validate"); assert!(!result.is_valid()); } + #[test] + fn should_accept_a_config_with_no_list_when_a_document_type_can_be_deleted_by_moderators() { + let config = ContractModerationConfig { + banlist: false, + suspensions: false, + moderators: ContractModerators::ContractOwner, + }; + let result = config + .validate(true, PlatformVersion::latest()) + .expect("validate"); + assert!(result.is_valid(), "{:?}", result.errors); + assert_eq!(config.lists().count(), 0); + } + #[test] fn should_accept_the_owner_among_the_moderators() { let owner = Identifier::from([9; 32]); @@ -565,7 +595,7 @@ mod tests { moderators: ContractModerators::AppointedModerators(set(&[9, 1])), }; let result = config - .validate(PlatformVersion::latest()) + .validate(false, PlatformVersion::latest()) .expect("validate"); assert!(result.is_valid(), "{:?}", result.errors); // Naming the owner changes nothing about who may moderate or who is protected. @@ -585,11 +615,11 @@ mod tests { )), }; assert!(config(max) - .validate(platform_version) + .validate(false, platform_version) .expect("validate") .is_valid()); assert!(!config(max + 1) - .validate(platform_version) + .validate(false, platform_version) .expect("validate") .is_valid()); } @@ -603,7 +633,7 @@ mod tests { moderators: ContractModerators::AppointedModerators(BTreeSet::new()), }; assert!(!empty - .validate(platform_version) + .validate(false, platform_version) .expect("validate") .is_valid()); let too_many: Vec = @@ -614,7 +644,7 @@ mod tests { moderators: ContractModerators::AppointedModerators(set(&too_many)), }; assert!(!oversized - .validate(platform_version) + .validate(false, platform_version) .expect("validate") .is_valid()); } @@ -628,7 +658,7 @@ mod tests { moderators: ContractModerators::AppointedModerators(set(&[1, 2, 3])), }; assert!(config - .validate(PlatformVersion::latest()) + .validate(false, PlatformVersion::latest()) .expect("validate") .is_valid()); assert!(config.may_moderate(&owner, &owner)); diff --git a/packages/rs-dpp/src/data_contract/document_type/accessors/mod.rs b/packages/rs-dpp/src/data_contract/document_type/accessors/mod.rs index b7aa6a4d6a3..18a33b9046a 100644 --- a/packages/rs-dpp/src/data_contract/document_type/accessors/mod.rs +++ b/packages/rs-dpp/src/data_contract/document_type/accessors/mod.rs @@ -987,6 +987,14 @@ impl DocumentTypeV2Getters for DocumentType { } } + fn documents_can_be_deleted_by_moderators(&self) -> bool { + match self { + DocumentType::V0(_) => false, + DocumentType::V1(_) => false, + DocumentType::V2(v2) => v2.documents_can_be_deleted_by_moderators(), + } + } + fn immutable_fields(&self) -> &BTreeSet { match self { DocumentType::V0(_) => &NO_IMMUTABLE_FIELDS, @@ -1087,6 +1095,14 @@ impl DocumentTypeV2Getters for DocumentTypeRef<'_> { } } + fn documents_can_be_deleted_by_moderators(&self) -> bool { + match self { + DocumentTypeRef::V0(_) => false, + DocumentTypeRef::V1(_) => false, + DocumentTypeRef::V2(v2) => v2.documents_can_be_deleted_by_moderators(), + } + } + fn immutable_fields(&self) -> &BTreeSet { match self { DocumentTypeRef::V0(_) => &NO_IMMUTABLE_FIELDS, @@ -1153,6 +1169,14 @@ impl DocumentTypeV2Getters for DocumentTypeMutRef<'_> { } } + fn documents_can_be_deleted_by_moderators(&self) -> bool { + match self { + DocumentTypeMutRef::V0(_) => false, + DocumentTypeMutRef::V1(_) => false, + DocumentTypeMutRef::V2(v2) => v2.documents_can_be_deleted_by_moderators(), + } + } + fn immutable_fields(&self) -> &BTreeSet { match self { DocumentTypeMutRef::V0(_) => &NO_IMMUTABLE_FIELDS, diff --git a/packages/rs-dpp/src/data_contract/document_type/accessors/v2/mod.rs b/packages/rs-dpp/src/data_contract/document_type/accessors/v2/mod.rs index 463bbdf0f0e..cf30288af2a 100644 --- a/packages/rs-dpp/src/data_contract/document_type/accessors/v2/mod.rs +++ b/packages/rs-dpp/src/data_contract/document_type/accessors/v2/mod.rs @@ -34,6 +34,12 @@ pub trait DocumentTypeV2Getters { /// property. Only what is in the indexes exists and is recoverable. fn index_only(&self) -> bool; + /// Returns whether the contract's moderators may delete documents of this + /// type (the `canBeDeletedByModerators` keyword, protocol version 14). + /// Independent of `documents_can_be_deleted`, which rules what a document's + /// own owner may do. False on document types that predate the keyword. + fn documents_can_be_deleted_by_moderators(&self) -> bool; + /// The top-level properties frozen at document creation on a mutable /// document type (the `immutable` keyword, protocol version 14). A /// replace that changes, adds or removes any of them is rejected with diff --git a/packages/rs-dpp/src/data_contract/document_type/class_methods/try_from_schema/common/mod.rs b/packages/rs-dpp/src/data_contract/document_type/class_methods/try_from_schema/common/mod.rs index 0e34f481961..86176090ae8 100644 --- a/packages/rs-dpp/src/data_contract/document_type/class_methods/try_from_schema/common/mod.rs +++ b/packages/rs-dpp/src/data_contract/document_type/class_methods/try_from_schema/common/mod.rs @@ -19,6 +19,7 @@ //! generation 2 (schema 1 and 2). use crate::data_contract::config::v0::DataContractConfigGettersV0; +use crate::data_contract::config::v2::DataContractConfigGettersV2; use crate::data_contract::config::DataContractConfig; use crate::data_contract::document_type::class_methods::consensus_or_protocol_value_error; use crate::data_contract::document_type::index::Index; @@ -26,8 +27,8 @@ use crate::data_contract::document_type::index_level::IndexLevel; use crate::data_contract::document_type::property::DocumentProperty; use crate::data_contract::document_type::property::DocumentPropertyType; use crate::data_contract::document_type::property_names::{ - CAN_BE_DELETED, CREATION_RESTRICTION_MODE, DOCUMENTS_AVERAGEABLE, DOCUMENTS_COUNTABLE, - DOCUMENTS_KEEP_HISTORY, DOCUMENTS_MUTABLE, DOCUMENTS_SUMMABLE, INDEX_ONLY, + CAN_BE_DELETED, CAN_BE_DELETED_BY_MODERATORS, CREATION_RESTRICTION_MODE, DOCUMENTS_AVERAGEABLE, + DOCUMENTS_COUNTABLE, DOCUMENTS_KEEP_HISTORY, DOCUMENTS_MUTABLE, DOCUMENTS_SUMMABLE, INDEX_ONLY, KEEPS_PRICING_HISTORY, KEEPS_PURCHASE_HISTORY, KEEPS_TRANSFER_HISTORY, RANGE_AVERAGEABLE, RANGE_COUNTABLE, RANGE_SUMMABLE, TRADE_MODE, TRANSFERABLE, }; @@ -1978,6 +1979,91 @@ pub(super) fn parse_index_only_keyword(schema: &Value) -> Result Result { + let schema_map_opt = schema.to_map().ok(); + + Ok(schema_map_opt + .as_ref() + .and_then(|schema_map| { + Value::inner_optional_bool_value(schema_map, CAN_BE_DELETED_BY_MODERATORS) + .map_err(consensus_or_protocol_value_error) + .transpose() + }) + .transpose()? + .unwrap_or(false)) +} + +/// Applies the `canBeDeletedByModerators` flag and checks what it requires. +/// +/// The flag lets the contract's moderators delete documents of the type, so: +/// - the contract must declare moderation, or there would be nobody to delete +/// anything (moderation can not be switched on by a later update); +/// - the type must not keep history: Drive refuses to delete such documents; +/// - the type must not be indexOnly: such a document has no stored row a +/// moderator could name by id; +/// - the type must not restrict creation: its documents are the contract +/// owner's, which no moderator may delete. +/// +/// The rules hold for every contract that could be stored (the keyword and +/// the moderation config both arrive with protocol version 14), so they are +/// not skipped when a stored contract is read back. +pub(super) fn apply_can_be_deleted_by_moderators( + document_type: &mut DocumentTypeV2, + can_be_deleted_by_moderators: bool, + data_contract_config: &DataContractConfig, + name: &str, +) -> Result<(), ProtocolError> { + if !can_be_deleted_by_moderators { + return Ok(()); + } + let structure_error = |message: String| { + consensus_or_protocol_data_contract_error(DataContractError::InvalidContractStructure( + message, + )) + }; + + if data_contract_config.moderation().is_none() { + return Err(structure_error(format!( + "document type \"{}\" sets `canBeDeletedByModerators: true`, but the contract \ + declares no `moderation` in its config, so nobody could delete its documents \ + (moderation can only be declared when the contract is created)", + name, + ))); + } + if document_type.documents_keep_history { + return Err(structure_error(format!( + "document type \"{}\" sets both `documentsKeepHistory: true` and \ + `canBeDeletedByModerators: true`, but the storage layer refuses to delete a \ + document whose type keeps history", + name, + ))); + } + if document_type.index_only { + return Err(structure_error(format!( + "indexOnly document type \"{}\" must not set `canBeDeletedByModerators`: there \ + is no stored row a moderator could name by id", + name, + ))); + } + if document_type.creation_restriction_mode != CreationRestrictionMode::NoRestrictions { + return Err(structure_error(format!( + "document type \"{}\" restricts document creation and must not set \ + `canBeDeletedByModerators`: its documents belong to the contract owner, whose \ + documents no moderator may delete", + name, + ))); + } + + document_type.documents_can_be_deleted_by_moderators = true; + Ok(()) +} + /// Reads a doctype-level array of top-level property names (`immutable`, the /// properties frozen at document creation on a mutable type, or /// `immutableAllowSetting`, the frozen properties a replace may still set diff --git a/packages/rs-dpp/src/data_contract/document_type/class_methods/try_from_schema/v3/mod.rs b/packages/rs-dpp/src/data_contract/document_type/class_methods/try_from_schema/v3/mod.rs index 9912479a0ed..589c23e3e36 100644 --- a/packages/rs-dpp/src/data_contract/document_type/class_methods/try_from_schema/v3/mod.rs +++ b/packages/rs-dpp/src/data_contract/document_type/class_methods/try_from_schema/v3/mod.rs @@ -288,6 +288,7 @@ fn try_from_schema_generation_3( let aggregates = common::parse_doctype_aggregate_keywords(&schema, name)?; let index_only = common::parse_index_only_keyword(&schema)?; let action_fees = DocumentActionFees::try_from_document_schema(&schema, name)?; + let can_be_deleted_by_moderators = common::parse_can_be_deleted_by_moderators_keyword(&schema)?; let immutable_fields = common::parse_property_name_list_keyword(&schema, name, property_names::IMMUTABLE)?; let immutable_fields_allow_setting = common::parse_property_name_list_keyword( @@ -374,6 +375,15 @@ fn try_from_schema_generation_3( full_validation, )?; + // After `apply_index_only`: the flag is refused on an indexOnly type, so it + // has to see that one already applied. + common::apply_can_be_deleted_by_moderators( + &mut v2, + can_be_deleted_by_moderators, + data_contact_config, + name, + )?; + // The flags are read from the parsed result (not the raw schema) so // the check sees `canBeDeleted` resolved against the contract config // default (`true` when the key is omitted). @@ -434,6 +444,8 @@ mod index_only_tests; mod keep_history_tests; #[cfg(test)] mod meta_schema_v0_stray_keyword_tests; +#[cfg(test)] +mod moderators_delete_tests; #[cfg(test)] mod tests { diff --git a/packages/rs-dpp/src/data_contract/document_type/class_methods/try_from_schema/v3/moderators_delete_tests.rs b/packages/rs-dpp/src/data_contract/document_type/class_methods/try_from_schema/v3/moderators_delete_tests.rs new file mode 100644 index 00000000000..cc056a8548b --- /dev/null +++ b/packages/rs-dpp/src/data_contract/document_type/class_methods/try_from_schema/v3/moderators_delete_tests.rs @@ -0,0 +1,194 @@ +//! The `canBeDeletedByModerators` doctype keyword (protocol version 14): what it requires of +//! the contract and of the document type. +use super::*; +use crate::data_contract::config::moderation::{ContractModerationConfig, ContractModerators}; +use crate::data_contract::document_type::accessors::DocumentTypeV2Getters; +use platform_value::platform_value; + +fn moderated_config(platform_version: &PlatformVersion) -> DataContractConfig { + DataContractConfig::default_for_version(platform_version) + .expect("default config available") + .with_moderation(Some(ContractModerationConfig { + banlist: false, + suspensions: false, + moderators: ContractModerators::ContractOwner, + })) +} + +fn parse_with_config( + schema: Value, + config: &DataContractConfig, + protocol_version: u32, + full_validation: bool, +) -> Result { + let platform_version = + PlatformVersion::get(protocol_version).expect("expected platform version"); + DocumentType::try_from_schema( + Identifier::new([1; 32]), + 1, + config.version(), + "post", + schema, + None, + &BTreeMap::new(), + config, + full_validation, + &mut vec![], + platform_version, + ) +} + +fn parse_moderated(schema: Value) -> Result { + let platform_version = PlatformVersion::latest(); + parse_with_config( + schema, + &moderated_config(platform_version), + platform_version.protocol_version, + true, + ) +} + +fn post_schema(extra: Value) -> Value { + let mut schema = platform_value!({ + "type": "object", + "properties": { + "text": { + "type": "string", + "maxLength": 50, + "position": 0, + }, + }, + "additionalProperties": false, + "canBeDeletedByModerators": true, + }); + if let (Value::Map(schema_map), Value::Map(extra_map)) = (&mut schema, extra) { + schema_map.extend(extra_map); + } + schema +} + +fn assert_refused_naming(result: Result, fragments: &[&str]) { + let error = result.expect_err("the document type must be refused"); + // A paid refusal needs the consensus variant: the data contract error variant would + // surface as an internal error in a block. + assert!( + matches!(error, ProtocolError::ConsensusError(_)), + "expected a consensus error, got {error:?}" + ); + let message = format!("{error:?}"); + for fragment in fragments { + assert!( + message.contains(fragment), + "error must name {fragment}, got {message}" + ); + } +} + +#[test] +fn should_parse_the_flag_on_a_moderated_contract() { + let document_type = parse_moderated(post_schema(platform_value!({}))).expect("parse"); + assert!(document_type.documents_can_be_deleted_by_moderators()); +} + +#[test] +fn should_default_the_flag_to_false() { + let schema = platform_value!({ + "type": "object", + "properties": { + "text": { "type": "string", "maxLength": 50, "position": 0 }, + }, + "additionalProperties": false, + }); + let document_type = parse_moderated(schema).expect("parse"); + assert!(!document_type.documents_can_be_deleted_by_moderators()); +} + +#[test] +fn should_keep_the_flag_independent_of_can_be_deleted() { + // A post its author can not retract, but moderators can remove. + let document_type = + parse_moderated(post_schema(platform_value!({ "canBeDeleted": false }))).expect("parse"); + assert!(!document_type.documents_can_be_deleted()); + assert!(document_type.documents_can_be_deleted_by_moderators()); +} + +#[test] +fn should_refuse_the_flag_on_a_contract_without_moderation() { + let platform_version = PlatformVersion::latest(); + let config = DataContractConfig::default_for_version(platform_version) + .expect("default config available"); + for full_validation in [true, false] { + assert_refused_naming( + parse_with_config( + post_schema(platform_value!({})), + &config, + platform_version.protocol_version, + full_validation, + ), + &["canBeDeletedByModerators", "moderation"], + ); + } +} + +#[test] +fn should_refuse_the_flag_on_a_type_that_keeps_history() { + assert_refused_naming( + parse_moderated(post_schema(platform_value!({ + "documentsKeepHistory": true, + "canBeDeleted": false, + }))), + &["documentsKeepHistory", "canBeDeletedByModerators"], + ); +} + +#[test] +fn should_refuse_the_flag_on_a_type_that_restricts_creation() { + assert_refused_naming( + parse_moderated(post_schema( + platform_value!({ "creationRestrictionMode": 1 }), + )), + &["restricts document creation", "canBeDeletedByModerators"], + ); +} + +#[test] +fn should_refuse_the_flag_on_an_index_only_type() { + let schema = platform_value!({ + "type": "object", + "indexOnly": true, + "documentsMutable": false, + "canBeDeletedByModerators": true, + "indices": [ + { "name": "byTopic", "properties": [{ "topic": "asc" }] }, + ], + "properties": { + "topic": { "type": "string", "maxLength": 50, "position": 0 }, + }, + "required": ["topic"], + "additionalProperties": false, + }); + assert_refused_naming( + parse_moderated(schema), + &["indexOnly", "canBeDeletedByModerators"], + ); +} + +#[test] +fn should_allow_the_flag_on_a_transferable_tradeable_type() { + let document_type = parse_moderated(post_schema(platform_value!({ + "transferable": 1, + "tradeMode": 1, + }))) + .expect("parse"); + assert!(document_type.documents_can_be_deleted_by_moderators()); +} + +#[test] +fn should_refuse_the_keyword_before_protocol_version_14() { + // Meta-schema v2 (protocol versions 12 and 13) does not know the keyword. + let platform_version = PlatformVersion::get(13).expect("expected platform version"); + let config = DataContractConfig::default_for_version(platform_version) + .expect("default config available"); + let result = parse_with_config(post_schema(platform_value!({})), &config, 13, true); + assert!(result.is_err(), "the keyword must not pass meta-schema v2"); +} diff --git a/packages/rs-dpp/src/data_contract/document_type/methods/validate_update/v1/mod.rs b/packages/rs-dpp/src/data_contract/document_type/methods/validate_update/v1/mod.rs index a6337517eb6..999052770d2 100644 --- a/packages/rs-dpp/src/data_contract/document_type/methods/validate_update/v1/mod.rs +++ b/packages/rs-dpp/src/data_contract/document_type/methods/validate_update/v1/mod.rs @@ -57,6 +57,15 @@ impl DocumentTypeRef<'_> { return Ok(result); } + // Validate that the type keeps whether moderators may delete its + // documents (a generation 1 rule: the keyword arrives with protocol + // version 14, and the shared config checks above also serve v0) + let result = self.validate_can_be_deleted_by_moderators_unchanged(new_document_type); + + if !result.is_valid() { + return Ok(result); + } + // Validate that index definitions are unchanged let result = self.validate_index_definitions_unchanged(new_document_type); @@ -131,6 +140,34 @@ impl DocumentTypeRef<'_> { ) } + /// Whether moderators may delete documents of a type is fixed when the + /// type is created: whoever wrote a document knows from the type's first + /// version who may take it down, and a type that is the target of a + /// permanentDocument reference was admitted as one nobody can delete. + /// A document type added by an update declares the flag freely. + fn validate_can_be_deleted_by_moderators_unchanged( + &self, + new_document_type: DocumentTypeRef, + ) -> SimpleConsensusValidationResult { + if new_document_type.documents_can_be_deleted_by_moderators() + == self.documents_can_be_deleted_by_moderators() + { + return SimpleConsensusValidationResult::new(); + } + SimpleConsensusValidationResult::new_with_error( + DocumentTypeUpdateError::new( + self.data_contract_id(), + self.name(), + format!( + "document type can not change whether its documents can be deleted by moderators: changing from {} to {}", + self.documents_can_be_deleted_by_moderators(), + new_document_type.documents_can_be_deleted_by_moderators() + ), + ) + .into(), + ) + } + /// Top-level requiredness may only change in one way: a brand-new /// property may be added as required when it is annotated with /// `requiredSince` equal to the contract version this update creates. @@ -417,6 +454,77 @@ mod tests { // The `immutable` list may only grow: removing an entry would let a // later replace change a property documents were created under the // promise of never changing. + #[test] + fn should_return_invalid_result_when_can_be_deleted_by_moderators_is_changed() { + use crate::data_contract::config::moderation::{ + ContractModerationConfig, ContractModerators, + }; + + let platform_version = PlatformVersion::latest(); + let data_contract_id = Identifier::random(); + + let schema = |deletable_by_moderators: bool| { + platform_value!({ + "type": "object", + "properties": { + "text": { "type": "string", "maxLength": 50, "position": 0 }, + }, + "additionalProperties": false, + "canBeDeletedByModerators": deletable_by_moderators, + }) + }; + + let config = DataContractConfig::default_for_version(platform_version) + .expect("should create a default config") + .with_moderation(Some(ContractModerationConfig { + banlist: true, + suspensions: false, + moderators: ContractModerators::ContractOwner, + })); + + let make_document_type = |schema: platform_value::Value| { + DocumentType::try_from_schema( + data_contract_id, + 1, + config.version(), + "post", + schema, + None, + &BTreeMap::new(), + &config, + false, + &mut Vec::new(), + platform_version, + ) + .expect("document type should parse") + }; + + // Neither direction is allowed: authors keep the rules they wrote under, and a + // permanentDocument reference was admitted against a type nobody can delete. + for (old_flag, new_flag) in [(false, true), (true, false)] { + let old_document_type = make_document_type(schema(old_flag)); + let new_document_type = make_document_type(schema(new_flag)); + + // The whole generation 1 pipeline: the rule answers before the schema + // compatibility differ, which has no rule for the keyword. + let result = old_document_type + .as_ref() + .validate_update(new_document_type.as_ref(), 2, platform_version) + .expect("validate_update should not error"); + + let expected = format!( + "document type can not change whether its documents can be deleted by moderators: changing from {} to {}", + old_flag, new_flag + ); + assert_matches!( + result.errors.as_slice(), + [ConsensusError::StateError( + StateError::DocumentTypeUpdateError(e) + )] if e.additional_message() == expected + ); + } + } + #[test] fn should_reject_removing_an_immutable_property() { let platform_version = PlatformVersion::latest(); diff --git a/packages/rs-dpp/src/data_contract/document_type/mod.rs b/packages/rs-dpp/src/data_contract/document_type/mod.rs index 4dcf3fe71ef..9cd9e15aa3d 100644 --- a/packages/rs-dpp/src/data_contract/document_type/mod.rs +++ b/packages/rs-dpp/src/data_contract/document_type/mod.rs @@ -143,6 +143,13 @@ pub(crate) mod property_names { /// 14). See `apply_index_only` in `try_from_schema::common` for the /// structural constraints the flag imposes. pub const INDEX_ONLY: &str = "indexOnly"; + /// Doctype-level flag letting the contract's moderators (its owner and the + /// identities its moderation config appoints) delete documents of this type + /// with a `ContractUserModeration` transition, whatever `canBeDeleted` says + /// about the documents' own owners. Meta-schema v3+ (protocol version 14). + /// See `apply_can_be_deleted_by_moderators` in `try_from_schema::common` + /// for what the flag requires of the type and of the contract. + pub const CAN_BE_DELETED_BY_MODERATORS: &str = "canBeDeletedByModerators"; } #[derive(Clone, Copy, Debug, PartialEq)] diff --git a/packages/rs-dpp/src/data_contract/document_type/v2/accessors.rs b/packages/rs-dpp/src/data_contract/document_type/v2/accessors.rs index e6784475a74..b81e9fc4cc6 100644 --- a/packages/rs-dpp/src/data_contract/document_type/v2/accessors.rs +++ b/packages/rs-dpp/src/data_contract/document_type/v2/accessors.rs @@ -232,6 +232,10 @@ impl DocumentTypeV2Getters for DocumentTypeV2 { self.index_only } + fn documents_can_be_deleted_by_moderators(&self) -> bool { + self.documents_can_be_deleted_by_moderators + } + fn immutable_fields(&self) -> &BTreeSet { &self.immutable_fields } diff --git a/packages/rs-dpp/src/data_contract/document_type/v2/mod.rs b/packages/rs-dpp/src/data_contract/document_type/v2/mod.rs index 30378753278..6fd850215a7 100644 --- a/packages/rs-dpp/src/data_contract/document_type/v2/mod.rs +++ b/packages/rs-dpp/src/data_contract/document_type/v2/mod.rs @@ -125,6 +125,14 @@ pub struct DocumentTypeV2 { /// (`actionFees` keyword, protocol version 14), `None` when it declares none. Fixed when /// the document type is published: a contract update cannot add, change or remove them. pub(in crate::data_contract) action_fees: Option, + /// When true, the contract's moderators may delete documents of this type + /// with a `ContractUserModeration` transition (`canBeDeletedByModerators` + /// keyword, protocol version 14), whatever `documents_can_be_deleted` says + /// about the documents' own owners. The parser + /// (`apply_can_be_deleted_by_moderators`) only admits it on a contract that + /// declares moderation, and refuses it on a type that keeps history, is + /// indexOnly or restricts document creation. + pub(in crate::data_contract) documents_can_be_deleted_by_moderators: bool, } impl DocumentTypeBasicMethods for DocumentTypeV2 {} @@ -196,6 +204,7 @@ impl From for DocumentTypeV2 { range_summable: false, index_only: false, action_fees: None, + documents_can_be_deleted_by_moderators: false, } } } @@ -239,6 +248,7 @@ impl From for DocumentTypeV2 { range_summable: false, index_only: false, action_fees: None, + documents_can_be_deleted_by_moderators: false, } } } diff --git a/packages/rs-dpp/src/data_contract/serialized_version/mod.rs b/packages/rs-dpp/src/data_contract/serialized_version/mod.rs index 63cc8aafbc3..8f74c5261fb 100644 --- a/packages/rs-dpp/src/data_contract/serialized_version/mod.rs +++ b/packages/rs-dpp/src/data_contract/serialized_version/mod.rs @@ -2,6 +2,7 @@ use super::EMPTY_KEYWORDS; use crate::data_contract::accessors::v0::DataContractV0Getters; use crate::data_contract::associated_token::token_configuration::TokenConfiguration; use crate::data_contract::config::DataContractConfig; +use crate::data_contract::document_type::property_names::CAN_BE_DELETED_BY_MODERATORS; use crate::data_contract::group::Group; use crate::data_contract::serialized_version::v0::DataContractInSerializationFormatV0; use crate::data_contract::serialized_version::v1::DataContractInSerializationFormatV1; @@ -141,6 +142,20 @@ impl DataContractInSerializationFormat { } } + /// Whether any document schema sets `canBeDeletedByModerators: true`, read from the raw + /// schemas: a contract in this format has no parsed document types. Used where a + /// moderation declaration is validated before the contract is parsed, since a + /// declaration that keeps no list is only valid with such a document type. + pub fn has_document_type_deletable_by_moderators(&self) -> bool { + self.document_schemas().values().any(|schema| { + schema + .get_optional_bool(CAN_BE_DELETED_BY_MODERATORS) + .ok() + .flatten() + .unwrap_or(false) + }) + } + pub fn document_schemas_mut(&mut self) -> &mut BTreeMap { match self { DataContractInSerializationFormat::V0(v0) => &mut v0.document_schemas, diff --git a/packages/rs-dpp/src/errors/consensus/codes.rs b/packages/rs-dpp/src/errors/consensus/codes.rs index b4b0e8c3e26..53a61e95a5d 100644 --- a/packages/rs-dpp/src/errors/consensus/codes.rs +++ b/packages/rs-dpp/src/errors/consensus/codes.rs @@ -462,6 +462,7 @@ impl ErrorWithCode for StateError { Self::ContractFeesNothingToClaimError(_) => 41112, Self::ContractFeeClaimNotAllowedError(_) => 41113, Self::ContractModerationCounterpartyBarredError(_) => 41114, + Self::DocumentTypeNotDeletableByModeratorsError(_) => 41115, } } } diff --git a/packages/rs-dpp/src/errors/consensus/state/contract_moderation/document_type_not_deletable_by_moderators_error.rs b/packages/rs-dpp/src/errors/consensus/state/contract_moderation/document_type_not_deletable_by_moderators_error.rs new file mode 100644 index 00000000000..a4e094367c5 --- /dev/null +++ b/packages/rs-dpp/src/errors/consensus/state/contract_moderation/document_type_not_deletable_by_moderators_error.rs @@ -0,0 +1,61 @@ +use crate::consensus::state::state_error::StateError; +use crate::consensus::ConsensusError; +use crate::errors::ProtocolError; +use bincode::{Decode, DecodeUntrusted, Encode}; +use platform_serialization_derive::{ + PlatformDeserializeTrusted, PlatformDeserializeUntrusted, PlatformSerialize, +}; +use platform_value::Identifier; +use thiserror::Error; + +#[derive( + Error, + Debug, + Clone, + PartialEq, + Eq, + Encode, + Decode, + PlatformSerialize, + PlatformDeserializeTrusted, + PlatformDeserializeUntrusted, + DecodeUntrusted, +)] +#[error( + "Documents of type {} on contract {} can not be deleted by moderators", + document_type_name, + contract_id +)] +#[platform_serialize(unversioned)] +pub struct DocumentTypeNotDeletableByModeratorsError { + /* + + DO NOT CHANGE ORDER OF FIELDS WITHOUT INTRODUCING OF NEW VERSION + + */ + contract_id: Identifier, + document_type_name: String, +} + +impl DocumentTypeNotDeletableByModeratorsError { + pub fn new(contract_id: Identifier, document_type_name: String) -> Self { + Self { + contract_id, + document_type_name, + } + } + + pub fn contract_id(&self) -> Identifier { + self.contract_id + } + + pub fn document_type_name(&self) -> &str { + &self.document_type_name + } +} + +impl From for ConsensusError { + fn from(err: DocumentTypeNotDeletableByModeratorsError) -> Self { + Self::StateError(StateError::DocumentTypeNotDeletableByModeratorsError(err)) + } +} diff --git a/packages/rs-dpp/src/errors/consensus/state/contract_moderation/mod.rs b/packages/rs-dpp/src/errors/consensus/state/contract_moderation/mod.rs index f92c00a7e1e..686fc4ce35c 100644 --- a/packages/rs-dpp/src/errors/consensus/state/contract_moderation/mod.rs +++ b/packages/rs-dpp/src/errors/consensus/state/contract_moderation/mod.rs @@ -12,6 +12,7 @@ mod contract_user_banned_error; mod contract_user_not_banned_error; mod contract_user_not_suspended_error; mod contract_user_suspended_error; +mod document_type_not_deletable_by_moderators_error; mod identity_not_contract_moderator_error; pub use contract_fee_claim_not_allowed_error::*; @@ -28,4 +29,5 @@ pub use contract_user_banned_error::*; pub use contract_user_not_banned_error::*; pub use contract_user_not_suspended_error::*; pub use contract_user_suspended_error::*; +pub use document_type_not_deletable_by_moderators_error::*; pub use identity_not_contract_moderator_error::*; diff --git a/packages/rs-dpp/src/errors/consensus/state/state_error.rs b/packages/rs-dpp/src/errors/consensus/state/state_error.rs index c08e39b9b5a..f6822a2745b 100644 --- a/packages/rs-dpp/src/errors/consensus/state/state_error.rs +++ b/packages/rs-dpp/src/errors/consensus/state/state_error.rs @@ -19,7 +19,7 @@ use crate::consensus::state::contract_moderation::{ ContractModeratorIdentityNotFoundError, ContractSuspensionNotInFutureError, ContractUserAlreadyBannedError, ContractUserBannedError, ContractUserNotBannedError, ContractUserNotSuspendedError, ContractUserSuspendedError, - IdentityNotContractModeratorError, + DocumentTypeNotDeletableByModeratorsError, IdentityNotContractModeratorError, }; use crate::consensus::state::contract_group::{ ContractGroupAlreadyExistsError, ContractGroupNotFoundError, @@ -528,6 +528,10 @@ pub enum StateError { // away from the other reference errors, because the enum is append-only. #[error(transparent)] ReferencedDocumentTypeNotDeletableError(ReferencedDocumentTypeNotDeletableError), + + // Document deletion by moderators (protocol version 14). + #[error(transparent)] + DocumentTypeNotDeletableByModeratorsError(DocumentTypeNotDeletableByModeratorsError), } impl From for ConsensusError { @@ -858,7 +862,7 @@ mod tests { )), 125 ); - // Contract fee claims (protocol version 14): the tail of the enum. + // Contract fee claims (protocol version 14). assert_eq!( discriminant_of(StateError::ContractFeesAlreadyClaimedThisEpochError( ContractFeesAlreadyClaimedThisEpochError::new( @@ -881,8 +885,7 @@ mod tests { )), 128 ); - // `refersTo: deletableDocument` (protocol version 14): the tail of - // the enum. + // `refersTo: deletableDocument` (protocol version 14). assert_eq!( discriminant_of(StateError::ReferencedDocumentTypeNotDeletableError( ReferencedDocumentTypeNotDeletableError::new( @@ -893,5 +896,12 @@ mod tests { )), 129 ); + // Document deletion by moderators (protocol version 14): the tail of the enum. + assert_eq!( + discriminant_of(StateError::DocumentTypeNotDeletableByModeratorsError( + DocumentTypeNotDeletableByModeratorsError::new(group_id, "post".to_string()) + )), + 130 + ); } } diff --git a/packages/rs-dpp/src/state_transition/proof_result.rs b/packages/rs-dpp/src/state_transition/proof_result.rs index 00075f7cc98..53b2a75f7ec 100644 --- a/packages/rs-dpp/src/state_transition/proof_result.rs +++ b/packages/rs-dpp/src/state_transition/proof_result.rs @@ -1,7 +1,9 @@ use crate::address_funds::PlatformAddress; use crate::asset_lock::StoredAssetLockInfo; use crate::balances::credits::TokenAmount; -use crate::data_contract::config::moderation::ContractModerationListStatuses; +use crate::data_contract::config::moderation::{ + ContractDocumentRemoval, ContractModerationListStatuses, +}; use crate::data_contract::document_type::action_fees::{ContractFeePot, ContractFeePotLastClaim}; use crate::data_contract::group::GroupSumPower; use crate::data_contract::DataContract; @@ -153,6 +155,12 @@ pub enum StateTransitionProofResult { )] BTreeMap, ), + /// Returned by a `ContractUserModeration` that deletes a document: the record the removal + /// left under the contract (contract id, document type name, document id, record). The + /// proof shows the record, and the verifier checks that it names the transition's signer + /// and carries the transition's reason. A document id is produced at most once, so the + /// record is of this document and of no other. + VerifiedContractDocumentRemoval(Identifier, String, Identifier, ContractDocumentRemoval), } /// A verified state-transition proof result, tagged with the guarantee the diff --git a/packages/rs-dpp/src/state_transition/state_transitions/contract/contract_user_moderation_transition/accessors/v0/mod.rs b/packages/rs-dpp/src/state_transition/state_transitions/contract/contract_user_moderation_transition/accessors/v0/mod.rs index 87249409d35..01e7ac4911c 100644 --- a/packages/rs-dpp/src/state_transition/state_transitions/contract/contract_user_moderation_transition/accessors/v0/mod.rs +++ b/packages/rs-dpp/src/state_transition/state_transitions/contract/contract_user_moderation_transition/accessors/v0/mod.rs @@ -12,8 +12,8 @@ pub trait ContractUserModerationTransitionAccessorsV0 { fn set_action(&mut self, action: ContractUserModerationAction); /// What is done, to whom fn action(&self) -> &ContractUserModerationAction; - /// The identity the action targets - fn target_identity_id(&self) -> Identifier { + /// The identity the action targets, `None` for a document deletion + fn target_identity_id(&self) -> Option { self.action().identity_id() } } diff --git a/packages/rs-dpp/src/state_transition/state_transitions/contract/contract_user_moderation_transition/v0/mod.rs b/packages/rs-dpp/src/state_transition/state_transitions/contract/contract_user_moderation_transition/v0/mod.rs index 1c2d80f57d3..6190168426c 100644 --- a/packages/rs-dpp/src/state_transition/state_transitions/contract/contract_user_moderation_transition/v0/mod.rs +++ b/packages/rs-dpp/src/state_transition/state_transitions/contract/contract_user_moderation_transition/v0/mod.rs @@ -20,7 +20,7 @@ use crate::prelude::{Identifier, IdentityNonce, UserFeeIncrease}; use crate::ProtocolError; use std::fmt; -/// What the moderator does to one identity on the contract. +/// What the moderator does on the contract: to one identity, or to one document. #[derive(Debug, Clone, PartialEq, Eq, Encode, Decode, DecodeUntrusted)] #[cfg_attr( feature = "serde-conversion", @@ -54,6 +54,17 @@ pub enum ContractUserModerationAction { #[cfg_attr(feature = "serde-conversion", serde(rename = "identityId"))] identity_id: Identifier, }, + /// Deletes a document of a document type that sets `canBeDeletedByModerators`, whoever + /// owns it, except the contract owner and the moderators. The document's owner gets no + /// storage refund, and a `ContractDocumentRemoval` stays under the contract. + DeleteDocument { + #[cfg_attr(feature = "serde-conversion", serde(rename = "documentTypeName"))] + document_type_name: String, + #[cfg_attr(feature = "serde-conversion", serde(rename = "documentId"))] + document_id: Identifier, + /// Why, stored with the removal record. + reason: ContractModerationReason, + }, } impl Default for ContractUserModerationAction { @@ -66,13 +77,28 @@ impl Default for ContractUserModerationAction { } impl ContractUserModerationAction { - /// The identity the action targets. - pub fn identity_id(&self) -> Identifier { + /// The identity the action targets. `None` for a document deletion: it names a document, + /// and whose it is is only known once the document is read. + pub fn identity_id(&self) -> Option { match self { ContractUserModerationAction::Ban { identity_id, .. } | ContractUserModerationAction::Unban { identity_id } | ContractUserModerationAction::Suspend { identity_id, .. } - | ContractUserModerationAction::Unsuspend { identity_id } => *identity_id, + | ContractUserModerationAction::Unsuspend { identity_id } => Some(*identity_id), + ContractUserModerationAction::DeleteDocument { .. } => None, + } + } + + /// The document a deletion targets, as its document type name and its id. `None` for an + /// action on an identity. + pub fn document(&self) -> Option<(&str, Identifier)> { + match self { + ContractUserModerationAction::DeleteDocument { + document_type_name, + document_id, + .. + } => Some((document_type_name.as_str(), *document_id)), + _ => None, } } @@ -84,12 +110,13 @@ impl ContractUserModerationAction { } } - /// The reason a ban or a suspend carries, `None` for an action that takes an identity off - /// a list. + /// The reason a ban, a suspend or a document deletion carries, `None` for an action that + /// takes an identity off a list. pub fn reason(&self) -> Option<&ContractModerationReason> { match self { ContractUserModerationAction::Ban { reason, .. } - | ContractUserModerationAction::Suspend { reason, .. } => Some(reason), + | ContractUserModerationAction::Suspend { reason, .. } + | ContractUserModerationAction::DeleteDocument { reason, .. } => Some(reason), ContractUserModerationAction::Unban { .. } | ContractUserModerationAction::Unsuspend { .. } => None, } @@ -102,6 +129,7 @@ impl ContractUserModerationAction { ContractUserModerationAction::Unban { .. } => "unban", ContractUserModerationAction::Suspend { .. } => "suspend", ContractUserModerationAction::Unsuspend { .. } => "unsuspend", + ContractUserModerationAction::DeleteDocument { .. } => "deleteDocument", } } } @@ -114,7 +142,18 @@ impl fmt::Display for ContractUserModerationAction { } => { write!(f, "suspend {} until {}", identity_id, until) } - other => write!(f, "{} {}", other.name(), other.identity_id()), + ContractUserModerationAction::DeleteDocument { + document_type_name, + document_id, + .. + } => { + write!(f, "delete {} document {}", document_type_name, document_id) + } + ContractUserModerationAction::Ban { identity_id, .. } + | ContractUserModerationAction::Unban { identity_id } + | ContractUserModerationAction::Unsuspend { identity_id } => { + write!(f, "{} {}", self.name(), identity_id) + } } } } @@ -125,7 +164,8 @@ impl fmt::Display for ContractUserModerationAction { #[cfg(feature = "json-conversion")] impl JsonSafeFields for ContractUserModerationAction {} -/// Edits the banlist or the suspension list of a moderated data contract. Signed by the +/// Edits the banlist or the suspension list of a moderated data contract, or deletes a +/// document of one of its document types that moderators may delete. Signed by the /// contract owner or a moderator named in the contract's config, with a CRITICAL /// authentication key, under the signer's contract-scoped nonce. #[cfg_attr(feature = "json-conversion", json_safe_fields)] @@ -233,7 +273,8 @@ mod test { until: 12, reason: reason.clone(), }; - assert_eq!(action.identity_id(), target); + assert_eq!(action.identity_id(), Some(target)); + assert_eq!(action.document(), None); assert_eq!(action.until(), Some(12)); assert_eq!(action.reason(), Some(&reason)); assert_eq!(action.name(), "suspend"); @@ -244,12 +285,52 @@ mod test { assert_eq!(unban.reason(), None); } + #[test] + fn should_name_the_document_of_a_deletion() { + let document_id = Identifier::random(); + let reason = ContractModerationReason { + code: Some(2), + text: "spam".to_string(), + }; + let action = ContractUserModerationAction::DeleteDocument { + document_type_name: "post".to_string(), + document_id, + reason: reason.clone(), + }; + // A deletion names a document: whose it is is only known once it is read. + assert_eq!(action.identity_id(), None); + assert_eq!(action.document(), Some(("post", document_id))); + assert_eq!(action.until(), None); + assert_eq!(action.reason(), Some(&reason)); + assert_eq!(action.name(), "deleteDocument"); + assert_eq!( + action.to_string(), + format!("delete post document {}", document_id) + ); + } + + #[cfg(feature = "json-conversion")] + #[test] + fn should_tag_a_deletion_on_the_wire() { + let action = ContractUserModerationAction::DeleteDocument { + document_type_name: "post".to_string(), + document_id: Identifier::from([7; 32]), + reason: ContractModerationReason::default(), + }; + let json = serde_json::to_value(&action).expect("to json"); + assert_eq!(json["$type"], "deleteDocument"); + assert_eq!(json["documentTypeName"], "post"); + assert!(json.get("documentId").is_some()); + let back: ContractUserModerationAction = serde_json::from_value(json).expect("from json"); + assert_eq!(back, action); + } + #[test] fn should_sign_the_reason() { let a = make_v0(); let mut b = a.clone(); b.action = ContractUserModerationAction::Ban { - identity_id: a.action.identity_id(), + identity_id: a.action.identity_id().expect("a ban names an identity"), reason: ContractModerationReason::from_text("something else"), }; assert_ne!( diff --git a/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/action_validation/document/document_reference_validation/v0/mod.rs b/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/action_validation/document/document_reference_validation/v0/mod.rs index 8bda3884326..f1136808a96 100644 --- a/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/action_validation/document/document_reference_validation/v0/mod.rs +++ b/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/action_validation/document/document_reference_validation/v0/mod.rs @@ -6,7 +6,9 @@ use dpp::consensus::basic::invalid_identifier_error::InvalidIdentifierError; use dpp::consensus::state::state_error::StateError; use dpp::consensus::ConsensusError; use dpp::data_contract::accessors::v0::DataContractV0Getters; -use dpp::data_contract::document_type::accessors::DocumentTypeV0Getters; +use dpp::data_contract::document_type::accessors::{ + DocumentTypeV0Getters, DocumentTypeV2Getters, +}; use dpp::data_contract::document_type::methods::DocumentTypeV0Methods; use dpp::data_contract::document_type::{ is_referring_system_agreement_property, DocumentPropertyReferenceTarget, @@ -390,8 +392,11 @@ fn validate_document_type_references_v0( // `deletableDocument` reference makes no such promise, and // admits only document types whose documents CAN be deleted: // the referenced document must exist now, and may be deleted - // later - let target_is_deletable = referenced_document_type.documents_can_be_deleted(); + // later. Deletable means by anyone, the contract's moderators + // included (`canBeDeletedByModerators`), as at contract + // registration + let target_is_deletable = referenced_document_type.documents_can_be_deleted() + || referenced_document_type.documents_can_be_deleted_by_moderators(); if permanent && target_is_deletable { return Ok(SimpleConsensusValidationResult::new_with_error( ReferencedDocumentTypeDeletableError::new( diff --git a/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/mod.rs b/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/mod.rs index 93d7c6337fc..5876fa86998 100644 --- a/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/mod.rs +++ b/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/mod.rs @@ -7,6 +7,10 @@ mod is_allowed; mod state; mod transformer; +// A moderator's document deletion (`contract_user_moderation`) reads the document the way a +// document's own deletion does, billed the same. +pub(in crate::execution::validation::state_transition::state_transitions) use state::v0::fetch_documents::fetch_document_with_id; + #[cfg(test)] mod tests; diff --git a/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/contract_user_moderation/basic_structure/v0/mod.rs b/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/contract_user_moderation/basic_structure/v0/mod.rs index 6ae520d14b5..4ea03d822de 100644 --- a/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/contract_user_moderation/basic_structure/v0/mod.rs +++ b/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/contract_user_moderation/basic_structure/v0/mod.rs @@ -20,8 +20,10 @@ impl ContractUserModerationStateTransitionStructureValidationV0 for ContractUserModerationTransition { /// An identity can not moderate itself, a suspension ends within the JSON-safe range, and - /// the text of a ban's or a suspension's reason fits + /// the text of the reason a ban, a suspension or a document deletion carries fits /// `SystemLimits::max_contract_moderation_reason_length`; the reason's code is not checked. + /// A document deletion names a document, not an identity: whose it is, and so whether the + /// moderator may delete it, is only known once the state is read. /// Whether the contract keeps the list, who may /// moderate it and what the target's status is all need state, so state validation /// decides those. @@ -29,7 +31,7 @@ impl ContractUserModerationStateTransitionStructureValidationV0 &self, platform_version: &PlatformVersion, ) -> Result { - if self.target_identity_id() == self.owner_id() { + if self.target_identity_id() == Some(self.owner_id()) { return Ok(SimpleConsensusValidationResult::new_with_error( ConsensusError::from(ContractModerationSelfTargetError::new(self.owner_id())), )); diff --git a/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/contract_user_moderation/state/v0/mod.rs b/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/contract_user_moderation/state/v0/mod.rs index be93ece1456..c28e138e5c3 100644 --- a/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/contract_user_moderation/state/v0/mod.rs +++ b/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/contract_user_moderation/state/v0/mod.rs @@ -5,22 +5,28 @@ use crate::execution::types::state_transition_execution_context::{ StateTransitionExecutionContext, StateTransitionExecutionContextMethodsV0, }; use crate::execution::validation::state_transition::common::validate_identity_exists::validate_identity_exists; +use crate::execution::validation::state_transition::state_transitions::batch::fetch_document_with_id; use crate::platform_types::platform::PlatformRef; use crate::rpc::core::CoreRPCLike; use dpp::block::block_info::BlockInfo; -use dpp::consensus::basic::document::DataContractNotPresentError; +use dpp::consensus::basic::document::{DataContractNotPresentError, InvalidDocumentTypeError}; use dpp::consensus::state::contract_moderation::{ ContractModerationNotEnabledError, ContractModerationTargetNotAllowedError, ContractModerationTargetNotFoundError, ContractSuspensionNotInFutureError, ContractUserAlreadyBannedError, ContractUserBannedError, ContractUserNotBannedError, - ContractUserNotSuspendedError, IdentityNotContractModeratorError, + ContractUserNotSuspendedError, DocumentTypeNotDeletableByModeratorsError, + IdentityNotContractModeratorError, }; +use dpp::consensus::state::document::document_not_found_error::DocumentNotFoundError; +use dpp::consensus::state::state_error::StateError; use dpp::consensus::ConsensusError; use dpp::data_contract::accessors::v0::DataContractV0Getters; use dpp::data_contract::config::moderation::{ ContractModerationConfig, ContractModerationList, ContractModerationStatus, }; use dpp::data_contract::config::v2::DataContractConfigGettersV2; +use dpp::data_contract::document_type::accessors::DocumentTypeV2Getters; +use dpp::document::DocumentV0Getters; use dpp::prelude::{ConsensusValidationResult, Identifier}; use dpp::state_transition::contract_user_moderation_transition::accessors::ContractUserModerationTransitionAccessorsV0; use dpp::state_transition::contract_user_moderation_transition::{ @@ -28,10 +34,13 @@ use dpp::state_transition::contract_user_moderation_transition::{ }; use dpp::state_transition::StateTransitionOwned; use dpp::version::PlatformVersion; +use drive::drive::contract::DataContractFetchInfo; use drive::grovedb::TransactionArg; +use drive::state_transition_action::contract::contract_user_moderation::v0::ContractDocumentDeletionContext; use drive::state_transition_action::contract::contract_user_moderation::ContractUserModerationTransitionAction; use drive::state_transition_action::system::bump_identity_data_contract_nonce_action::BumpIdentityDataContractNonceAction; use drive::state_transition_action::StateTransitionAction; +use std::sync::Arc; pub(in crate::execution::validation::state_transition::state_transitions::contract_user_moderation) trait ContractUserModerationStateTransitionStateValidationV0 { @@ -46,7 +55,8 @@ pub(in crate::execution::validation::state_transition::state_transitions::contra } impl ContractUserModerationStateTransitionStateValidationV0 for ContractUserModerationTransition { - /// Reads the contract and the target's status and checks the moderation: the contract + /// A document deletion is checked by `transform_document_deletion_v0`. For the rest: + /// reads the contract and the target's status and checks the moderation: the contract /// keeps the list the action edits, the signer is its owner or one of its moderators, the /// target is neither and exists, and the action fits the target's status. Every refusal, /// a contract that does not exist included, is paid for by bumping the signer's contract @@ -66,7 +76,6 @@ impl ContractUserModerationStateTransitionStateValidationV0 for ContractUserMode let contract_id = self.data_contract_id(); let moderator_id = self.owner_id(); let action = self.action(); - let target_id = action.identity_id(); let (contract_fetch_fee, maybe_contract_fetch_info) = platform.drive.get_contract_with_fetch_info_and_fee( @@ -109,7 +118,35 @@ impl ContractUserModerationStateTransitionStateValidationV0 for ContractUserMode }; let contract = &contract_fetch_info.contract; - let list = list_of(action); + + let target_id = match action { + ContractUserModerationAction::DeleteDocument { + document_type_name, + document_id, + .. + } => { + return transform_document_deletion_v0( + self, + platform, + block_info, + &contract_fetch_info, + document_type_name, + *document_id, + execution_context, + tx, + platform_version, + ); + } + ContractUserModerationAction::Ban { identity_id, .. } + | ContractUserModerationAction::Unban { identity_id } + | ContractUserModerationAction::Suspend { identity_id, .. } + | ContractUserModerationAction::Unsuspend { identity_id } => *identity_id, + }; + let Some(list) = list_of(action) else { + return Err(Error::Execution(ExecutionError::CorruptedCodeExecution( + "a moderation of an identity edits a list", + ))); + }; let Some(moderation) = contract.config().moderation() else { return refuse(ContractModerationNotEnabledError::new(contract_id, list).into()); @@ -150,7 +187,7 @@ impl ContractUserModerationStateTransitionStateValidationV0 for ContractUserMode ); } - let lists = lists_to_read(moderation, action); + let lists = lists_to_read(moderation, action, list); let (fee, status) = platform.drive.fetch_contract_moderation_status_with_fee( contract_id, target_id, @@ -161,7 +198,8 @@ impl ContractUserModerationStateTransitionStateValidationV0 for ContractUserMode )?; execution_context.add_operation(ValidationOperation::PrecalculatedOperation(fee)); - if let Some(error) = refusal_for_status(action, &status, contract_id, block_info) { + if let Some(error) = refusal_for_status(action, target_id, &status, contract_id, block_info) + { return refuse(error); } @@ -174,14 +212,120 @@ impl ContractUserModerationStateTransitionStateValidationV0 for ContractUserMode } } -/// The list the action edits. -fn list_of(action: &ContractUserModerationAction) -> ContractModerationList { +/// A document deletion: the document type exists and says moderators may delete its +/// documents, the signer is the contract's owner or one of its moderators, the document +/// exists, and it is not the owner's or a moderator's. Every refusal is paid for by +/// bumping the signer's contract nonce. +/// +/// The action carries the contract and the document's owner, so Drive deletes the document +/// and writes its record without reading again. Nothing the document type prices is charged, neither +/// its deletion token cost nor its `actionFees` deletion fee: both are what a document's own +/// owner pays for deleting it, and a moderator removes content on the contract's behalf. +#[allow(clippy::too_many_arguments)] +fn transform_document_deletion_v0( + transition: &ContractUserModerationTransition, + platform: &PlatformRef, + block_info: &BlockInfo, + contract_fetch_info: &Arc, + document_type_name: &str, + document_id: Identifier, + execution_context: &mut StateTransitionExecutionContext, + tx: TransactionArg, + platform_version: &PlatformVersion, +) -> Result, Error> { + let contract = &contract_fetch_info.contract; + let contract_id = contract.id(); + let moderator_id = transition.owner_id(); + let refuse = |error: ConsensusError| { + Ok(ConsensusValidationResult::new_with_data_and_errors( + StateTransitionAction::BumpIdentityDataContractNonceAction( + BumpIdentityDataContractNonceAction::from_borrowed_contract_user_moderation_transition( + transition, + ), + ), + vec![error], + )) + }; + + let Some(document_type) = contract.document_type_optional_for_name(document_type_name) else { + return refuse( + InvalidDocumentTypeError::new(document_type_name.to_string(), contract_id).into(), + ); + }; + // The keyword is only admitted on a contract that declares moderation, so a document + // type that carries it always has moderators; one that does not reads the same as a + // contract that has none. + let moderation = contract + .config() + .moderation() + .filter(|_| document_type.documents_can_be_deleted_by_moderators()); + let Some(moderation) = moderation else { + return refuse( + DocumentTypeNotDeletableByModeratorsError::new( + contract_id, + document_type_name.to_string(), + ) + .into(), + ); + }; + + let owner_id = contract.owner_id(); + if !moderation.may_moderate(&owner_id, &moderator_id) { + return refuse(IdentityNotContractModeratorError::new(contract_id, moderator_id).into()); + } + + let Some(document) = fetch_document_with_id( + platform.drive, + contract, + document_type, + document_id, + &block_info.epoch, + execution_context, + tx, + platform_version, + )? + else { + return refuse(ConsensusError::StateError( + StateError::DocumentNotFoundError(DocumentNotFoundError::new(document_id)), + )); + }; + + // What protects the owner and the moderators from a ban protects their documents: + // the owner demotes a moderator by a contract update before deleting what it wrote. + let document_owner_id = document.owner_id(); + if moderation.may_moderate(&owner_id, &document_owner_id) { + return refuse( + ContractModerationTargetNotAllowedError::new(contract_id, document_owner_id).into(), + ); + } + + // The record this deletion leaves is always new: a document id is produced at most once + // (it commits to the nonce of its create transition), so no earlier removal can have + // recorded this id and nothing has to be read to write it. + Ok(ConsensusValidationResult::new_with_data( + ContractUserModerationTransitionAction::from_borrowed_transition_with_document_deletion( + transition, + ContractDocumentDeletionContext { + data_contract_fetch_info: Arc::clone(contract_fetch_info), + document_owner_id, + removed_at: block_info.time_ms, + }, + ) + .into(), + )) +} + +/// The list the action edits, `None` for a document deletion, which edits none. +fn list_of(action: &ContractUserModerationAction) -> Option { match action { ContractUserModerationAction::Ban { .. } | ContractUserModerationAction::Unban { .. } => { - ContractModerationList::Banlist + Some(ContractModerationList::Banlist) } ContractUserModerationAction::Suspend { .. } - | ContractUserModerationAction::Unsuspend { .. } => ContractModerationList::Suspensions, + | ContractUserModerationAction::Unsuspend { .. } => { + Some(ContractModerationList::Suspensions) + } + ContractUserModerationAction::DeleteDocument { .. } => None, } } @@ -191,24 +335,26 @@ fn list_of(action: &ContractUserModerationAction) -> ContractModerationList { fn lists_to_read( moderation: &ContractModerationConfig, action: &ContractUserModerationAction, + list: ContractModerationList, ) -> Vec { match action { ContractUserModerationAction::Ban { .. } | ContractUserModerationAction::Suspend { .. } => { moderation.lists().collect() } ContractUserModerationAction::Unban { .. } - | ContractUserModerationAction::Unsuspend { .. } => vec![list_of(action)], + | ContractUserModerationAction::Unsuspend { .. } + | ContractUserModerationAction::DeleteDocument { .. } => vec![list], } } /// The first rule the target's status breaks for this action, if any. fn refusal_for_status( action: &ContractUserModerationAction, + target_id: Identifier, status: &ContractModerationStatus, contract_id: Identifier, block_info: &BlockInfo, ) -> Option { - let target_id = action.identity_id(); match action { ContractUserModerationAction::Ban { .. } => status .banned() @@ -234,5 +380,7 @@ fn refusal_for_status( .suspension .is_none() .then(|| ContractUserNotSuspendedError::new(contract_id, target_id).into()), + // A document deletion reads no list. + ContractUserModerationAction::DeleteDocument { .. } => None, } } diff --git a/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/contract_user_moderation/tests.rs b/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/contract_user_moderation/tests.rs index d5fcbf7b994..5a83c4ec469 100644 --- a/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/contract_user_moderation/tests.rs +++ b/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/contract_user_moderation/tests.rs @@ -14,21 +14,27 @@ use dpp::consensus::state::state_error::StateError; use dpp::consensus::ConsensusError; use dpp::dash_to_credits; use dpp::data_contract::accessors::v0::{DataContractV0Getters, DataContractV0Setters}; +use dpp::data_contract::accessors::v1::DataContractV1Setters; +use dpp::data_contract::associated_token::token_configuration::v0::TokenConfigurationV0; +use dpp::data_contract::associated_token::token_configuration::TokenConfiguration; use dpp::data_contract::config::moderation::{ - ContractBan, ContractModerationConfig, ContractModerationList, ContractModerationListStatus, - ContractModerationListStatuses, ContractModerationReason, ContractModerationStatus, - ContractModerators, ContractSuspension, + ContractBan, ContractDocumentRemoval, ContractModerationConfig, ContractModerationList, + ContractModerationListStatus, ContractModerationListStatuses, ContractModerationReason, + ContractModerationStatus, ContractModerators, ContractSuspension, }; use dpp::data_contract::config::v2::DataContractConfigGettersV2; +use dpp::data_contract::document_type::accessors::DocumentTypeV0Getters; use dpp::data_contract::document_type::random_document::{ CreateRandomDocument, DocumentFieldFillSize, DocumentFieldFillType, }; +use dpp::data_contract::schema::DataContractSchemaMethodsV0; use dpp::data_contract::DataContract; use dpp::document::Document; -use dpp::document::DocumentV0Setters; +use dpp::document::{DocumentV0Getters, DocumentV0Setters}; +use dpp::fee::Credits; use dpp::identity::accessors::IdentityGettersV0; use dpp::identity::{Identity, IdentityPublicKey, KeyID, TimestampMillis}; -use dpp::platform_value::{Bytes32, Identifier}; +use dpp::platform_value::{platform_value, Bytes32, Identifier, Value}; use dpp::prelude::IdentityNonce; use dpp::serialization::PlatformSerializable; use dpp::state_transition::batch_transition::methods::v0::DocumentsBatchTransitionMethodsV0; @@ -48,6 +54,10 @@ use dpp::state_transition::StateTransition; use dpp::tests::fixtures::get_data_contract_fixture; use dpp::tests::json_document::json_document_to_contract; use dpp::version::PlatformVersion; +use dpp::ProtocolError; +use drive::drive::contract::moderation::types::{ + ContractDocumentRemovalsQuery, ContractDocumentRemovalsSelection, +}; use drive::drive::Drive; use drive::grovedb::Transaction; use drive::util::storage_flags::StorageFlags; @@ -73,9 +83,17 @@ const CONTRACT_USER_SUSPENDED: u32 = 41108; const CONTRACT_MODERATION_TARGET_NOT_FOUND: u32 = 41109; const CONTRACT_MODERATOR_IDENTITY_NOT_FOUND: u32 = 41110; const CONTRACT_MODERATION_COUNTERPARTY_BARRED: u32 = 41114; +const DOCUMENT_TYPE_NOT_DELETABLE_BY_MODERATORS: u32 = 41115; +const INVALID_DOCUMENT_TYPE: u32 = 10406; +const INVALID_CONTRACT_STRUCTURE: u32 = 10231; +const INVALID_CONTRACT_MODERATION_CONFIG: u32 = 10900; +const DOCUMENT_TYPE_UPDATE: u32 = 40212; +const REFERENCED_DOCUMENT_TYPE_DELETABLE: u32 = 40122; pub(crate) const CRITICAL_KEY_ID: KeyID = 1; const DOCUMENT_TYPE: &str = "niceDocument"; +/// The document type `Setup::new_with_posts` adds: moderators may delete its documents. +const POST: &str = "post"; const BLOCK_TIME_MS: TimestampMillis = 1_000_000; const BOTH: [ContractModerationList; 2] = [ @@ -156,6 +174,23 @@ impl Setup { async fn new_at( moderation: Option, platform_version: &PlatformVersion, + ) -> Self { + Self::new_at_with(moderation, platform_version, |_| {}).await + } + + /// A contract that also has the `post` document type, whose documents moderators may + /// delete + async fn new_with_posts(moderation: Option) -> Self { + Self::new_at_with(moderation, PlatformVersion::latest(), |contract| { + add_document_type(contract, POST, post_schema(true)) + }) + .await + } + + async fn new_at_with( + moderation: Option, + platform_version: &PlatformVersion, + modify_contract: impl FnOnce(&mut DataContract), ) -> Self { let mut platform = TestPlatformBuilder::new() .with_initial_protocol_version(platform_version.protocol_version) @@ -185,6 +220,8 @@ impl Setup { moderation }); contract.set_config(contract.config().clone().with_moderation(moderation)); + // After the config: a document type moderators can delete from needs the declaration. + modify_contract(&mut contract); let mut setup = Self { platform, @@ -269,10 +306,30 @@ impl Setup { /// A document creation by `actor` on the contract, and the document it creates async fn create_document_keeping_it(&self, actor: &Actor) -> (Document, StateTransition) { + self.create_document_of_type(actor, DOCUMENT_TYPE).await + } + + /// A creation by `actor` of a document of `document_type_name`, and the document it creates + async fn create_document_of_type( + &self, + actor: &Actor, + document_type_name: &str, + ) -> (Document, StateTransition) { + self.create_document_of_type_with(actor, document_type_name, |_| {}) + .await + } + + /// The same, with `modify` applied to the document before its creation is built + async fn create_document_of_type_with( + &self, + actor: &Actor, + document_type_name: &str, + modify: impl FnOnce(&mut Document), + ) -> (Document, StateTransition) { let platform_version = PlatformVersion::latest(); let document_type = self .contract - .document_type_for_name(DOCUMENT_TYPE) + .document_type_for_name(document_type_name) .expect("expected the document type"); let creation_nonce = actor.contract_nonce(); // The borrow ends before the await below (clippy::await_holding_refcell_ref). @@ -289,6 +346,7 @@ impl Setup { platform_version, ) .expect("expected a random document"); + modify(&mut document); document .set_id_for_creation(document_type, &entropy.0, creation_nonce, platform_version) .expect("expected to set the document id"); @@ -311,6 +369,76 @@ impl Setup { (document, transition) } + /// The record of a moderator's deletion of `document_id`, if there is one + fn post_removal( + &self, + document_id: Identifier, + transaction: Option<&Transaction>, + ) -> Option { + self.platform + .drive + .fetch_contract_document_removals( + self.contract.id(), + &ContractDocumentRemovalsQuery { + document_type_name: POST.to_string(), + selection: ContractDocumentRemovalsSelection::DocumentIds(vec![document_id]), + }, + transaction, + PlatformVersion::latest(), + ) + .expect("expected to fetch the removal") + .pop() + .map(|entry| entry.removal) + } + + fn balance(&self, identity_id: Identifier, transaction: Option<&Transaction>) -> Credits { + self.platform + .drive + .fetch_identity_balance( + identity_id.to_buffer(), + transaction, + PlatformVersion::latest(), + ) + .expect("expected to fetch the balance") + .expect("expected the identity to have a balance") + } + + /// Proves the committed state for a document deletion and checks the proof shows its + /// record. + fn assert_removal_proved(&self, transition: &StateTransition) -> ContractDocumentRemoval { + let platform_version = PlatformVersion::latest(); + let proof = self + .platform + .drive + .prove_state_transition(transition, None, platform_version) + .expect("expected to prove the state transition") + .into_data() + .expect("expected proof bytes"); + let (_, outcome) = Drive::verify_state_transition_was_executed_with_proof( + transition, + &BlockInfo::default(), + &proof, + &|_| Ok(None), + platform_version, + ) + .expect("expected the proof to verify"); + match outcome { + StateTransitionProofOutcome::AffectedState( + StateTransitionProofResult::VerifiedContractDocumentRemoval( + contract_id, + document_type_name, + _, + removal, + ), + ) => { + assert_eq!(contract_id, self.contract.id()); + assert_eq!(document_type_name, POST); + removal + } + other => panic!("expected a document removal, got {other:?}"), + } + } + /// The deletion of `document` by `actor`, its owner async fn delete_document(&self, actor: &Actor, document: Document) -> StateTransition { let document_type = self @@ -1528,3 +1656,655 @@ async fn should_keep_a_barred_identity_from_receiving_or_selling_documents() { .expect("expected the purchase"); assert_success(&process(&purchase, &transaction)); } + +// ---- document deletion by moderators ---------------------------------------------------- + +fn post_schema(deletable_by_moderators: bool) -> Value { + platform_value!({ + "type": "object", + "properties": { + "text": { "type": "string", "maxLength": 50, "position": 0 }, + }, + "required": ["text"], + "additionalProperties": false, + "canBeDeletedByModerators": deletable_by_moderators, + }) +} + +fn add_document_type(contract: &mut DataContract, name: &str, schema: Value) { + contract + .set_document_schema(name, schema, true, &mut vec![], PlatformVersion::latest()) + .expect("expected to add the document type"); +} + +fn delete_action( + document_type_name: &str, + document_id: Identifier, +) -> ContractUserModerationAction { + ContractUserModerationAction::DeleteDocument { + document_type_name: document_type_name.to_string(), + document_id, + reason: deletion_reason(), + } +} + +fn deletion_reason() -> ContractModerationReason { + ContractModerationReason { + code: Some(3), + text: "spam".to_string(), + } +} + +/// No list at all: the moderators of this contract only delete posts. +fn moderators_without_lists() -> ContractModerationConfig { + moderation(false, false, THE_MODERATOR) +} + +#[tokio::test] +async fn should_let_a_moderator_delete_a_post_leave_its_record_and_refund_nobody() { + let setup = Setup::new_with_posts(Some(moderators_without_lists())).await; + let user_id = setup.user.id(); + + let transaction = setup.platform.drive.grove.start_transaction(); + let (post, create) = setup.create_document_of_type(&setup.user, POST).await; + assert_success(&setup.process(&create, &transaction)); + setup.commit(transaction); + let balance_before = setup.balance(user_id, None); + + let delete = setup + .moderate(&setup.moderator, delete_action(POST, post.id())) + .await; + // The mempool takes it, as it does a ban. + assert!(setup.check_tx(&delete).is_empty()); + + let transaction = setup.platform.drive.grove.start_transaction(); + assert_success(&setup.process(&delete, &transaction)); + setup.commit(transaction); + + // The post is gone: its author can not delete it any more. + let transaction = setup.platform.drive.grove.start_transaction(); + let own_delete = BatchTransition::new_document_deletion_transition_from_document( + post.clone(), + setup + .contract + .document_type_for_name(POST) + .expect("expected the post type"), + &setup.user.key, + setup.user.contract_nonce(), + 0, + None, + &setup.user.signer, + PlatformVersion::latest(), + None, + ) + .await + .expect("expected to build the document deletion"); + let execution = setup.process(&own_delete, &transaction); + assert!( + matches!(&execution, StateTransitionExecutionResult::PaidConsensusError { error, .. } + if matches!(error, ConsensusError::StateError(StateError::DocumentNotFoundError(_)))), + "expected the post to be gone, got {execution:?}" + ); + drop(transaction); + + // Its record says whose it was, who removed it, why and when. + let expected = ContractDocumentRemoval { + document_owner_id: user_id, + moderator_id: setup.moderator.id(), + reason: deletion_reason(), + removed_at: BLOCK_TIME_MS, + }; + assert_eq!(setup.post_removal(post.id(), None), Some(expected.clone())); + assert_eq!(setup.assert_removal_proved(&delete), expected); + + // The author paid for the post's storage and gets nothing back. + assert_eq!(setup.balance(user_id, None), balance_before); +} + +#[tokio::test] +async fn should_refund_the_author_who_deletes_the_same_post_themselves() { + // The control of the test above: the forfeiture is the moderator's deletion, not the + // document type. + let setup = Setup::new_with_posts(Some(moderators_without_lists())).await; + let user_id = setup.user.id(); + + let transaction = setup.platform.drive.grove.start_transaction(); + let (post, create) = setup.create_document_of_type(&setup.user, POST).await; + assert_success(&setup.process(&create, &transaction)); + setup.commit(transaction); + let balance_before = setup.balance(user_id, None); + + let transaction = setup.platform.drive.grove.start_transaction(); + let own_delete = BatchTransition::new_document_deletion_transition_from_document( + post.clone(), + setup + .contract + .document_type_for_name(POST) + .expect("expected the post type"), + &setup.user.key, + setup.user.contract_nonce(), + 0, + None, + &setup.user.signer, + PlatformVersion::latest(), + None, + ) + .await + .expect("expected to build the document deletion"); + assert_success(&setup.process(&own_delete, &transaction)); + setup.commit(transaction); + + assert!( + setup.balance(user_id, None) > balance_before, + "the storage refund outweighs the deletion's processing fee" + ); + assert_eq!(setup.post_removal(post.id(), None), None); +} + +#[tokio::test] +async fn should_refuse_a_document_deletion_that_breaks_a_rule() { + let setup = Setup::new_with_posts(Some(moderators_without_lists())).await; + + let transaction = setup.platform.drive.grove.start_transaction(); + let (post, create) = setup.create_document_of_type(&setup.user, POST).await; + assert_success(&setup.process(&create, &transaction)); + let (owners_post, create) = setup.create_document_of_type(&setup.owner, POST).await; + assert_success(&setup.process(&create, &transaction)); + let (moderators_post, create) = setup.create_document_of_type(&setup.moderator, POST).await; + assert_success(&setup.process(&create, &transaction)); + let (nice_document, create) = setup.create_document_keeping_it(&setup.user).await; + assert_success(&setup.process(&create, &transaction)); + + // Nobody but the owner and the moderators. + let by_stranger = setup + .moderate(&setup.stranger, delete_action(POST, post.id())) + .await; + assert_paid_with_code( + &setup.process(&by_stranger, &transaction), + IDENTITY_NOT_CONTRACT_MODERATOR, + ); + assert_eq!( + setup.check_tx(&by_stranger)[0].code(), + IDENTITY_NOT_CONTRACT_MODERATOR + ); + // Not the author through this transition either: an author uses a document deletion. + let by_author = setup + .moderate(&setup.user, delete_action(POST, post.id())) + .await; + assert_paid_with_code( + &setup.process(&by_author, &transaction), + IDENTITY_NOT_CONTRACT_MODERATOR, + ); + + // Only a document type that says so. + let of_another_type = setup + .moderate( + &setup.moderator, + delete_action(DOCUMENT_TYPE, nice_document.id()), + ) + .await; + assert_paid_with_code( + &setup.process(&of_another_type, &transaction), + DOCUMENT_TYPE_NOT_DELETABLE_BY_MODERATORS, + ); + let of_no_type = setup + .moderate(&setup.moderator, delete_action("comment", post.id())) + .await; + assert_paid_with_code( + &setup.process(&of_no_type, &transaction), + INVALID_DOCUMENT_TYPE, + ); + + // Only a document that exists. + let of_nothing = setup + .moderate( + &setup.moderator, + delete_action(POST, Identifier::from([0x5a; 32])), + ) + .await; + let execution = setup.process(&of_nothing, &transaction); + assert!( + matches!(&execution, StateTransitionExecutionResult::PaidConsensusError { error, .. } + if matches!(error, ConsensusError::StateError(StateError::DocumentNotFoundError(_)))), + "expected a paid document not found error, got {execution:?}" + ); + + // Never the owner's or a moderator's, whoever asks. + for (actor, document) in [ + (&setup.moderator, &owners_post), + (&setup.owner, &moderators_post), + ] { + let protected = setup + .moderate(actor, delete_action(POST, document.id())) + .await; + assert_paid_with_code( + &setup.process(&protected, &transaction), + CONTRACT_MODERATION_TARGET_NOT_ALLOWED, + ); + } + + // A reason within the limit, refused before anything is paid. + let too_long = setup + .moderate( + &setup.moderator, + ContractUserModerationAction::DeleteDocument { + document_type_name: POST.to_string(), + document_id: post.id(), + reason: ContractModerationReason::from_text( + &"x".repeat( + PlatformVersion::latest() + .system_limits + .max_contract_moderation_reason_length as usize + + 1, + ), + ), + }, + ) + .await; + assert_unpaid_with_code( + &setup.process(&too_long, &transaction), + CONTRACT_MODERATION_REASON_TOO_LONG, + ); + + // None of it touched the post, and the owner may delete it as any moderator may, with no + // reason at all. + assert_eq!(setup.post_removal(post.id(), Some(&transaction)), None); + let by_owner = setup + .moderate( + &setup.owner, + ContractUserModerationAction::DeleteDocument { + document_type_name: POST.to_string(), + document_id: post.id(), + reason: ContractModerationReason::default(), + }, + ) + .await; + assert_success(&setup.process(&by_owner, &transaction)); + let removal = setup + .post_removal(post.id(), Some(&transaction)) + .expect("expected the record"); + assert_eq!(removal.moderator_id, setup.owner.id()); + assert_eq!(removal.reason, ContractModerationReason::default()); +} + +#[tokio::test] +async fn should_tie_the_document_type_keyword_to_the_moderation_declaration() { + // A document type moderators could delete from on a contract without moderation is + // refused where the document type is parsed (`moderators_delete_tests` in dpp), with the + // consensus error a contract create turns into a paid refusal. + let mut unmoderated = get_data_contract_fixture(None, 0, 14).data_contract_owned(); + let refusal = unmoderated + .set_document_schema( + POST, + post_schema(true), + true, + &mut vec![], + PlatformVersion::latest(), + ) + .expect_err("expected the document type to be refused"); + assert!( + matches!(&refusal, ProtocolError::ConsensusError(error) + if error.code() == INVALID_CONTRACT_STRUCTURE), + "expected an invalid contract structure, got {refusal:?}" + ); + + // No list and no such document type: the moderators would have nothing to do. + let setup = Setup::new(None).await; + let transaction = setup.platform.drive.grove.start_transaction(); + let identity_nonce = setup.owner.identity_nonce(); + let mut idle = get_data_contract_fixture( + Some(setup.owner.id()), + identity_nonce, + PlatformVersion::latest().protocol_version, + ) + .data_contract_owned(); + idle.set_config( + idle.config() + .clone() + .with_moderation(Some(ContractModerationConfig { + banlist: false, + suspensions: false, + moderators: ContractModerators::ContractOwner, + })), + ); + let create = DataContractCreateTransition::new_from_data_contract( + idle, + identity_nonce, + &setup.owner.identity.clone().into_partial_identity_info(), + CRITICAL_KEY_ID, + &setup.owner.signer, + PlatformVersion::latest(), + None, + ) + .await + .expect("expected to build the contract create"); + assert_unpaid_with_code( + &setup.process(&create, &transaction), + INVALID_CONTRACT_MODERATION_CONFIG, + ); +} + +#[tokio::test] +async fn should_fix_the_keyword_of_a_document_type_and_let_an_update_add_a_type_with_it() { + // Lists only to start with. + let mut setup = Setup::new(Some(moderation(true, false, THE_MODERATOR))).await; + + // An existing document type can not become one moderators delete from. + let transaction = setup.platform.drive.grove.start_transaction(); + let mut flipped = setup.contract.clone(); + flipped.increment_version(); + let mut nice_document_schema = flipped + .document_type_for_name(DOCUMENT_TYPE) + .expect("expected the document type") + .schema() + .clone(); + nice_document_schema + .insert("canBeDeletedByModerators".to_string(), Value::Bool(true)) + .expect("expected to set the keyword"); + add_document_type(&mut flipped, DOCUMENT_TYPE, nice_document_schema); + let update = setup.contract_update(flipped).await; + assert_paid_with_code(&setup.process(&update, &transaction), DOCUMENT_TYPE_UPDATE); + drop(transaction); + + // A document type the update adds may be one, and then its documents can be deleted. + let transaction = setup.platform.drive.grove.start_transaction(); + let mut with_posts = setup.contract.clone(); + with_posts.increment_version(); + // `canBeDeleted: false`, so that what follows about references depends on the moderators' + // keyword alone. + add_document_type( + &mut with_posts, + POST, + post_schema_with(platform_value!({ "canBeDeleted": false })), + ); + let update = setup.contract_update(with_posts.clone()).await; + assert_success(&setup.process(&update, &transaction)); + setup.contract = with_posts; + + let (post, create) = setup.create_document_of_type(&setup.user, POST).await; + assert_success(&setup.process(&create, &transaction)); + let delete = setup + .moderate(&setup.moderator, delete_action(POST, post.id())) + .await; + assert_success(&setup.process(&delete, &transaction)); + assert!(setup.post_removal(post.id(), Some(&transaction)).is_some()); + + // And it can not be the target of a permanent reference: its documents can vanish. + let mut referring = setup.contract.clone(); + referring.increment_version(); + add_document_type( + &mut referring, + "bookmark", + platform_value!({ + "type": "object", + "properties": { + "postId": { + "type": "array", + "byteArray": true, + "minItems": 32, + "maxItems": 32, + "contentMediaType": "application/x.dash.dpp.identifier", + "refersTo": { "type": "permanentDocument", "documentType": POST }, + "position": 0, + }, + }, + "required": ["postId"], + "additionalProperties": false, + }), + ); + let update = setup.contract_update(referring.clone()).await; + assert_paid_with_code( + &setup.process(&update, &transaction), + REFERENCED_DOCUMENT_TYPE_DELETABLE, + ); + + // A deletable reference is what points at it: deletable means by anyone, the moderators + // included, whatever `canBeDeleted` says about a post's own author. + let bookmark_schema = referring + .document_type_for_name("bookmark") + .expect("expected the bookmark type") + .schema() + .clone(); + let mut deletable_reference = bookmark_schema; + deletable_reference + .get_mut("properties") + .ok() + .flatten() + .and_then(|properties| properties.get_mut("postId").ok().flatten()) + .and_then(|post_id| post_id.get_mut("refersTo").ok().flatten()) + .expect("expected the refersTo declaration") + .insert( + "type".to_string(), + Value::Text("deletableDocument".to_string()), + ) + .expect("expected to set the reference kind"); + let mut referring = setup.contract.clone(); + referring.increment_version(); + add_document_type(&mut referring, "bookmark", deletable_reference); + let update = setup.contract_update(referring.clone()).await; + assert_success(&setup.process(&update, &transaction)); + setup.contract = referring; + + // And at document write: a bookmark of a post that exists is admitted. + let (kept_post, create) = setup.create_document_of_type(&setup.user, POST).await; + assert_success(&setup.process(&create, &transaction)); + let post_id = kept_post.id(); + let (_, bookmark) = setup + .create_document_of_type_with(&setup.stranger, "bookmark", |bookmark| { + bookmark.set("postId", post_id.into()) + }) + .await; + assert_success(&setup.process(&bookmark, &transaction)); +} + +/// `post_schema(true)` with further document type keywords +fn post_schema_with(extra: Value) -> Value { + let mut schema = post_schema(true); + if let (Value::Map(schema_map), Value::Map(extra_map)) = (&mut schema, extra) { + schema_map.extend(extra_map); + } + schema +} + +/// The deletion of `document`, of the `post` type, by `actor`, its owner +async fn own_post_deletion(setup: &Setup, actor: &Actor, document: Document) -> StateTransition { + BatchTransition::new_document_deletion_transition_from_document( + document, + setup + .contract + .document_type_for_name(POST) + .expect("expected the post type"), + &actor.key, + actor.contract_nonce(), + 0, + None, + &actor.signer, + PlatformVersion::latest(), + None, + ) + .await + .expect("expected to build the document deletion") +} + +#[tokio::test] +async fn should_let_a_moderator_delete_a_post_its_author_can_not_delete() { + // `canBeDeleted` is the author's rule: a post nobody can retract that moderation can + // remove is what the keyword is for, and Drive's own guard on `canBeDeleted` must not + // stand in the moderators' way. + let setup = Setup::new_at_with( + Some(moderators_without_lists()), + PlatformVersion::latest(), + |contract| { + add_document_type( + contract, + POST, + post_schema_with(platform_value!({ "canBeDeleted": false })), + ) + }, + ) + .await; + + let transaction = setup.platform.drive.grove.start_transaction(); + let (post, create) = setup.create_document_of_type(&setup.user, POST).await; + assert_success(&setup.process(&create, &transaction)); + + let own_delete = own_post_deletion(&setup, &setup.user, post.clone()).await; + let execution = setup.process(&own_delete, &transaction); + assert!( + matches!( + &execution, + StateTransitionExecutionResult::PaidConsensusError { .. } + ), + "expected the author's deletion to be refused, got {execution:?}" + ); + assert_eq!(setup.post_removal(post.id(), Some(&transaction)), None); + + let delete = setup + .moderate(&setup.moderator, delete_action(POST, post.id())) + .await; + assert_success(&setup.process(&delete, &transaction)); + setup.commit(transaction); + // The mempool's fee estimate runs the same deletion: it takes the next one too. + let (another, create) = setup.create_document_of_type(&setup.user, POST).await; + let transaction = setup.platform.drive.grove.start_transaction(); + assert_success(&setup.process(&create, &transaction)); + setup.commit(transaction); + let delete_another = setup + .moderate(&setup.moderator, delete_action(POST, another.id())) + .await; + assert!(setup.check_tx(&delete_another).is_empty()); + + let removal = setup + .post_removal(post.id(), None) + .expect("expected the record"); + assert_eq!(removal.document_owner_id, setup.user.id()); +} + +#[tokio::test] +async fn should_delete_a_transferred_post_and_record_the_owner_it_had() { + let setup = Setup::new_at_with( + Some(moderators_without_lists()), + PlatformVersion::latest(), + |contract| { + add_document_type( + contract, + POST, + post_schema_with(platform_value!({ + "transferable": 1, + "documentsMutable": false, + })), + ) + }, + ) + .await; + + let transaction = setup.platform.drive.grove.start_transaction(); + let (mut post, create) = setup.create_document_of_type(&setup.user, POST).await; + assert_success(&setup.process(&create, &transaction)); + + post.set_revision(Some(2)); + let transfer = BatchTransition::new_document_transfer_transition_from_document( + post.clone(), + setup + .contract + .document_type_for_name(POST) + .expect("expected the post type"), + setup.stranger.id(), + &setup.user.key, + setup.user.contract_nonce(), + 0, + None, + &setup.user.signer, + PlatformVersion::latest(), + None, + ) + .await + .expect("expected the transfer"); + assert_success(&setup.process(&transfer, &transaction)); + setup.commit(transaction); + + let author_before = setup.balance(setup.user.id(), None); + let holder_before = setup.balance(setup.stranger.id(), None); + + let transaction = setup.platform.drive.grove.start_transaction(); + let delete = setup + .moderate(&setup.moderator, delete_action(POST, post.id())) + .await; + assert_success(&setup.process(&delete, &transaction)); + setup.commit(transaction); + + // The record names who held the post when it was removed, and neither that identity nor + // the one that first paid for the post is refunded. + let removal = setup + .post_removal(post.id(), None) + .expect("expected the record"); + assert_eq!(removal.document_owner_id, setup.stranger.id()); + assert_eq!(setup.balance(setup.user.id(), None), author_before); + assert_eq!(setup.balance(setup.stranger.id(), None), holder_before); +} + +#[tokio::test] +async fn should_charge_a_moderator_no_token_for_a_post_whose_deletion_costs_tokens() { + let mut setup = Setup::new(None).await; + let platform_version = PlatformVersion::latest(); + + // A second contract with a token, whose posts cost their author tokens to delete. It goes + // straight into Drive: the token's own declaration is not what is tested here. + let mut contract = get_data_contract_fixture( + Some(setup.owner.id()), + 77, + platform_version.protocol_version, + ) + .data_contract_owned(); + contract.set_config(contract.config().clone().with_moderation(Some(moderation( + false, + false, + setup.moderator.id(), + )))); + contract.add_token( + 0, + TokenConfiguration::V0(TokenConfigurationV0::default_most_restrictive()), + ); + add_document_type( + &mut contract, + POST, + post_schema_with(platform_value!({ + "tokenCost": { "delete": { "tokenPosition": 0, "amount": 5 } }, + })), + ); + setup + .platform + .drive + .apply_contract( + &contract, + BlockInfo::default(), + true, + StorageFlags::optional_default_as_cow(), + None, + platform_version, + ) + .expect("expected to store the contract"); + setup.contract = contract; + + let transaction = setup.platform.drive.grove.start_transaction(); + let (post, create) = setup.create_document_of_type(&setup.user, POST).await; + assert_success(&setup.process(&create, &transaction)); + + // The author holds no token and can not pay for the deletion. + let own_delete = own_post_deletion(&setup, &setup.user, post.clone()).await; + let execution = setup.process(&own_delete, &transaction); + assert!( + matches!( + &execution, + StateTransitionExecutionResult::PaidConsensusError { .. } + ), + "expected the author's unpaid deletion to be refused, got {execution:?}" + ); + + // The moderator holds none either, and is asked for none. + let delete = setup + .moderate(&setup.moderator, delete_action(POST, post.id())) + .await; + assert_success(&setup.process(&delete, &transaction)); + assert!(setup.post_removal(post.id(), Some(&transaction)).is_some()); +} diff --git a/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/data_contract_common/data_contract_reference_validation/v0/mod.rs b/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/data_contract_common/data_contract_reference_validation/v0/mod.rs index 7a5c0f7b513..d64954e4e30 100644 --- a/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/data_contract_common/data_contract_reference_validation/v0/mod.rs +++ b/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/data_contract_common/data_contract_reference_validation/v0/mod.rs @@ -1,6 +1,6 @@ use dpp::block::block_info::BlockInfo; use dpp::data_contract::accessors::v0::DataContractV0Getters; -use dpp::data_contract::document_type::accessors::DocumentTypeV0Getters; +use dpp::data_contract::document_type::accessors::{DocumentTypeV0Getters, DocumentTypeV2Getters}; use dpp::data_contract::document_type::{ is_referenced_system_agreement_property, is_referring_system_agreement_property, DocumentPropertyReferenceTarget, DocumentPropertyType, DocumentReferenceDeclaration, @@ -199,8 +199,12 @@ pub(super) fn validate_data_contract_references_v0( // `permanentDocument` one demands a document type that forbids // deletion, a `deletableDocument` one a document type that // allows it, so the declaration always states which guarantee - // the reference carries - let target_is_deletable = referenced_document_type.documents_can_be_deleted(); + // the reference carries. Deletable means by anyone: a document type moderators + // can delete from is deletable whatever its `canBeDeleted` says about a document's + // own owner, since a reference to it could dangle. Neither flag can change on an + // update, so the answer holds for good. + let target_is_deletable = referenced_document_type.documents_can_be_deleted() + || referenced_document_type.documents_can_be_deleted_by_moderators(); if permanent && target_is_deletable { return Ok(SimpleConsensusValidationResult::new_with_error( ReferencedDocumentTypeDeletableError::new( diff --git a/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/data_contract_create/basic_structure/v2/mod.rs b/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/data_contract_create/basic_structure/v2/mod.rs index 56d47fbd808..dee46deaf18 100644 --- a/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/data_contract_create/basic_structure/v2/mod.rs +++ b/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/data_contract_create/basic_structure/v2/mod.rs @@ -127,11 +127,15 @@ impl DataContractCreateStateTransitionBasicStructureValidationV2 for DataContrac } } - // Contract moderation: a config that declares it must be well formed (at least one - // list, a non-empty moderator set within the limit). That the named moderators exist + // Contract moderation: a config that declares it must be well formed (a list or a + // document type moderators can delete, a non-empty moderator set within the limit). That the named moderators exist // is checked against the state. if let Some(moderation) = self.data_contract().config().moderation() { - let result = moderation.validate(platform_version)?; + let result = moderation.validate( + self.data_contract() + .has_document_type_deletable_by_moderators(), + platform_version, + )?; if !result.is_valid() { return Ok(result); } diff --git a/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/data_contract_update/basic_structure/v2/mod.rs b/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/data_contract_update/basic_structure/v2/mod.rs index 6a7c3c308ab..3eb81cd5cbb 100644 --- a/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/data_contract_update/basic_structure/v2/mod.rs +++ b/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/data_contract_update/basic_structure/v2/mod.rs @@ -21,8 +21,8 @@ pub(in crate::execution::validation::state_transition::state_transitions::data_c impl DataContractUpdateStateTransitionBasicStructureValidationV2 for DataContractUpdateTransition { /// Generation 2 (protocol version 14): generation 1, and a config that declares - /// moderation must be well formed (at least one list, a non-empty moderator set within - /// the limit). Whether a list may be turned off is judged against the stored contract by + /// moderation must be well formed (a list or a document type moderators can delete, a + /// non-empty moderator set within the limit). Whether a list may be turned off is judged against the stored contract by /// the state validation's config update rules, and that a newly named moderator exists /// by the state validation too. fn validate_basic_structure_v2( @@ -36,7 +36,11 @@ impl DataContractUpdateStateTransitionBasicStructureValidationV2 for DataContrac } if let Some(moderation) = self.data_contract().config().moderation() { - let result = moderation.validate(platform_version)?; + let result = moderation.validate( + self.data_contract() + .has_document_type_deletable_by_moderators(), + platform_version, + )?; if !result.is_valid() { return Ok(result); } diff --git a/packages/rs-drive-abci/src/query/contract_moderation_queries/contract_document_removals/mod.rs b/packages/rs-drive-abci/src/query/contract_moderation_queries/contract_document_removals/mod.rs new file mode 100644 index 00000000000..4f46356d0ef --- /dev/null +++ b/packages/rs-drive-abci/src/query/contract_moderation_queries/contract_document_removals/mod.rs @@ -0,0 +1,90 @@ +use crate::error::query::QueryError; +use crate::error::Error; +use crate::platform_types::platform::Platform; +use crate::platform_types::platform_state::PlatformState; +use crate::query::QueryValidationResult; +use dapi_grpc::platform::v0::get_contract_document_removals_request::Version as RequestVersion; +use dapi_grpc::platform::v0::get_contract_document_removals_response::Version as ResponseVersion; +use dapi_grpc::platform::v0::{ + GetContractDocumentRemovalsRequest, GetContractDocumentRemovalsResponse, +}; +use dpp::version::PlatformVersion; + +mod v0; + +impl Platform { + /// Querying of the records of the documents a contract\'s moderators deleted + pub fn query_contract_document_removals( + &self, + GetContractDocumentRemovalsRequest { version }: GetContractDocumentRemovalsRequest, + platform_state: &PlatformState, + platform_version: &PlatformVersion, + ) -> Result, Error> { + let Some(version) = version else { + return Ok(QueryValidationResult::new_with_error( + QueryError::DecodingError( + "could not decode contract document removals query".to_string(), + ), + )); + }; + + let feature_version_bounds = &platform_version + .drive_abci + .query + .contract_moderation_queries + .contract_document_removals; + + let feature_version = match &version { + RequestVersion::V0(_) => 0, + }; + if !feature_version_bounds.check_version(feature_version) { + return Ok(QueryValidationResult::new_with_error( + QueryError::UnsupportedQueryVersion( + "contract_document_removals".to_string(), + feature_version_bounds.min_version, + feature_version_bounds.max_version, + platform_version.protocol_version, + feature_version, + ), + )); + } + match version { + RequestVersion::V0(request_v0) => { + let result = self.query_contract_document_removals_v0( + request_v0, + platform_state, + platform_version, + )?; + + Ok( + result.map(|response_v0| GetContractDocumentRemovalsResponse { + version: Some(ResponseVersion::V0(response_v0)), + }), + ) + } + } + } +} + +#[cfg(test)] +mod tests { + use super::*; + use crate::query::tests::setup_platform; + use dpp::dashcore::Network; + + #[test] + fn should_refuse_a_request_without_a_version() { + let (platform, state, version) = setup_platform(None, Network::Testnet, None); + let result = platform + .query_contract_document_removals( + GetContractDocumentRemovalsRequest { version: None }, + &state, + version, + ) + .expect("expected the query to run"); + assert!(matches!( + result.errors.as_slice(), + [QueryError::DecodingError(_)] + )); + } +} diff --git a/packages/rs-drive-abci/src/query/contract_moderation_queries/contract_document_removals/v0/mod.rs b/packages/rs-drive-abci/src/query/contract_moderation_queries/contract_document_removals/v0/mod.rs new file mode 100644 index 00000000000..62f8970c95f --- /dev/null +++ b/packages/rs-drive-abci/src/query/contract_moderation_queries/contract_document_removals/v0/mod.rs @@ -0,0 +1,417 @@ +use crate::error::query::QueryError; +use crate::error::Error; +use crate::platform_types::platform::Platform; +use crate::platform_types::platform_state::PlatformState; +use crate::query::contract_moderation_queries::{identifier_from_request, reason_to_response}; +use crate::query::response_metadata::CheckpointUsed; +use crate::query::QueryValidationResult; +use dapi_grpc::platform::v0::get_contract_document_removals_request::get_contract_document_removals_request_v0::Selection; +use dapi_grpc::platform::v0::get_contract_document_removals_request::{ + DocumentIds, GetContractDocumentRemovalsRequestV0, Page, +}; +use dapi_grpc::platform::v0::get_contract_document_removals_response::{ + get_contract_document_removals_response_v0, + ContractDocumentRemoval as ContractDocumentRemovalProto, ContractDocumentRemovals, + GetContractDocumentRemovalsResponseV0, +}; +use dpp::check_validation_result_with_data; +use dpp::data_contract::accessors::v0::DataContractV0Getters; +use dpp::data_contract::document_type::accessors::DocumentTypeV2Getters; +use dpp::identifier::Identifier; +use dpp::validation::ValidationResult; +use dpp::version::PlatformVersion; +use drive::drive::contract::moderation::types::{ + ContractDocumentRemovalsQuery, ContractDocumentRemovalsSelection, +}; +use drive::drive::Drive; +use drive::util::grove_operations::GroveDBToUse; + +impl Platform { + /// Returns the records of the documents a contract's moderators deleted, within one + /// document type: the ones of the document ids named, or one page in document id order. + /// The document type must be one whose documents moderators may delete: no other keeps + /// records, and a proof over a tree that does not exist could not be built. + pub(super) fn query_contract_document_removals_v0( + &self, + GetContractDocumentRemovalsRequestV0 { + contract_id, + document_type_name, + selection, + prove, + }: GetContractDocumentRemovalsRequestV0, + platform_state: &PlatformState, + platform_version: &PlatformVersion, + ) -> Result, Error> { + let contract_id = + check_validation_result_with_data!(identifier_from_request(contract_id, "contract_id")); + let selection = match selection { + None => { + return Ok(QueryValidationResult::new_with_error( + QueryError::InvalidArgument( + "either document_ids or page must be set".to_string(), + ), + )) + } + Some(Selection::DocumentIds(DocumentIds { document_ids })) => { + ContractDocumentRemovalsSelection::DocumentIds(check_validation_result_with_data!( + document_ids + .into_iter() + .map(|bytes| identifier_from_request(bytes, "document_ids")) + .collect::, _>>() + )) + } + Some(Selection::Page(Page { start_after, limit })) => { + ContractDocumentRemovalsSelection::Page { + start_after: check_validation_result_with_data!(start_after + .map(|bytes| identifier_from_request(bytes, "start_after")) + .transpose()), + // The page size when the request names none: the largest page, the number + // the proof verifier assumes as well. A limit no u16 holds is past every + // bound, and is refused below as the largest u16 is. + limit: limit.map_or( + platform_version.drive_abci.query.max_returned_elements, + |limit| u16::try_from(limit).unwrap_or(u16::MAX), + ), + } + } + }; + let query = ContractDocumentRemovalsQuery { + document_type_name, + selection, + }; + // The bounds of a read are Drive's, which the proof verifier calls too. Refused here as + // an invalid argument: left to the fetch or the proof below, the same refusal would + // reach the client as an unknown node failure. + if let Err(error) = Drive::check_contract_document_removals_query(&query, platform_version) + { + return Ok(QueryValidationResult::new_with_error( + QueryError::InvalidArgument(error.to_string()), + )); + } + + let Some(contract_fetch_info) = self.drive.get_contract_with_fetch_info( + contract_id.to_buffer(), + false, + None, + platform_version, + )? + else { + return Ok(QueryValidationResult::new_with_error(QueryError::NotFound( + format!("contract {} not found", contract_id), + ))); + }; + let deletable_by_moderators = contract_fetch_info + .contract + .document_type_optional_for_name(&query.document_type_name) + .is_some_and(|document_type| document_type.documents_can_be_deleted_by_moderators()); + if !deletable_by_moderators { + return Ok(QueryValidationResult::new_with_error( + QueryError::InvalidArgument(format!( + "contract {} has no document type {} whose documents moderators can delete", + contract_id, query.document_type_name + )), + )); + } + + let response = if prove { + let proof = check_validation_result_with_data!(self + .drive + .prove_contract_document_removals(contract_id, &query, None, platform_version)); + + GetContractDocumentRemovalsResponseV0 { + result: Some(get_contract_document_removals_response_v0::Result::Proof( + self.response_proof_v0(platform_state, proof, GroveDBToUse::Current) + .map(|(_, proof)| proof)?, + )), + metadata: Some(self.response_metadata_v0(platform_state, CheckpointUsed::Current)), + } + } else { + let entries = check_validation_result_with_data!(self + .drive + .fetch_contract_document_removals(contract_id, &query, None, platform_version)); + + GetContractDocumentRemovalsResponseV0 { + result: Some( + get_contract_document_removals_response_v0::Result::Removals( + ContractDocumentRemovals { + removals: entries + .into_iter() + .map(|entry| ContractDocumentRemovalProto { + document_id: entry.document_id.to_vec(), + document_owner_id: entry.removal.document_owner_id.to_vec(), + moderator_id: entry.removal.moderator_id.to_vec(), + removed_at: entry.removal.removed_at, + reason: Some(reason_to_response(entry.removal.reason)), + }) + .collect(), + }, + ), + ), + metadata: Some(self.response_metadata_v0(platform_state, CheckpointUsed::Current)), + } + }; + + Ok(QueryValidationResult::new_with_data(response)) + } +} + +#[cfg(test)] +mod tests { + use super::*; + use crate::query::tests::{setup_platform, store_data_contract}; + use dapi_grpc::platform::v0::ContractModerationReason as ContractModerationReasonProto; + use dpp::block::block_info::BlockInfo; + use dpp::dashcore::Network; + use dpp::data_contract::accessors::v0::DataContractV0Setters; + use dpp::data_contract::config::moderation::{ + ContractDocumentRemoval, ContractModerationConfig, ContractModerationReason, + ContractModerators, + }; + use dpp::data_contract::schema::DataContractSchemaMethodsV0; + use dpp::data_contract::DataContract; + use dpp::platform_value::platform_value; + use dpp::tests::fixtures::get_data_contract_fixture; + use drive::drive::Drive; + use drive::util::batch::{ContractModerationOperationType, DriveOperation}; + + const POST: &str = "post"; + + fn contract_with_posts() -> DataContract { + let platform_version = PlatformVersion::latest(); + let mut contract = get_data_contract_fixture(None, 0, platform_version.protocol_version) + .data_contract_owned(); + contract.set_config(contract.config().clone().with_moderation(Some( + ContractModerationConfig { + banlist: false, + suspensions: false, + moderators: ContractModerators::ContractOwner, + }, + ))); + contract + .set_document_schema( + POST, + platform_value!({ + "type": "object", + "properties": { + "text": { "type": "string", "maxLength": 50, "position": 0 }, + }, + "additionalProperties": false, + "canBeDeletedByModerators": true, + }), + true, + &mut vec![], + platform_version, + ) + .expect("expected to add the post type"); + contract + } + + fn removal(seed: u8) -> ContractDocumentRemoval { + ContractDocumentRemoval { + document_owner_id: Identifier::from([seed + 0x10; 32]), + moderator_id: Identifier::from([0x77; 32]), + reason: ContractModerationReason { + code: Some(seed as u16), + text: "spam".to_string(), + }, + removed_at: 1_000 + seed as u64, + } + } + + fn record(drive: &Drive, contract: &DataContract, seed: u8) { + drive + .apply_drive_operations( + vec![DriveOperation::ContractModerationOperation( + ContractModerationOperationType::AddDocumentRemoval { + contract_id: contract.id(), + document_type_name: POST.to_string(), + document_id: Identifier::from([seed; 32]), + removal: removal(seed), + }, + )], + true, + &BlockInfo::default(), + None, + PlatformVersion::latest(), + None, + ) + .expect("expected to record a removal"); + } + + fn request( + contract: &DataContract, + document_type_name: &str, + selection: Option, + prove: bool, + ) -> GetContractDocumentRemovalsRequestV0 { + GetContractDocumentRemovalsRequestV0 { + contract_id: contract.id().to_vec(), + document_type_name: document_type_name.to_string(), + selection, + prove, + } + } + + fn page(start_after: Option, limit: Option) -> Option { + Some(Selection::Page(Page { + start_after: start_after.map(|seed| vec![seed; 32]), + limit, + })) + } + + fn ids(seeds: &[u8]) -> Option { + Some(Selection::DocumentIds(DocumentIds { + document_ids: seeds.iter().map(|seed| vec![*seed; 32]).collect(), + })) + } + + fn proto(seed: u8) -> ContractDocumentRemovalProto { + let removal = removal(seed); + ContractDocumentRemovalProto { + document_id: vec![seed; 32], + document_owner_id: removal.document_owner_id.to_vec(), + moderator_id: removal.moderator_id.to_vec(), + removed_at: removal.removed_at, + reason: Some(ContractModerationReasonProto { + code: Some(seed as u32), + text: "spam".to_string(), + }), + } + } + + #[test] + fn should_return_the_records_by_ids_and_by_page() { + let (platform, state, version) = setup_platform(None, Network::Testnet, None); + let contract = contract_with_posts(); + store_data_contract(&platform, &contract, version); + for seed in [1, 2, 3] { + record(&platform.drive, &contract, seed); + } + + let removals = |selection| { + let result = platform + .query_contract_document_removals_v0( + request(&contract, POST, selection, false), + &state, + version, + ) + .expect("expected the query to run"); + assert!(result.is_valid(), "{:?}", result.errors); + match result.into_data().expect("expected data").result { + Some(get_contract_document_removals_response_v0::Result::Removals(removals)) => { + removals.removals + } + other => panic!("expected removals, got {other:?}"), + } + }; + + // An id with no record is left out. + assert_eq!(removals(ids(&[3, 9, 1])), vec![proto(1), proto(3)]); + assert_eq!(removals(page(None, Some(2))), vec![proto(1), proto(2)]); + assert_eq!(removals(page(Some(2), None)), vec![proto(3)]); + assert_eq!(removals(page(Some(3), None)), vec![]); + } + + #[test] + fn should_prove_the_records_the_verifier_reads_back() { + let (platform, state, version) = setup_platform(None, Network::Testnet, None); + let contract = contract_with_posts(); + store_data_contract(&platform, &contract, version); + record(&platform.drive, &contract, 1); + + for (selection, query) in [ + ( + ids(&[1, 9]), + ContractDocumentRemovalsQuery { + document_type_name: POST.to_string(), + selection: ContractDocumentRemovalsSelection::DocumentIds(vec![ + Identifier::from([1; 32]), + Identifier::from([9; 32]), + ]), + }, + ), + ( + // No limit named: the verifier assumes the largest page, as the node does. + page(None, None), + ContractDocumentRemovalsQuery { + document_type_name: POST.to_string(), + selection: ContractDocumentRemovalsSelection::Page { + start_after: None, + limit: version.drive_abci.query.max_returned_elements, + }, + }, + ), + ] { + let result = platform + .query_contract_document_removals_v0( + request(&contract, POST, selection, true), + &state, + version, + ) + .expect("expected the query to run"); + assert!(result.is_valid(), "{:?}", result.errors); + let Some(get_contract_document_removals_response_v0::Result::Proof(proof)) = + result.into_data().expect("expected data").result + else { + panic!("expected a proof"); + }; + let (_, entries) = Drive::verify_contract_document_removals( + &proof.grovedb_proof, + contract.id(), + &query, + version, + ) + .expect("expected the proof to verify"); + assert_eq!(entries.len(), 1); + assert_eq!(entries[0].document_id, Identifier::from([1; 32])); + assert_eq!(entries[0].removal, removal(1)); + } + } + + #[test] + fn should_refuse_a_request_it_can_not_answer() { + let (platform, state, version) = setup_platform(None, Network::Testnet, None); + let contract = contract_with_posts(); + store_data_contract(&platform, &contract, version); + let max = version.drive_abci.query.max_returned_elements as u32; + + let errors = |request| { + platform + .query_contract_document_removals_v0(request, &state, version) + .expect("expected the query to run") + .errors + }; + let invalid = |request| { + let errors = errors(request); + assert!( + matches!(errors.as_slice(), [QueryError::InvalidArgument(_)]), + "{errors:?}" + ); + }; + + invalid(request(&contract, POST, None, false)); + invalid(request(&contract, POST, ids(&[]), false)); + invalid(request(&contract, POST, ids(&[1, 1]), false)); + invalid(request(&contract, POST, page(None, Some(0)), true)); + invalid(request(&contract, POST, page(None, Some(max + 1)), true)); + invalid(request( + &contract, + POST, + Some(Selection::DocumentIds(DocumentIds { + document_ids: vec![vec![1; 31]], + })), + false, + )); + // A document type that keeps no records, and one the contract does not have: a proof + // over either would run into a tree that does not exist. + invalid(request(&contract, "niceDocument", page(None, None), true)); + invalid(request(&contract, "comment", page(None, None), true)); + + let mut unknown = request(&contract, POST, page(None, None), false); + unknown.contract_id = vec![0x5a; 32]; + assert!(matches!( + errors(unknown).as_slice(), + [QueryError::NotFound(_)] + )); + } +} diff --git a/packages/rs-drive-abci/src/query/contract_moderation_queries/mod.rs b/packages/rs-drive-abci/src/query/contract_moderation_queries/mod.rs index f0ffd5c9693..9a9d9cb7403 100644 --- a/packages/rs-drive-abci/src/query/contract_moderation_queries/mod.rs +++ b/packages/rs-drive-abci/src/query/contract_moderation_queries/mod.rs @@ -2,6 +2,7 @@ //! contract's banlist or suspension list, and the fee pots a contract's document action fees //! collect in. +mod contract_document_removals; mod contract_fee_pots; mod contract_moderation_entries; mod contract_moderation_status; diff --git a/packages/rs-drive-abci/src/query/service.rs b/packages/rs-drive-abci/src/query/service.rs index 85bbe347f79..8e51375daec 100644 --- a/packages/rs-drive-abci/src/query/service.rs +++ b/packages/rs-drive-abci/src/query/service.rs @@ -20,9 +20,10 @@ use dapi_grpc::platform::v0::{ GetContestedResourceIdentityVotesRequest, GetContestedResourceIdentityVotesResponse, GetContestedResourceVoteStateRequest, GetContestedResourceVoteStateResponse, GetContestedResourceVotersForIdentityRequest, GetContestedResourceVotersForIdentityResponse, - GetContestedResourcesRequest, GetContestedResourcesResponse, GetContractFeePotsRequest, - GetContractFeePotsResponse, GetContractGroupInfoRequest, GetContractGroupInfoResponse, - GetContractGroupMembersRequest, GetContractGroupMembersResponse, + GetContestedResourcesRequest, GetContestedResourcesResponse, + GetContractDocumentRemovalsRequest, GetContractDocumentRemovalsResponse, + GetContractFeePotsRequest, GetContractFeePotsResponse, GetContractGroupInfoRequest, + GetContractGroupInfoResponse, GetContractGroupMembersRequest, GetContractGroupMembersResponse, GetContractGroupsForContractRequest, GetContractGroupsForContractResponse, GetContractModerationEntriesRequest, GetContractModerationEntriesResponse, GetContractModerationStatusRequest, GetContractModerationStatusResponse, @@ -460,6 +461,18 @@ impl PlatformService for QueryService { .await } + async fn get_contract_document_removals( + &self, + request: Request, + ) -> Result, Status> { + self.handle_blocking_query( + request, + Platform::::query_contract_document_removals, + "get_contract_document_removals", + ) + .await + } + async fn get_contract_moderation_entries( &self, request: Request, diff --git a/packages/rs-drive-proof-verifier/src/proof/contract_moderation.rs b/packages/rs-drive-proof-verifier/src/proof/contract_moderation.rs index 36e206156ed..b43d507728a 100644 --- a/packages/rs-drive-proof-verifier/src/proof/contract_moderation.rs +++ b/packages/rs-drive-proof-verifier/src/proof/contract_moderation.rs @@ -2,17 +2,19 @@ use crate::error::MapGroveDbError; use crate::types::contract_moderation::{ - entries_query_from_request, identifier_from_request, lists_from_request, ContractFeePots, + entries_query_from_request, identifier_from_request, lists_from_request, + removals_query_from_request, ContractDocumentRemovals, ContractFeePots, ContractModerationEntries, ContractModerationListStatuses, CONTRACT_FEE_POTS_QUERIED, }; use crate::verify::{supported_grovedb_proof_bytes, verify_tenderdash_proof}; use crate::{ContextProvider, Error, FromProof}; use dapi_grpc::platform::v0::{ - get_contract_fee_pots_request, get_contract_moderation_entries_request, - get_contract_moderation_status_request, GetContractFeePotsRequest, GetContractFeePotsResponse, - GetContractModerationEntriesRequest, GetContractModerationEntriesResponse, - GetContractModerationStatusRequest, GetContractModerationStatusResponse, Proof, - ResponseMetadata, + get_contract_document_removals_request, get_contract_fee_pots_request, + get_contract_moderation_entries_request, get_contract_moderation_status_request, + GetContractDocumentRemovalsRequest, GetContractDocumentRemovalsResponse, + GetContractFeePotsRequest, GetContractFeePotsResponse, GetContractModerationEntriesRequest, + GetContractModerationEntriesResponse, GetContractModerationStatusRequest, + GetContractModerationStatusResponse, Proof, ResponseMetadata, }; use dapi_grpc::platform::VersionedGrpcResponse; use dpp::dashcore::Network; @@ -158,9 +160,62 @@ impl FromProof for ContractFeePots { } } +impl FromProof for ContractDocumentRemovals { + type Request = GetContractDocumentRemovalsRequest; + type Response = GetContractDocumentRemovalsResponse; + + fn maybe_from_proof_with_metadata<'a, I: Into, O: Into>( + request: I, + response: O, + _network: Network, + platform_version: &PlatformVersion, + provider: &'a dyn ContextProvider, + ) -> Result<(Option, ResponseMetadata, Proof), Error> + where + Self: Sized + 'a, + { + let request: Self::Request = request.into(); + let response: Self::Response = response.into(); + + let get_contract_document_removals_request::Version::V0(v0) = + request.version.ok_or(Error::EmptyVersion)?; + let contract_id = identifier_from_request(&v0.contract_id, "contract_id")?; + let query = + removals_query_from_request(v0.document_type_name, v0.selection, platform_version)?; + + let metadata = response + .metadata() + .or(Err(Error::EmptyResponseMetadata))? + .clone(); + let proof = response.proof_owned().or(Err(Error::NoProofInResult))?; + + let (root_hash, removals) = Drive::verify_contract_document_removals( + supported_grovedb_proof_bytes(&proof, platform_version)?, + contract_id, + &query, + platform_version, + ) + .map_drive_error(&proof, &metadata)?; + + verify_tenderdash_proof(&proof, &metadata, &root_hash, provider, platform_version)?; + + // A document type nobody moderated proves as no records at all, and an id with no + // record is proved absent rather than missing, so the records are always the answer. + Ok((Some(ContractDocumentRemovals(removals)), metadata, proof)) + } +} + #[cfg(test)] mod tests { use super::*; + use dapi_grpc::platform::v0::get_contract_document_removals_request::get_contract_document_removals_request_v0::Selection; + use dapi_grpc::platform::v0::get_contract_document_removals_request::{ + DocumentIds, GetContractDocumentRemovalsRequestV0, Page, + }; + use dapi_grpc::platform::v0::get_contract_document_removals_response::{ + get_contract_document_removals_response_v0::Result as RemovalsResult, + GetContractDocumentRemovalsResponseV0, Version as RemovalsResponseVersion, + }; use dapi_grpc::platform::v0::get_contract_fee_pots_request::GetContractFeePotsRequestV0; use dapi_grpc::platform::v0::get_contract_fee_pots_response::{ get_contract_fee_pots_response_v0::Result as FeePotsResult, GetContractFeePotsResponseV0, @@ -504,4 +559,138 @@ mod tests { "got: {err:?}" ); } + + fn removals_request( + contract_id: Vec, + document_type_name: &str, + selection: Option, + ) -> GetContractDocumentRemovalsRequest { + GetContractDocumentRemovalsRequest { + version: Some(get_contract_document_removals_request::Version::V0( + GetContractDocumentRemovalsRequestV0 { + contract_id, + document_type_name: document_type_name.to_string(), + selection, + prove: true, + }, + )), + } + } + + fn removals_response(result: Option) -> GetContractDocumentRemovalsResponse { + GetContractDocumentRemovalsResponse { + version: Some(RemovalsResponseVersion::V0( + GetContractDocumentRemovalsResponseV0 { + result, + metadata: Some(ResponseMetadata::default()), + }, + )), + } + } + + fn removals_error( + request: GetContractDocumentRemovalsRequest, + response: GetContractDocumentRemovalsResponse, + ) -> Error { + >::maybe_from_proof( + request, + response, + Network::Testnet, + PlatformVersion::latest(), + &UnreachableProvider, + ) + .unwrap_err() + } + + fn removals_page(start_after: Option>, limit: Option) -> Option { + Some(Selection::Page(Page { start_after, limit })) + } + + #[test] + fn removals_should_fail_with_empty_version_when_request_has_no_version() { + let err = removals_error( + GetContractDocumentRemovalsRequest { version: None }, + removals_response(Some(RemovalsResult::Proof(Proof::default()))), + ); + assert!(matches!(err, Error::EmptyVersion), "got: {err:?}"); + } + + #[test] + fn removals_should_reject_malformed_requests() { + let id = vec![1; 32]; + for (request, needle) in [ + ( + removals_request(vec![1; 5], "post", removals_page(None, None)), + "contract_id", + ), + ( + removals_request(id.clone(), "post", None), + "either document_ids or page must be set", + ), + ( + removals_request( + id.clone(), + "post", + Some(Selection::DocumentIds(DocumentIds { + document_ids: vec![], + })), + ), + "must name between 1 and", + ), + ( + removals_request( + id.clone(), + "post", + Some(Selection::DocumentIds(DocumentIds { + document_ids: vec![id.clone(), id.clone()], + })), + ), + "name a document id twice", + ), + ( + removals_request(id.clone(), "post", removals_page(Some(vec![1; 5]), None)), + "start_after", + ), + ( + removals_request(id.clone(), "post", removals_page(None, Some(70_000))), + "limit must be between 1 and", + ), + ] { + let err = removals_error( + request, + removals_response(Some(RemovalsResult::Proof(Proof::default()))), + ); + assert!( + matches!(&err, Error::RequestError { error } if error.contains(needle)), + "{needle}: {err:?}" + ); + } + } + + #[test] + fn removals_should_fail_without_proof_when_response_carries_none() { + let err = removals_error( + removals_request(vec![1; 32], "post", removals_page(None, None)), + removals_response(None), + ); + assert!(matches!(err, Error::NoProofInResult), "got: {err:?}"); + } + + #[test] + fn removals_should_fail_on_a_proof_that_does_not_verify() { + let err = removals_error( + removals_request( + vec![1; 32], + "post", + Some(Selection::DocumentIds(DocumentIds { + document_ids: vec![vec![2; 32]], + })), + ), + removals_response(Some(RemovalsResult::Proof(Proof::default()))), + ); + assert!( + !matches!(err, Error::RequestError { .. } | Error::NoProofInResult), + "got: {err:?}" + ); + } } diff --git a/packages/rs-drive-proof-verifier/src/types/contract_moderation.rs b/packages/rs-drive-proof-verifier/src/types/contract_moderation.rs index c50365823ad..7c519741189 100644 --- a/packages/rs-drive-proof-verifier/src/types/contract_moderation.rs +++ b/packages/rs-drive-proof-verifier/src/types/contract_moderation.rs @@ -1,10 +1,15 @@ //! Contract moderation query results and the wire conversions the proved and unproved paths //! share: one identity's status on the lists queried ([`ContractModerationListStatuses`]) and one //! page of a contract's banlist or suspension list ([`ContractModerationEntries`], read with a -//! [`ContractModerationEntriesQuery`]). The fee pots of a contract ([`ContractFeePots`]) are -//! read here too: they are what its document action fees pay its owner and its moderators. +//! [`ContractModerationEntriesQuery`]). The records of the documents its moderators deleted +//! ([`ContractDocumentRemovals`], read with a [`ContractDocumentRemovalsQuery`]) and the fee +//! pots of a contract ([`ContractFeePots`]) are read here too: the pots are what its document +//! action fees pay its owner and its moderators. use crate::Error; +use dapi_grpc::platform::v0::get_contract_document_removals_request::get_contract_document_removals_request_v0::Selection; +use dapi_grpc::platform::v0::get_contract_document_removals_request::{DocumentIds, Page}; +use dapi_grpc::platform::v0::get_contract_document_removals_response::ContractDocumentRemoval as ContractDocumentRemovalProto; #[cfg(test)] use dapi_grpc::platform::v0::get_contract_fee_pots_response::ContractFeePotLastClaim as ContractFeePotLastClaimProto; use dapi_grpc::platform::v0::get_contract_fee_pots_response::{ @@ -14,16 +19,18 @@ use dapi_grpc::platform::v0::get_contract_moderation_entries_response::ContractM use dapi_grpc::platform::v0::ContractModerationList as ContractModerationListProto; use dapi_grpc::platform::v0::ContractModerationReason as ContractModerationReasonProto; pub use dpp::data_contract::config::moderation::{ - ContractBan, ContractModerationList, ContractModerationListStatus, + ContractBan, ContractDocumentRemoval, ContractModerationList, ContractModerationListStatus, ContractModerationListStatuses, ContractModerationReason, ContractModerationStatus, ContractSuspension, }; pub use dpp::data_contract::document_type::action_fees::{ContractFeePot, ContractFeePotLastClaim}; use dpp::identifier::Identifier; use dpp::version::PlatformVersion; +use drive::drive::Drive; pub use drive::drive::contract::fee_pots::types::{ContractFeePotState, ContractFeePots}; pub use drive::drive::contract::moderation::types::{ - ContractModerationEntriesQuery, ContractModerationEntry, + ContractDocumentRemovalEntry, ContractDocumentRemovalsQuery, + ContractDocumentRemovalsSelection, ContractModerationEntriesQuery, ContractModerationEntry, }; /// The page size a request without a limit asks for, which is also the largest page a node @@ -65,6 +72,49 @@ impl ContractModerationEntries { pub const CONTRACT_FEE_POTS_QUERIED: [ContractFeePot; 2] = [ContractFeePot::Owner, ContractFeePot::Moderators]; +/// The page size a removals request without a limit asks for, which is also the largest page a +/// node returns and the most document ids one may name: the platform version's +/// `max_returned_elements`, the number the node reads too. +pub fn default_contract_document_removals_limit(platform_version: &PlatformVersion) -> u16 { + platform_version.drive_abci.query.max_returned_elements +} + +/// The records of the documents a contract's moderators deleted within one document type, in +/// document id order. A page shorter than the limit is the last one; a read by ids holds only +/// the ids that have a record. +#[derive(Debug, Clone, PartialEq, Eq, Default)] +pub struct ContractDocumentRemovals(pub Vec); + +impl ContractDocumentRemovals { + /// The records read. + pub fn removals(&self) -> &[ContractDocumentRemovalEntry] { + &self.0 + } + + /// The query for the page after this one, or `None` when this page is the last: it holds + /// fewer records than `query` asked for. A read by ids names every record it wants, so + /// nothing follows it. + pub fn next_query( + &self, + query: &ContractDocumentRemovalsQuery, + ) -> Option { + let ContractDocumentRemovalsSelection::Page { limit, .. } = &query.selection else { + return None; + }; + let limit = *limit; + if self.0.len() < usize::from(limit) { + return None; + } + self.0.last().map(|entry| ContractDocumentRemovalsQuery { + document_type_name: query.document_type_name.clone(), + selection: ContractDocumentRemovalsSelection::Page { + start_after: Some(entry.document_id), + limit, + }, + }) + } +} + /// The 32 byte identifier a request field holds, naming the field in the error. pub fn identifier_from_request(bytes: &[u8], what: &str) -> Result { Identifier::from_bytes(bytes).map_err(|_| Error::RequestError { @@ -75,6 +125,16 @@ pub fn identifier_from_request(bytes: &[u8], what: &str) -> Result Result { + Identifier::from_bytes(bytes).map_err(|_| Error::ProtocolError { + error: format!( + "{what} must be a 32 byte identifier, got {} bytes", + bytes.len() + ), + }) +} + /// The list a request field names. pub fn list_from_request(list: i32, what: &str) -> Result { match ContractModerationListProto::try_from(list) { @@ -192,6 +252,107 @@ pub fn entries_from_response( .map(ContractModerationEntries) } +/// The Drive query of a document removals request: the document type and what to read of it, +/// under the bounds the node enforces, so a request outside them never got a proof. A request +/// that selects nothing asks for no records at all and is refused rather than read as a page. +pub fn removals_query_from_request( + document_type_name: String, + selection: Option, + platform_version: &PlatformVersion, +) -> Result { + let selection = selection.ok_or_else(|| Error::RequestError { + error: "either document_ids or page must be set".to_string(), + })?; + let selection = match selection { + Selection::DocumentIds(DocumentIds { document_ids }) => { + ContractDocumentRemovalsSelection::DocumentIds( + document_ids + .iter() + .map(|bytes| identifier_from_request(bytes, "document_ids")) + .collect::, Error>>()?, + ) + } + Selection::Page(Page { start_after, limit }) => ContractDocumentRemovalsSelection::Page { + start_after: start_after + .as_deref() + .map(|bytes| identifier_from_request(bytes, "start_after")) + .transpose()?, + // The page size when the request names none: the largest page, the number the node + // read and proved. A limit no u16 holds is past every bound, and is refused below + // as the largest u16 is. + limit: limit.map_or( + default_contract_document_removals_limit(platform_version), + |limit| u16::try_from(limit).unwrap_or(u16::MAX), + ), + }, + }; + let query = ContractDocumentRemovalsQuery { + document_type_name, + selection, + }; + // The bounds the node enforced, from the one place they are written. + Drive::check_contract_document_removals_query(&query, platform_version).map_err(|error| { + Error::RequestError { + error: error.to_string(), + } + })?; + Ok(query) +} + +/// The records of an unproved response. Every record names three identities and carries a +/// reason, so a response missing any of them is refused, and so is one that answers with more +/// records than the query could hold or with the record of a document it did not name. +pub fn removals_from_response( + removals: Vec, + query: &ContractDocumentRemovalsQuery, +) -> Result { + let limit = query.limit(); + if removals.len() > usize::from(limit) { + return Err(Error::ResponseDecodeError { + error: format!( + "{} document removals returned, the query asked for at most {limit}", + removals.len() + ), + }); + } + let entries = removals + .into_iter() + .map(|removal| { + Ok(ContractDocumentRemovalEntry { + document_id: identifier_from_response(&removal.document_id, "removal document id")?, + removal: ContractDocumentRemoval { + document_owner_id: identifier_from_response( + &removal.document_owner_id, + "removal document owner id", + )?, + moderator_id: identifier_from_response( + &removal.moderator_id, + "removal moderator id", + )?, + reason: reason_from_response(removal.reason)?, + removed_at: removal.removed_at, + }, + }) + }) + .collect::, Error>>()?; + // A read by ids asked for those records and no others, so the record of another document + // is not an answer to it. + if let ContractDocumentRemovalsSelection::DocumentIds(ids) = &query.selection { + if let Some(entry) = entries + .iter() + .find(|entry| !ids.contains(&entry.document_id)) + { + return Err(Error::ResponseDecodeError { + error: format!( + "the response holds the removal of document {}, which the query did not name", + entry.document_id + ), + }); + } + } + Ok(ContractDocumentRemovals(entries)) +} + /// One pot of an unproved response. The epoch of a last claim is a u16 on the chain and its /// claimant a 32 byte identifier, so a response naming anything else is refused: no pot of any /// version can hold it. @@ -485,6 +646,253 @@ mod tests { assert_eq!(short.next_query(&query), None); } + const POST: &str = "post"; + + fn page_selection(start_after: Option, limit: Option) -> Option { + Some(Selection::Page(Page { + start_after: start_after.map(|seed| id(seed).to_vec()), + limit, + })) + } + + fn ids_selection(seeds: &[u8]) -> Option { + Some(Selection::DocumentIds(DocumentIds { + document_ids: seeds.iter().map(|seed| id(*seed).to_vec()).collect(), + })) + } + + fn removal(seed: u8) -> ContractDocumentRemoval { + ContractDocumentRemoval { + document_owner_id: id(seed + 0x10), + moderator_id: id(0x77), + reason: ContractModerationReason::from_text("spam"), + removed_at: 1_000 + u64::from(seed), + } + } + + fn removal_proto(seed: u8) -> ContractDocumentRemovalProto { + let removal = removal(seed); + ContractDocumentRemovalProto { + document_id: id(seed).to_vec(), + document_owner_id: removal.document_owner_id.to_vec(), + moderator_id: removal.moderator_id.to_vec(), + removed_at: removal.removed_at, + reason: Some(ContractModerationReasonProto { + code: None, + text: "spam".to_string(), + }), + } + } + + fn ids_query(seeds: &[u8]) -> ContractDocumentRemovalsQuery { + ContractDocumentRemovalsQuery { + document_type_name: POST.to_string(), + selection: ContractDocumentRemovalsSelection::DocumentIds( + seeds.iter().map(|seed| id(*seed)).collect(), + ), + } + } + + fn page_query(limit: u16) -> ContractDocumentRemovalsQuery { + ContractDocumentRemovalsQuery { + document_type_name: POST.to_string(), + selection: ContractDocumentRemovalsSelection::Page { + start_after: None, + limit, + }, + } + } + + #[test] + fn should_build_the_removals_query_of_a_request() { + let platform_version = PlatformVersion::latest(); + let max = platform_version.drive_abci.query.max_returned_elements; + assert_eq!( + removals_query_from_request( + POST.to_string(), + page_selection(None, None), + platform_version + ) + .expect("expected a query"), + page_query(max) + ); + assert_eq!( + removals_query_from_request( + POST.to_string(), + page_selection(Some(3), Some(5)), + platform_version + ) + .expect("expected a query"), + ContractDocumentRemovalsQuery { + document_type_name: POST.to_string(), + selection: ContractDocumentRemovalsSelection::Page { + start_after: Some(id(3)), + limit: 5, + }, + } + ); + assert_eq!( + removals_query_from_request(POST.to_string(), ids_selection(&[3, 1]), platform_version) + .expect("expected a query"), + ids_query(&[3, 1]) + ); + + for (selection, needle) in [ + (None, "either document_ids or page must be set"), + (ids_selection(&[]), "must name between 1 and"), + (ids_selection(&[1, 1]), "name a document id twice"), + (page_selection(None, Some(0)), "limit must be between 1 and"), + ( + page_selection(None, Some(u32::from(max) + 1)), + "limit must be between 1 and", + ), + ( + page_selection(None, Some(u16::MAX as u32 + 1)), + "limit must be between 1 and", + ), + ( + Some(Selection::DocumentIds(DocumentIds { + document_ids: vec![vec![1; 31]], + })), + "document_ids", + ), + ( + Some(Selection::Page(Page { + start_after: Some(vec![1; 5]), + limit: None, + })), + "start_after", + ), + ] { + let err = removals_query_from_request(POST.to_string(), selection, platform_version) + .unwrap_err(); + assert!( + matches!(&err, Error::RequestError { error } if error.contains(needle)), + "{needle}: {err:?}" + ); + } + + // One id over the cap: the node would not have read them either. + let err = removals_query_from_request( + POST.to_string(), + ids_selection(&(0..=max as u8).collect::>()), + platform_version, + ) + .unwrap_err(); + assert!( + matches!(&err, Error::RequestError { error } if error.contains("must name between 1 and")), + "got: {err:?}" + ); + } + + #[test] + fn should_read_the_removals_of_an_unproved_response() { + let removals = removals_from_response( + vec![removal_proto(1), removal_proto(2)], + &ids_query(&[1, 2, 9]), + ) + .expect("expected removals"); + assert_eq!( + removals.removals(), + &[ + ContractDocumentRemovalEntry { + document_id: id(1), + removal: removal(1), + }, + ContractDocumentRemovalEntry { + document_id: id(2), + removal: removal(2), + } + ] + ); + + // Every identifier of a record is 32 bytes. + for spoil in [ + |proto: &mut ContractDocumentRemovalProto| proto.document_id = vec![1; 5], + |proto: &mut ContractDocumentRemovalProto| proto.document_owner_id = vec![1; 5], + |proto: &mut ContractDocumentRemovalProto| proto.moderator_id = vec![1; 5], + ] { + let mut proto = removal_proto(1); + spoil(&mut proto); + let err = removals_from_response(vec![proto], &ids_query(&[1])).unwrap_err(); + assert!(matches!(err, Error::ProtocolError { .. }), "got: {err:?}"); + } + + // Every record carries a reason, with a code that fits a u16. + for reason in [ + None, + Some(ContractModerationReasonProto { + code: Some(u32::from(u16::MAX) + 1), + text: String::new(), + }), + ] { + let proto = ContractDocumentRemovalProto { + reason, + ..removal_proto(1) + }; + let err = removals_from_response(vec![proto], &ids_query(&[1])).unwrap_err(); + assert!( + matches!(err, Error::ResponseDecodeError { .. }), + "got: {err:?}" + ); + } + + // A record of a document the query did not name is not an answer to it. + let err = removals_from_response( + vec![removal_proto(1), removal_proto(2)], + &ids_query(&[1, 3]), + ) + .unwrap_err(); + assert!( + matches!(&err, Error::ResponseDecodeError { error } if error.contains("did not name")), + "got: {err:?}" + ); + + // More records than the read could hold, by ids and by page alike. + for query in [ids_query(&[1]), page_query(1)] { + let err = removals_from_response(vec![removal_proto(1), removal_proto(2)], &query) + .unwrap_err(); + assert!( + matches!(&err, Error::ResponseDecodeError { error } if error.contains("at most 1")), + "got: {err:?}" + ); + } + } + + #[test] + fn should_continue_after_a_full_removals_page_only() { + let query = page_query(2); + let page = ContractDocumentRemovals(vec![ + ContractDocumentRemovalEntry { + document_id: id(1), + removal: removal(1), + }, + ContractDocumentRemovalEntry { + document_id: id(2), + removal: removal(2), + }, + ]); + assert_eq!( + page.next_query(&query), + Some(ContractDocumentRemovalsQuery { + document_type_name: POST.to_string(), + selection: ContractDocumentRemovalsSelection::Page { + start_after: Some(id(2)), + limit: 2, + }, + }) + ); + assert_eq!(ContractDocumentRemovals::default().next_query(&query), None); + // A page shorter than the limit is the last one, and a read by ids has no page after + // it whatever it held. + let short = ContractDocumentRemovals(vec![ContractDocumentRemovalEntry { + document_id: id(1), + removal: removal(1), + }]); + assert_eq!(short.next_query(&query), None); + assert_eq!(page.next_query(&ids_query(&[1, 2])), None); + } + #[test] fn should_read_the_fee_pots_of_an_unproved_response() { let pots = fee_pots_from_response(ContractFeePotsProto { diff --git a/packages/rs-drive-proof-verifier/src/unproved.rs b/packages/rs-drive-proof-verifier/src/unproved.rs index 284d29f8358..f53713a67e2 100644 --- a/packages/rs-drive-proof-verifier/src/unproved.rs +++ b/packages/rs-drive-proof-verifier/src/unproved.rs @@ -5,9 +5,9 @@ use crate::types::contract_groups::{ }; use crate::types::contract_moderation::{ entries_from_response, fee_pots_from_response, list_from_request, lists_from_request, - reason_from_response, ContractBan, ContractFeePots, ContractModerationEntries, - ContractModerationList, ContractModerationListStatuses, ContractModerationStatus, - ContractSuspension, + reason_from_response, removals_from_response, removals_query_from_request, ContractBan, + ContractDocumentRemovals, ContractFeePots, ContractModerationEntries, ContractModerationList, + ContractModerationListStatuses, ContractModerationStatus, ContractSuspension, }; use crate::types::data_contracts_latest_versions::{ DataContractLatestVersion, DataContractsLatestVersions, @@ -1002,6 +1002,54 @@ impl FromUnproved for ContractMod } } +impl FromUnproved for ContractDocumentRemovals { + type Request = platform::GetContractDocumentRemovalsRequest; + type Response = platform::GetContractDocumentRemovalsResponse; + + fn maybe_from_unproved_with_metadata, O: Into>( + request: I, + response: O, + _network: Network, + platform_version: &PlatformVersion, + ) -> Result<(Option, ResponseMetadata), Error> + where + Self: Sized, + { + use platform::get_contract_document_removals_response::get_contract_document_removals_response_v0::Result as V0Result; + + let request: Self::Request = request.into(); + let response: Self::Response = response.into(); + + // The request bounds what the response may hold, so it is read back here too, under + // the same rules the node applied. + let platform::get_contract_document_removals_request::Version::V0(request_v0) = + request.version.ok_or(Error::EmptyVersion)?; + let query = removals_query_from_request( + request_v0.document_type_name, + request_v0.selection, + platform_version, + )?; + + let platform::get_contract_document_removals_response::Version::V0(v0) = + response.version.ok_or(Error::EmptyVersion)?; + let metadata = v0.metadata.ok_or(Error::EmptyResponseMetadata)?; + + let removals = match v0.result { + Some(V0Result::Removals(removals)) => { + Some(removals_from_response(removals.removals, &query)?) + } + Some(V0Result::Proof(_)) => { + return Err(Error::ResponseDecodeError { + error: "expected unproved contract document removals, got a proof".to_string(), + }) + } + None => None, + }; + + Ok((removals, metadata)) + } +} + impl FromUnproved for ContractFeePots { type Request = platform::GetContractFeePotsRequest; type Response = platform::GetContractFeePotsResponse; @@ -1442,6 +1490,17 @@ mod contract_groups_tests { mod contract_moderation_tests { use super::*; use crate::types::contract_moderation::ContractModerationReason; + use dapi_grpc::platform::v0::get_contract_document_removals_request::get_contract_document_removals_request_v0::Selection as RemovalsSelection; + use dapi_grpc::platform::v0::get_contract_document_removals_request::{ + DocumentIds as RemovalsDocumentIds, GetContractDocumentRemovalsRequestV0, + Page as RemovalsPage, Version as RemovalsRequestVersion, + }; + use dapi_grpc::platform::v0::get_contract_document_removals_response::{ + get_contract_document_removals_response_v0::Result as RemovalsResult, + ContractDocumentRemoval as ContractDocumentRemovalProto, + ContractDocumentRemovals as ContractDocumentRemovalsProto, + GetContractDocumentRemovalsResponseV0, Version as RemovalsResponseVersion, + }; use dapi_grpc::platform::v0::get_contract_moderation_status_request::{ GetContractModerationStatusRequestV0, Version as StatusRequestVersion, }; @@ -1591,4 +1650,115 @@ mod contract_moderation_tests { Err(Error::ResponseDecodeError { .. }) )); } + + fn removals( + selection: Option, + result: Option, + ) -> Result, Error> { + let request = platform::GetContractDocumentRemovalsRequest { + version: Some(RemovalsRequestVersion::V0( + GetContractDocumentRemovalsRequestV0 { + contract_id: vec![1; 32], + document_type_name: "post".to_string(), + selection, + prove: false, + }, + )), + }; + let response = platform::GetContractDocumentRemovalsResponse { + version: Some(RemovalsResponseVersion::V0( + GetContractDocumentRemovalsResponseV0 { + result, + metadata: Some(ResponseMetadata::default()), + }, + )), + }; + ContractDocumentRemovals::maybe_from_unproved_with_metadata( + request, + response, + Network::Testnet, + PlatformVersion::latest(), + ) + .map(|(removals, _)| removals) + } + + fn removal_proto(seed: u8) -> ContractDocumentRemovalProto { + ContractDocumentRemovalProto { + document_id: vec![seed; 32], + document_owner_id: vec![seed + 0x10; 32], + moderator_id: vec![0x77; 32], + removed_at: 1_000 + u64::from(seed), + reason: Some(ContractModerationReasonProto { + code: None, + text: "spam".to_string(), + }), + } + } + + #[test] + fn should_read_the_removals_the_request_asked_for() { + let page = Some(RemovalsSelection::Page(RemovalsPage { + start_after: None, + limit: Some(2), + })); + let read = removals( + page.clone(), + Some(RemovalsResult::Removals(ContractDocumentRemovalsProto { + removals: vec![removal_proto(1), removal_proto(2)], + })), + ) + .expect("expected the removals to convert") + .expect("expected removals"); + assert_eq!(read.removals().len(), 2); + assert_eq!(read.removals()[0].document_id, Identifier::from([1; 32])); + assert_eq!( + read.removals()[1].removal.moderator_id, + Identifier::from([0x77; 32]) + ); + + // A page of more records than the request allowed, and a request that selects nothing. + let over_limit = removals( + Some(RemovalsSelection::Page(RemovalsPage { + start_after: None, + limit: Some(1), + })), + Some(RemovalsResult::Removals(ContractDocumentRemovalsProto { + removals: vec![removal_proto(1), removal_proto(2)], + })), + ); + assert!(matches!(over_limit, Err(Error::ResponseDecodeError { .. }))); + assert!(matches!( + removals(None, None), + Err(Error::RequestError { .. }) + )); + + // The unproved path never reads a proof. + let proved = removals(page, Some(RemovalsResult::Proof(Default::default()))); + assert!(matches!(proved, Err(Error::ResponseDecodeError { .. }))); + } + + #[test] + fn should_refuse_a_removal_of_a_document_the_request_did_not_name() { + let by_ids = Some(RemovalsSelection::DocumentIds(RemovalsDocumentIds { + document_ids: vec![vec![1; 32], vec![3; 32]], + })); + let unasked = removals( + by_ids.clone(), + Some(RemovalsResult::Removals(ContractDocumentRemovalsProto { + removals: vec![removal_proto(2)], + })), + ); + assert!(matches!(unasked, Err(Error::ResponseDecodeError { .. }))); + + // An id with no record is simply left out, which is an answer. + let partial = removals( + by_ids, + Some(RemovalsResult::Removals(ContractDocumentRemovalsProto { + removals: vec![removal_proto(1)], + })), + ) + .expect("expected the removals to convert") + .expect("expected removals"); + assert_eq!(partial.removals().len(), 1); + } } diff --git a/packages/rs-drive/grovedb-structure.json b/packages/rs-drive/grovedb-structure.json index 5999da0e51a..5851d8912b7 100644 --- a/packages/rs-drive/grovedb-structure.json +++ b/packages/rs-drive/grovedb-structure.json @@ -2954,6 +2954,81 @@ "book": "data-model/contract-moderation.md", "description": "Everything a contract keeps beside itself and its documents. One key, so that the contract's layer holds three and its Merk keeps the documents on top. Inside, the keys are spread like the root layer's, with the most read one, the banlist, in the middle.", "children": [ + { + "id": "contracts.contract.other.document_removals", + "key": { + "type": "fixed", + "hex": "10", + "label": "DocumentRemovals", + "constant": "CONTRACT_DOCUMENT_REMOVALS_KEY" + }, + "kinds": [ + "Tree" + ], + "flags": [ + "EpochOwned", + "None" + ], + "flags_note": "The owner is the contract owner, and the epoch the one the contract was created in. System contracts created at genesis carry no flags.", + "since": 14, + "presence": "lazy", + "source": "packages/rs-drive/src/drive/contract/paths.rs", + "description": "The records of the documents the contract's moderators deleted. Created with the first document type that sets canBeDeletedByModerators, by the contract's creation or by an update. Read by clients, never by a document transition, so it sorts below the rest.", + "children": [ + { + "id": "contracts.contract.other.document_removals.document_type", + "key": { + "type": "dynamic", + "name": "document_type_name", + "matcher": { + "type": "any" + }, + "encoding": "utf8", + "description": "The document type name" + }, + "kinds": [ + "Tree" + ], + "flags": [ + "EpochOwned", + "None" + ], + "flags_note": "The owner is the contract owner, and the epoch the one the contract was created in. System contracts created at genesis carry no flags.", + "since": 14, + "presence": "always", + "source": "packages/rs-drive/src/drive/contract/paths.rs", + "description": "The removed documents of one document type that sets canBeDeletedByModerators. Created with the document type, by the contract's creation or by the update that adds the type.", + "children": [ + { + "id": "contracts.contract.other.document_removals.document_type.document", + "key": { + "type": "dynamic", + "name": "document_id", + "matcher": { + "type": "len", + "len": 32 + }, + "encoding": "identifier32", + "description": "The id the removed document had" + }, + "kinds": [ + "Item" + ], + "flags": [ + "EpochOwned" + ], + "flags_note": "The owner is the moderator who deleted the document. They pay for the record, which nothing deletes or replaces.", + "value": "the document owner's id, the moderator's id, the block time in milliseconds of the removal as a u64 big endian, then the moderator's reason as in a banlist entry", + "since": 14, + "presence": "always", + "source": "packages/rs-drive/src/drive/contract/paths.rs", + "description": "One removal: whose document it was, who removed it, when and why. Never deleted and never replaced: a document id is produced at most once.", + "children": [] + } + ] + } + ] + }, { "id": "contracts.contract.other.last_owner_fee_claim", "key": { diff --git a/packages/rs-drive/src/drive/constants.rs b/packages/rs-drive/src/drive/constants.rs index 41644ad7ddd..6eeffe10fb0 100644 --- a/packages/rs-drive/src/drive/constants.rs +++ b/packages/rs-drive/src/drive/constants.rs @@ -45,6 +45,10 @@ pub const AVERAGE_UPDATE_BYTE_COUNT_REQUIRED_SIZE: u8 = 1; /// The estimated average document type name size pub const ESTIMATED_AVERAGE_DOCUMENT_TYPE_NAME_SIZE: u8 = 12; +/// The estimated number of document types of a contract whose documents its moderators can +/// delete: the size the layer of their removal record trees is estimated at. +pub const ESTIMATED_DOCUMENT_TYPES_DELETABLE_BY_MODERATORS: u32 = 16; + /// The estimated average index name size pub const ESTIMATED_AVERAGE_INDEX_NAME_SIZE: u8 = 16; diff --git a/packages/rs-drive/src/drive/contract/insert/insert_contract/v2/mod.rs b/packages/rs-drive/src/drive/contract/insert/insert_contract/v2/mod.rs index c8e2830b103..a1af8d5018e 100644 --- a/packages/rs-drive/src/drive/contract/insert/insert_contract/v2/mod.rs +++ b/packages/rs-drive/src/drive/contract/insert/insert_contract/v2/mod.rs @@ -5,6 +5,7 @@ use crate::util::storage_flags::StorageFlags; use dpp::block::block_info::BlockInfo; use dpp::data_contract::accessors::v0::DataContractV0Getters; use dpp::data_contract::config::v2::DataContractConfigGettersV2; +use dpp::data_contract::document_type::accessors::{DocumentTypeV0Getters, DocumentTypeV2Getters}; use dpp::data_contract::DataContract; use dpp::fee::fee_result::FeeResult; use dpp::version::PlatformVersion; @@ -122,6 +123,30 @@ impl Drive { &mut batch_operations, platform_version, )?; + + // The records of the documents the moderators delete: one tree per document type + // moderators can delete documents of, and above them their common tree, which a + // contract without such a document type does not get. Its other tree then holds + // what it would have held, in the shape it would have had; the update that adds + // the first such document type creates the common tree. + let document_type_names: Vec<&str> = contract + .document_types() + .values() + .filter(|document_type| document_type.documents_can_be_deleted_by_moderators()) + .map(|document_type| document_type.name().as_str()) + .collect(); + if !document_type_names.is_empty() { + self.insert_contract_document_removal_trees_operations( + contract.id().to_buffer(), + true, + &document_type_names, + storage_flags.as_ref(), + estimated_costs_only_with_layer_info, + transaction, + &mut batch_operations, + platform_version, + )?; + } } Ok(batch_operations) diff --git a/packages/rs-drive/src/drive/contract/moderation/add_contract_document_removal/mod.rs b/packages/rs-drive/src/drive/contract/moderation/add_contract_document_removal/mod.rs new file mode 100644 index 00000000000..5b44c96bf44 --- /dev/null +++ b/packages/rs-drive/src/drive/contract/moderation/add_contract_document_removal/mod.rs @@ -0,0 +1,57 @@ +mod v0; + +use crate::drive::Drive; +use crate::error::drive::DriveError; +use crate::error::Error; +use crate::fees::op::LowLevelDriveOperation; +use dpp::block::block_info::BlockInfo; +use dpp::data_contract::config::moderation::ContractDocumentRemoval; +use dpp::identifier::Identifier; +use dpp::version::PlatformVersion; +use grovedb::batch::KeyInfoPath; +use grovedb::{EstimatedLayerInformation, TransactionArg}; +use std::collections::HashMap; + +impl Drive { + /// The operations recording that a moderator deleted a document: the record under the + /// document's type, keyed by the document's id. A document id is produced at most once + /// (it commits to the nonce of its create transition), so the record is always new. + #[allow(clippy::too_many_arguments)] + pub fn add_contract_document_removal_operations( + &self, + contract_id: Identifier, + document_type_name: &str, + document_id: Identifier, + removal: &ContractDocumentRemoval, + block_info: &BlockInfo, + estimated_costs_only_with_layer_info: &mut Option< + HashMap, + >, + transaction: TransactionArg, + platform_version: &PlatformVersion, + ) -> Result, Error> { + match platform_version + .drive + .methods + .contract + .moderation + .add_contract_document_removal + { + 0 => self.add_contract_document_removal_operations_v0( + contract_id, + document_type_name, + document_id, + removal, + block_info, + estimated_costs_only_with_layer_info, + transaction, + platform_version, + ), + version => Err(Error::Drive(DriveError::UnknownVersionMismatch { + method: "add_contract_document_removal_operations".to_string(), + known_versions: vec![0], + received: version, + })), + } + } +} diff --git a/packages/rs-drive/src/drive/contract/moderation/add_contract_document_removal/v0/mod.rs b/packages/rs-drive/src/drive/contract/moderation/add_contract_document_removal/v0/mod.rs new file mode 100644 index 00000000000..f112dd479de --- /dev/null +++ b/packages/rs-drive/src/drive/contract/moderation/add_contract_document_removal/v0/mod.rs @@ -0,0 +1,69 @@ +use crate::drive::contract::moderation::types::encode_document_removal; +use crate::drive::contract::paths::contract_document_type_removals_path; +use crate::drive::Drive; +use crate::error::Error; +use crate::fees::op::LowLevelDriveOperation; +use crate::util::object_size_info::PathKeyElementInfo::PathFixedSizeKeyRefElement; +use crate::util::storage_flags::StorageFlags; +use dpp::block::block_info::BlockInfo; +use dpp::data_contract::config::moderation::ContractDocumentRemoval; +use dpp::identifier::Identifier; +use dpp::version::PlatformVersion; +use grovedb::batch::KeyInfoPath; +use grovedb::Element; +use grovedb::{EstimatedLayerInformation, TransactionArg}; +use std::collections::HashMap; + +impl Drive { + /// A record is the document owner's id, the moderator's id, the removal time and the + /// reason, under the document's id, flagged with the moderator's identity: the moderator + /// pays for it. Nothing ever deletes it, and nothing replaces it: a document id is produced + /// at most once. + #[inline(always)] + #[allow(clippy::too_many_arguments)] + pub(super) fn add_contract_document_removal_operations_v0( + &self, + contract_id: Identifier, + document_type_name: &str, + document_id: Identifier, + removal: &ContractDocumentRemoval, + block_info: &BlockInfo, + estimated_costs_only_with_layer_info: &mut Option< + HashMap, + >, + _transaction: TransactionArg, + platform_version: &PlatformVersion, + ) -> Result, Error> { + if let Some(estimated_costs_only_with_layer_info) = estimated_costs_only_with_layer_info { + Drive::add_estimation_costs_for_contract_document_removal( + contract_id.to_buffer(), + document_type_name, + estimated_costs_only_with_layer_info, + &platform_version.drive, + )?; + } + + let storage_flags = StorageFlags::new_single_epoch( + block_info.epoch.index, + Some(removal.moderator_id.to_buffer()), + ); + + let path_key_element = PathFixedSizeKeyRefElement(( + contract_document_type_removals_path(contract_id.as_slice(), document_type_name), + document_id.as_slice(), + Element::new_item_with_flags( + encode_document_removal(removal), + storage_flags.to_some_element_flags(), + ), + )); + + let mut batch_operations: Vec = vec![]; + self.batch_insert( + path_key_element, + &mut batch_operations, + &platform_version.drive, + )?; + + Ok(batch_operations) + } +} diff --git a/packages/rs-drive/src/drive/contract/moderation/document_removal_tests.rs b/packages/rs-drive/src/drive/contract/moderation/document_removal_tests.rs new file mode 100644 index 00000000000..0bdd77d4fd0 --- /dev/null +++ b/packages/rs-drive/src/drive/contract/moderation/document_removal_tests.rs @@ -0,0 +1,824 @@ +//! The records of the documents a contract's moderators deleted: their trees, their writer, +//! the reads and proofs over them, and the storage refund a moderated deletion forfeits. + +use crate::drive::contract::moderation::types::{ + ContractDocumentRemovalEntry, ContractDocumentRemovalsQuery, ContractDocumentRemovalsSelection, +}; +use crate::drive::contract::paths::{ + contract_document_removals_path, contract_other_path, CONTRACT_BANLIST_KEY, + CONTRACT_DOCUMENT_REMOVALS_KEY, CONTRACT_OTHER_KEY, CONTRACT_VERSION_KEY, +}; +use crate::drive::document::paths::contract_documents_primary_key_path; +use crate::drive::{Drive, RootTree}; +use crate::util::batch::DriveOperation::{ContractModerationOperation, DocumentOperation}; +use crate::util::batch::{ + ContractFeePotOperationType, ContractModerationOperationType, DocumentOperationType, + DriveOperation, +}; +use crate::util::grove_operations::DirectQueryType; +use crate::util::object_size_info::DocumentInfo::DocumentRefInfo; +use crate::util::object_size_info::{ + DataContractInfo, DocumentAndContractInfo, DocumentTypeInfo, OwnedDocumentInfo, +}; +use crate::util::storage_flags::StorageFlags; +use crate::util::test_helpers::setup::setup_drive_with_initial_state_structure; +use dpp::block::block_info::BlockInfo; +use dpp::block::epoch::Epoch; +use dpp::data_contract::accessors::v0::{DataContractV0Getters, DataContractV0Setters}; +use dpp::data_contract::config::moderation::{ + ContractDocumentRemoval, ContractModerationConfig, ContractModerationReason, ContractModerators, +}; +use dpp::data_contract::document_type::action_fees::{ContractFeePot, ContractFeePotLastClaim}; +use dpp::data_contract::document_type::random_document::CreateRandomDocument; +use dpp::data_contract::schema::DataContractSchemaMethodsV0; +use dpp::data_contract::DataContract; +use dpp::document::{Document, DocumentV0Getters, DocumentV0Setters}; +use dpp::fee::default_costs::CachedEpochIndexFeeVersions; +use dpp::fee::fee_result::FeeResult; +use dpp::identifier::Identifier; +use dpp::platform_value::{platform_value, Value}; +use dpp::tests::fixtures::get_data_contract_fixture; +use dpp::version::fee::FeeVersion; +use dpp::version::PlatformVersion; +use grovedb::Element; +use once_cell::sync::Lazy; +use std::borrow::Cow; +use std::collections::BTreeMap; + +static FEE_VERSIONS: Lazy = + Lazy::new(|| BTreeMap::from([(0, FeeVersion::first())])); + +const POST: &str = "post"; + +fn identity(seed: u8) -> Identifier { + Identifier::from([seed; 32]) +} + +fn post_schema(deletable_by_moderators: bool) -> Value { + platform_value!({ + "type": "object", + "properties": { + "text": { "type": "string", "maxLength": 50, "position": 0 }, + }, + "required": ["text"], + "additionalProperties": false, + "canBeDeletedByModerators": deletable_by_moderators, + }) +} + +/// The fixture contract, declaring moderation when `moderated`, and with each of +/// `deletable_types` as a document type moderators can delete documents of. +fn contract_with(moderated: bool, banlist: bool, deletable_types: &[&str]) -> DataContract { + let platform_version = PlatformVersion::latest(); + let mut contract = + get_data_contract_fixture(None, 0, platform_version.protocol_version).data_contract_owned(); + let moderation = moderated.then_some(ContractModerationConfig { + banlist, + suspensions: false, + moderators: ContractModerators::ContractOwner, + }); + contract.set_config(contract.config().clone().with_moderation(moderation)); + for name in deletable_types { + add_deletable_type(&mut contract, name); + } + contract +} + +fn add_deletable_type(contract: &mut DataContract, name: &str) { + contract + .set_document_schema( + name, + post_schema(true), + true, + &mut vec![], + PlatformVersion::latest(), + ) + .expect("expected to add a document type moderators can delete from"); +} + +fn insert(drive: &Drive, contract: &DataContract) { + drive + .insert_contract( + contract, + BlockInfo::default(), + true, + None, + PlatformVersion::latest(), + ) + .expect("expected to insert the contract"); +} + +fn has_removals_root(drive: &Drive, contract_id: Identifier) -> bool { + drive + .grove_has_raw( + (&contract_other_path(contract_id.as_slice())).into(), + &[CONTRACT_DOCUMENT_REMOVALS_KEY], + DirectQueryType::StatefulDirectQuery, + None, + &mut vec![], + &PlatformVersion::latest().drive, + ) + .expect("expected to query the contract's other tree") +} + +fn has_removals_tree_of(drive: &Drive, contract_id: Identifier, document_type_name: &str) -> bool { + drive + .grove_has_raw( + (&contract_document_removals_path(contract_id.as_slice())).into(), + document_type_name.as_bytes(), + DirectQueryType::StatefulDirectQuery, + None, + &mut vec![], + &PlatformVersion::latest().drive, + ) + .expect("expected to query the contract's removals tree") +} + +fn removal(owner: u8, moderator: u8, text: &str, removed_at: u64) -> ContractDocumentRemoval { + ContractDocumentRemoval { + document_owner_id: identity(owner), + moderator_id: identity(moderator), + reason: ContractModerationReason { + code: Some(7), + text: text.to_string(), + }, + removed_at, + } +} + +fn record<'a>( + contract_id: Identifier, + document_id: Identifier, + removal: ContractDocumentRemoval, +) -> DriveOperation<'a> { + ContractModerationOperation(ContractModerationOperationType::AddDocumentRemoval { + contract_id, + document_type_name: POST.to_string(), + document_id, + removal, + }) +} + +fn apply(drive: &Drive, operations: Vec, apply: bool) -> FeeResult { + drive + .apply_drive_operations( + operations, + apply, + &BlockInfo::default_with_epoch(Epoch::new(3).expect("epoch")), + None, + PlatformVersion::latest(), + Some(&FEE_VERSIONS), + ) + .expect("expected to apply the operations") +} + +fn by_ids(ids: &[Identifier]) -> ContractDocumentRemovalsQuery { + ContractDocumentRemovalsQuery { + document_type_name: POST.to_string(), + selection: ContractDocumentRemovalsSelection::DocumentIds(ids.to_vec()), + } +} + +fn page(start_after: Option, limit: u16) -> ContractDocumentRemovalsQuery { + ContractDocumentRemovalsQuery { + document_type_name: POST.to_string(), + selection: ContractDocumentRemovalsSelection::Page { start_after, limit }, + } +} + +/// Fetches, proves and verifies one read and checks all three agree. +fn assert_removals( + drive: &Drive, + contract_id: Identifier, + query: &ContractDocumentRemovalsQuery, + expected: Vec, +) { + let platform_version = PlatformVersion::latest(); + let fetched = drive + .fetch_contract_document_removals(contract_id, query, None, platform_version) + .expect("expected to fetch the removals"); + assert_eq!(fetched, expected, "fetched"); + + let proof = drive + .prove_contract_document_removals(contract_id, query, None, platform_version) + .expect("expected a removals proof"); + let (proved_root, proved) = + Drive::verify_contract_document_removals(&proof, contract_id, query, platform_version) + .expect("expected the proof to verify"); + assert_eq!(proved, expected, "proved"); + let root = drive + .grove + .root_hash(None, &platform_version.drive.grove_version) + .unwrap() + .expect("expected a root hash"); + assert_eq!(proved_root, root); +} + +#[test] +fn should_create_the_removal_trees_with_the_contract() { + let platform_version = PlatformVersion::latest(); + + // Moderated, with a document type moderators can delete from: the tree and the type's. + let drive = setup_drive_with_initial_state_structure(Some(platform_version)); + let contract = contract_with(true, false, &[POST]); + insert(&drive, &contract); + assert!(has_removals_root(&drive, contract.id())); + assert!(has_removals_tree_of(&drive, contract.id(), POST)); + // A document type that does not set the keyword gets none. + assert!(!has_removals_tree_of(&drive, contract.id(), "niceDocument")); + + // Moderated with lists only: nothing, so its other tree keeps the shape it had. The + // update that adds the first such document type brings the tree. + let drive = setup_drive_with_initial_state_structure(Some(platform_version)); + let contract = contract_with(true, true, &[]); + insert(&drive, &contract); + assert!(!has_removals_root(&drive, contract.id())); + + // Not moderated: nothing. + let drive = setup_drive_with_initial_state_structure(Some(platform_version)); + let contract = contract_with(false, false, &[]); + insert(&drive, &contract); + assert!(!has_removals_root(&drive, contract.id())); +} + +#[test] +fn should_create_the_removal_tree_of_a_document_type_an_update_adds() { + let platform_version = PlatformVersion::latest(); + let drive = setup_drive_with_initial_state_structure(Some(platform_version)); + let mut contract = contract_with(true, true, &[POST]); + insert(&drive, &contract); + let document_id = identity(0x31); + apply( + &drive, + vec![record( + contract.id(), + document_id, + removal(1, 2, "spam", 10), + )], + true, + ); + + add_deletable_type(&mut contract, "reply"); + contract.increment_version(); + // The estimate creates the same tree, and costs at least what the update then pays. + let estimated = drive + .update_contract( + &contract, + BlockInfo::default(), + false, + None, + platform_version, + Some(&FEE_VERSIONS), + ) + .expect("expected to estimate the update"); + let applied = drive + .update_contract( + &contract, + BlockInfo::default(), + true, + None, + platform_version, + Some(&FEE_VERSIONS), + ) + .expect("expected to update the contract"); + assert!(estimated.storage_fee >= applied.storage_fee); + + assert!(has_removals_tree_of(&drive, contract.id(), "reply")); + // The type the contract already had keeps its tree, and what is in it. + assert_removals( + &drive, + contract.id(), + &by_ids(&[document_id]), + vec![ContractDocumentRemovalEntry { + document_id, + removal: removal(1, 2, "spam", 10), + }], + ); +} + +#[test] +fn should_create_the_removals_tree_with_the_first_document_type_an_update_adds() { + let platform_version = PlatformVersion::latest(); + let drive = setup_drive_with_initial_state_structure(Some(platform_version)); + // Lists only: no document type moderators can delete from, so no removals tree. + let mut contract = contract_with(true, true, &[]); + insert(&drive, &contract); + assert!(!has_removals_root(&drive, contract.id())); + + add_deletable_type(&mut contract, POST); + contract.increment_version(); + drive + .update_contract( + &contract, + BlockInfo::default(), + true, + None, + platform_version, + Some(&FEE_VERSIONS), + ) + .expect("expected to update the contract"); + assert!(has_removals_root(&drive, contract.id())); + assert!(has_removals_tree_of(&drive, contract.id(), POST)); + + // And it takes records. + let document_id = identity(0x31); + apply( + &drive, + vec![record( + contract.id(), + document_id, + removal(1, 2, "spam", 10), + )], + true, + ); + assert_removals( + &drive, + contract.id(), + &by_ids(&[document_id]), + vec![ContractDocumentRemovalEntry { + document_id, + removal: removal(1, 2, "spam", 10), + }], + ); +} + +#[test] +fn should_keep_the_banlist_on_top_of_the_other_tree_when_every_tree_is_created_at_once() { + // A Merk built from one sorted batch roots at its middle key. The removals tree sorts + // below the version item, so that a contract keeping both lists, the one whose other tree + // holds four keys, still has the banlist, which every document transition reads, on top. + // With fewer keys the version item is on top: nothing reads the removals tree on the way + // to a list but a client. + let platform_version = PlatformVersion::latest(); + for (banlist, suspensions, top_of_other) in [ + (false, false, CONTRACT_VERSION_KEY), + (true, false, CONTRACT_VERSION_KEY), + (false, true, CONTRACT_VERSION_KEY), + (true, true, CONTRACT_BANLIST_KEY), + ] { + let drive = setup_drive_with_initial_state_structure(Some(platform_version)); + let mut contract = get_data_contract_fixture(None, 0, platform_version.protocol_version) + .data_contract_owned(); + contract.set_config(contract.config().clone().with_moderation(Some( + ContractModerationConfig { + banlist, + suspensions, + moderators: ContractModerators::ContractOwner, + }, + ))); + add_deletable_type(&mut contract, POST); + insert(&drive, &contract); + + let contracts_root: &[u8] = Into::<&[u8; 1]>::into(RootTree::DataContractDocuments); + let other = drive + .grove + .get_raw( + (&[contracts_root, contract.id_ref().as_slice()]).into(), + &[CONTRACT_OTHER_KEY], + None, + &platform_version.drive.grove_version, + ) + .unwrap() + .expect("expected the other tree"); + let Element::Tree(root_key, _) = other else { + panic!("expected a tree, got {other:?}"); + }; + assert_eq!( + root_key, + Some(vec![top_of_other]), + "banlist {banlist}, suspensions {suspensions}" + ); + } +} + +#[test] +fn should_lose_the_top_of_the_other_tree_to_the_version_item_once_both_fee_pots_were_claimed() { + // The fullest other tree: both lists, the removals tree and the last claim of both + // fee pots. Four of its six keys then sort below the banlist, and no balanced tree roots + // at a key with four keys on one side and one on the other: the version item takes the + // top and the banlist sits one level down. Any key above the banlist would instead cost + // the banlist the top from the contract's creation on, claims or not. Pinned so that a + // change of either layout shows here. + let platform_version = PlatformVersion::latest(); + let drive = setup_drive_with_initial_state_structure(Some(platform_version)); + let mut contract = + get_data_contract_fixture(None, 0, platform_version.protocol_version).data_contract_owned(); + contract.set_config(contract.config().clone().with_moderation(Some( + ContractModerationConfig { + banlist: true, + suspensions: true, + moderators: ContractModerators::ContractOwner, + }, + ))); + add_deletable_type(&mut contract, POST); + insert(&drive, &contract); + + let top_of_other = |drive: &Drive| { + let contracts_root: &[u8] = Into::<&[u8; 1]>::into(RootTree::DataContractDocuments); + let other = drive + .grove + .get_raw( + (&[contracts_root, contract.id_ref().as_slice()]).into(), + &[CONTRACT_OTHER_KEY], + None, + &platform_version.drive.grove_version, + ) + .unwrap() + .expect("expected the other tree"); + match other { + Element::Tree(root_key, _) => root_key, + other => panic!("expected a tree, got {other:?}"), + } + }; + assert_eq!(top_of_other(&drive), Some(vec![CONTRACT_BANLIST_KEY])); + + // One pot claimed: the banlist stays on top. + let claim = |pot| { + apply( + &drive, + vec![DriveOperation::ContractFeePotOperation( + ContractFeePotOperationType::SetLastClaim { + contract_id: contract.id(), + pot, + last_claim: ContractFeePotLastClaim { + epoch_index: 3, + time_ms: 1_000, + claimant_id: contract.owner_id(), + }, + }, + )], + true, + ); + }; + claim(ContractFeePot::Owner); + assert_eq!(top_of_other(&drive), Some(vec![CONTRACT_BANLIST_KEY])); + + // Both claimed: the version item. + claim(ContractFeePot::Moderators); + assert_eq!(top_of_other(&drive), Some(vec![CONTRACT_VERSION_KEY])); +} + +#[test] +fn should_record_read_and_prove_removals() { + let platform_version = PlatformVersion::latest(); + let drive = setup_drive_with_initial_state_structure(Some(platform_version)); + let contract = contract_with(true, false, &[POST]); + insert(&drive, &contract); + let contract_id = contract.id(); + + // Nothing yet: every id absent, the page empty. + assert_removals(&drive, contract_id, &by_ids(&[identity(0x31)]), vec![]); + assert_removals(&drive, contract_id, &page(None, 10), vec![]); + + let entries: Vec = [0x31u8, 0x32, 0x33] + .into_iter() + .map(|seed| ContractDocumentRemovalEntry { + document_id: identity(seed), + removal: removal(seed + 0x10, 2, "spam", 1_000 + seed as u64), + }) + .collect(); + for entry in &entries { + apply( + &drive, + vec![record( + contract_id, + entry.document_id, + entry.removal.clone(), + )], + true, + ); + } + + // By ids: the ones with a record, in id order, whatever order they were named in; an id + // with no record is absent from the result, and proved so. + assert_removals( + &drive, + contract_id, + &by_ids(&[identity(0x33), identity(0x99), identity(0x31)]), + vec![entries[0].clone(), entries[2].clone()], + ); + + // Pages, in id order, continuing after the cursor. + assert_removals(&drive, contract_id, &page(None, 2), entries[..2].to_vec()); + assert_removals( + &drive, + contract_id, + &page(Some(identity(0x32)), 2), + entries[2..].to_vec(), + ); + assert_removals(&drive, contract_id, &page(Some(identity(0x33)), 2), vec![]); + + // A contract nobody has, and a document type that keeps no records, read as none. + assert_eq!( + drive + .fetch_contract_document_removals( + identity(0x77), + &page(None, 2), + None, + platform_version + ) + .expect("expected to read an unknown contract as empty"), + vec![] + ); + let other_type = ContractDocumentRemovalsQuery { + document_type_name: "niceDocument".to_string(), + selection: ContractDocumentRemovalsSelection::Page { + start_after: None, + limit: 2, + }, + }; + assert_eq!( + drive + .fetch_contract_document_removals(contract_id, &other_type, None, platform_version) + .expect("expected to read a type without records as empty"), + vec![] + ); +} + +#[test] +fn should_refuse_a_read_out_of_bounds() { + let platform_version = PlatformVersion::latest(); + let drive = setup_drive_with_initial_state_structure(Some(platform_version)); + let contract = contract_with(true, false, &[POST]); + insert(&drive, &contract); + let max = platform_version.drive_abci.query.max_returned_elements; + + let too_many: Vec = (0..=max) + .map(|n| { + let mut id = [0u8; 32]; + id[..2].copy_from_slice(&n.to_be_bytes()); + Identifier::from(id) + }) + .collect(); + for query in [ + by_ids(&[]), + by_ids(&too_many), + by_ids(&[identity(1), identity(1)]), + page(None, 0), + page(None, max + 1), + ] { + drive + .fetch_contract_document_removals(contract.id(), &query, None, platform_version) + .expect_err("expected the read to be refused"); + drive + .prove_contract_document_removals(contract.id(), &query, None, platform_version) + .expect_err("expected the proof to be refused"); + } +} + +#[test] +fn should_estimate_a_record_at_no_less_than_it_costs() { + let platform_version = PlatformVersion::latest(); + let drive = setup_drive_with_initial_state_structure(Some(platform_version)); + let contract = contract_with(true, false, &[POST]); + insert(&drive, &contract); + let longest = "x".repeat( + platform_version + .system_limits + .max_contract_moderation_reason_length as usize, + ); + + for text in ["", "spam", longest.as_str()] { + let operations = || { + vec![record( + contract.id(), + identity(text.len() as u8), + removal(1, 2, text, 10), + )] + }; + let estimated = apply(&drive, operations(), false); + let applied = apply(&drive, operations(), true); + assert!( + estimated.storage_fee >= applied.storage_fee, + "a {}-byte reason: estimated {} < applied {}", + text.len(), + estimated.storage_fee, + applied.storage_fee + ); + // The moderator pays for the reason byte for byte. + assert!(applied.storage_fee > 0); + } +} + +fn add_post(drive: &Drive, contract: &DataContract, owner_id: Identifier) -> Document { + let platform_version = PlatformVersion::latest(); + let document_type = contract + .document_type_for_name(POST) + .expect("expected the post document type"); + let mut document = document_type + .random_document(Some(5), platform_version) + .expect("expected a random post"); + document.set_owner_id(owner_id); + let storage_flags = Some(Cow::Owned(StorageFlags::SingleEpochOwned( + 0, + owner_id.to_buffer(), + ))); + drive + .add_document_for_contract( + DocumentAndContractInfo { + owned_document_info: OwnedDocumentInfo { + document_info: DocumentRefInfo((&document, storage_flags)), + owner_id: None, + }, + contract, + document_type, + }, + false, + BlockInfo::default(), + true, + None, + platform_version, + None, + ) + .expect("expected to add the post"); + document +} + +fn delete_post<'a>(contract: &'a DataContract, document_id: Identifier) -> DriveOperation<'a> { + DocumentOperation(DocumentOperationType::DeleteDocument { + document_id, + contract_info: DataContractInfo::BorrowedDataContract(contract), + document_type_info: DocumentTypeInfo::DocumentTypeName(POST.to_string()), + }) +} + +fn delete_post_by_moderator<'a>( + contract: &'a DataContract, + document_id: Identifier, +) -> DriveOperation<'a> { + DocumentOperation(DocumentOperationType::DeleteDocumentByModerator { + document_id, + contract_info: DataContractInfo::BorrowedDataContract(contract), + document_type_info: DocumentTypeInfo::DocumentTypeName(POST.to_string()), + }) +} + +fn forfeit<'a>() -> DriveOperation<'a> { + ContractModerationOperation(ContractModerationOperationType::ForfeitStorageRefunds) +} + +#[test] +fn should_refund_nobody_for_a_document_a_moderator_deletes() { + let platform_version = PlatformVersion::latest(); + let author = identity(0x41); + let moderator = identity(0x42); + + // The author's own deletion: the author is refunded for the storage the post frees. + let drive = setup_drive_with_initial_state_structure(Some(platform_version)); + let contract = contract_with(true, false, &[POST]); + insert(&drive, &contract); + let post = add_post(&drive, &contract, author); + // An estimate carries no refund, the owner's own deletion included: refunds are computed + // from the flags of what is really removed. The forfeiture therefore only shows once + // applied, and the mempool's fee check is the same with or without it. + let own_estimate = apply(&drive, vec![delete_post(&contract, post.id())], false); + assert!(own_estimate.fee_refunds.0.is_empty()); + let own = apply(&drive, vec![delete_post(&contract, post.id())], true); + let refunded: u64 = own + .fee_refunds + .get(author.as_bytes()) + .expect("expected the author to be refunded") + .values() + .sum(); + assert!(refunded > 0); + assert_eq!(own.removed_bytes_from_system, 0); + + // A moderator's deletion of the same post: the same bytes leave the system, nobody is + // refunded, and the moderator pays for the record. + let drive = setup_drive_with_initial_state_structure(Some(platform_version)); + insert(&drive, &contract); + let post = add_post(&drive, &contract, author); + let operations = || { + vec![ + delete_post_by_moderator(&contract, post.id()), + record( + contract.id(), + post.id(), + ContractDocumentRemoval { + document_owner_id: author, + moderator_id: moderator, + reason: ContractModerationReason::from_text("spam"), + removed_at: 10, + }, + ), + forfeit(), + ] + }; + let estimated = apply(&drive, operations(), false); + assert!(estimated.fee_refunds.0.is_empty()); + + let moderated = apply(&drive, operations(), true); + assert!( + moderated.fee_refunds.0.is_empty(), + "nobody is refunded: {:?}", + moderated.fee_refunds + ); + assert!(moderated.removed_bytes_from_system > 0); + assert!( + moderated.storage_fee > 0, + "the moderator pays for the record" + ); + + // The post is gone and its record is there. + let post_is_stored = drive + .grove_has_raw( + (&contract_documents_primary_key_path(contract.id_ref().as_bytes(), POST)).into(), + post.id().as_slice(), + DirectQueryType::StatefulDirectQuery, + None, + &mut vec![], + &platform_version.drive, + ) + .expect("expected to query the posts"); + assert!(!post_is_stored); + assert_removals( + &drive, + contract.id(), + &by_ids(&[post.id()]), + vec![ContractDocumentRemovalEntry { + document_id: post.id(), + removal: ContractDocumentRemoval { + document_owner_id: author, + moderator_id: moderator, + reason: ContractModerationReason::from_text("spam"), + removed_at: 10, + }, + }], + ); +} + +#[test] +fn should_delete_for_a_moderator_a_document_its_owner_can_not_delete() { + // `canBeDeleted` rules what a document's own owner may do. A post nobody can retract, but + // moderation can remove, is the case the keyword exists for. + let platform_version = PlatformVersion::latest(); + let drive = setup_drive_with_initial_state_structure(Some(platform_version)); + let mut contract = contract_with(true, false, &[]); + let mut schema = post_schema(true); + schema + .insert("canBeDeleted".to_string(), Value::Bool(false)) + .expect("expected to set canBeDeleted"); + contract + .set_document_schema(POST, schema, true, &mut vec![], platform_version) + .expect("expected to add the post type"); + insert(&drive, &contract); + let post = add_post(&drive, &contract, identity(0x41)); + + // The owner's deletion is refused by Drive, as it always was. + drive + .apply_drive_operations( + vec![delete_post(&contract, post.id())], + true, + &BlockInfo::default(), + None, + platform_version, + Some(&FEE_VERSIONS), + ) + .expect_err("expected the owner's deletion to be refused"); + + // The moderators' is not, estimated or applied. + apply( + &drive, + vec![delete_post_by_moderator(&contract, post.id()), forfeit()], + false, + ); + apply( + &drive, + vec![delete_post_by_moderator(&contract, post.id()), forfeit()], + true, + ); + let post_is_stored = drive + .grove_has_raw( + (&contract_documents_primary_key_path(contract.id_ref().as_bytes(), POST)).into(), + post.id().as_slice(), + DirectQueryType::StatefulDirectQuery, + None, + &mut vec![], + &platform_version.drive, + ) + .expect("expected to query the posts"); + assert!(!post_is_stored); +} + +#[test] +fn should_keep_refunding_a_batch_without_the_forfeiture_before_protocol_version_14() { + // Generation 0 of `apply_drive_operations`, which every earlier protocol version runs, + // knows nothing of the marker: a batch is refunded as it always was. + let platform_version = PlatformVersion::get(13).expect("expected protocol version 13"); + assert_eq!( + platform_version + .drive + .methods + .batch_operations + .apply_drive_operations, + 0 + ); + assert_eq!( + PlatformVersion::latest() + .drive + .methods + .batch_operations + .apply_drive_operations, + 1 + ); +} diff --git a/packages/rs-drive/src/drive/contract/moderation/estimated_costs/mod.rs b/packages/rs-drive/src/drive/contract/moderation/estimated_costs/mod.rs index 3031f65f97b..14b0b523864 100644 --- a/packages/rs-drive/src/drive/contract/moderation/estimated_costs/mod.rs +++ b/packages/rs-drive/src/drive/contract/moderation/estimated_costs/mod.rs @@ -63,4 +63,57 @@ impl Drive { })), } } + + /// Adds the layers a contract insertion or update touches when it creates the trees of + /// the document removal records. + pub(crate) fn add_estimation_costs_for_contract_document_removal_trees( + contract_id: [u8; 32], + estimated_costs_only_with_layer_info: &mut HashMap, + drive_version: &DriveVersion, + ) -> Result<(), Error> { + match drive_version + .methods + .contract + .moderation + .add_estimation_costs_for_contract_document_removal + { + 0 => Self::add_estimation_costs_for_contract_document_removal_trees_v0( + contract_id, + estimated_costs_only_with_layer_info, + drive_version, + ), + version => Err(Error::Drive(DriveError::UnknownVersionMismatch { + method: "add_estimation_costs_for_contract_document_removal_trees".to_string(), + known_versions: vec![0], + received: version, + })), + } + } + + /// Adds the layers the record of a moderator's document deletion is written through. + pub(crate) fn add_estimation_costs_for_contract_document_removal( + contract_id: [u8; 32], + document_type_name: &str, + estimated_costs_only_with_layer_info: &mut HashMap, + drive_version: &DriveVersion, + ) -> Result<(), Error> { + match drive_version + .methods + .contract + .moderation + .add_estimation_costs_for_contract_document_removal + { + 0 => Self::add_estimation_costs_for_contract_document_removal_v0( + contract_id, + document_type_name, + estimated_costs_only_with_layer_info, + drive_version, + ), + version => Err(Error::Drive(DriveError::UnknownVersionMismatch { + method: "add_estimation_costs_for_contract_document_removal".to_string(), + known_versions: vec![0], + received: version, + })), + } + } } diff --git a/packages/rs-drive/src/drive/contract/moderation/estimated_costs/v0/mod.rs b/packages/rs-drive/src/drive/contract/moderation/estimated_costs/v0/mod.rs index d9fcd90ff23..35b05161fa0 100644 --- a/packages/rs-drive/src/drive/contract/moderation/estimated_costs/v0/mod.rs +++ b/packages/rs-drive/src/drive/contract/moderation/estimated_costs/v0/mod.rs @@ -1,5 +1,13 @@ -use crate::drive::contract::moderation::types::estimated_entry_value_size; -use crate::drive::contract::paths::contract_moderation_list_path; +use crate::drive::constants::{ + ESTIMATED_AVERAGE_DOCUMENT_TYPE_NAME_SIZE, ESTIMATED_DOCUMENT_TYPES_DELETABLE_BY_MODERATORS, +}; +use crate::drive::contract::moderation::types::{ + estimated_document_removal_value_size, estimated_entry_value_size, +}; +use crate::drive::contract::paths::{ + contract_document_removals_path, contract_document_type_removals_path, + contract_moderation_list_path, +}; use crate::drive::Drive; use crate::error::Error; use crate::util::storage_flags::StorageFlags; @@ -7,8 +15,9 @@ use crate::util::type_constants::DEFAULT_HASH_SIZE_U8; use dpp::data_contract::config::moderation::ContractModerationList; use dpp::version::drive_versions::DriveVersion; use grovedb::batch::KeyInfoPath; -use grovedb::EstimatedLayerCount::PotentiallyAtMaxElements; -use grovedb::EstimatedLayerSizes::AllItems; +use grovedb::EstimatedLayerCount::{ApproximateElements, PotentiallyAtMaxElements}; +use grovedb::EstimatedLayerSizes::{AllItems, AllSubtrees}; +use grovedb::EstimatedSumTrees::NoSumTrees; use grovedb::{EstimatedLayerInformation, TreeType}; use std::collections::HashMap; @@ -63,4 +72,69 @@ impl Drive { Ok(()) } + + pub(super) fn add_estimation_costs_for_contract_document_removal_trees_v0( + contract_id: [u8; 32], + estimated_costs_only_with_layer_info: &mut HashMap, + drive_version: &DriveVersion, + ) -> Result<(), Error> { + Self::add_estimation_costs_for_contract_moderation_trees_v0( + contract_id, + estimated_costs_only_with_layer_info, + drive_version, + )?; + + // The tree of all the records (`[64, id, 2, 16]`): one subtree per document type + // moderators may delete documents of, keyed by the type's name. A contract has few. + estimated_costs_only_with_layer_info.insert( + KeyInfoPath::from_known_path(contract_document_removals_path(&contract_id)), + EstimatedLayerInformation { + tree_type: TreeType::NormalTree, + estimated_layer_count: ApproximateElements( + ESTIMATED_DOCUMENT_TYPES_DELETABLE_BY_MODERATORS, + ), + estimated_layer_sizes: AllSubtrees( + ESTIMATED_AVERAGE_DOCUMENT_TYPE_NAME_SIZE, + NoSumTrees, + Some(StorageFlags::approximate_size(true, None)), + ), + }, + ); + + Ok(()) + } + + pub(super) fn add_estimation_costs_for_contract_document_removal_v0( + contract_id: [u8; 32], + document_type_name: &str, + estimated_costs_only_with_layer_info: &mut HashMap, + drive_version: &DriveVersion, + ) -> Result<(), Error> { + Self::add_estimation_costs_for_contract_document_removal_trees_v0( + contract_id, + estimated_costs_only_with_layer_info, + drive_version, + )?; + + // The records of one document type: one item per removed document, keyed by document + // id. The records a write walks past are sized like a typical one; the record being + // written is priced by its own size. + estimated_costs_only_with_layer_info.insert( + KeyInfoPath::from_known_path(contract_document_type_removals_path( + &contract_id, + document_type_name, + )), + EstimatedLayerInformation { + tree_type: TreeType::NormalTree, + estimated_layer_count: PotentiallyAtMaxElements, + estimated_layer_sizes: AllItems( + DEFAULT_HASH_SIZE_U8, + estimated_document_removal_value_size(), + Some(StorageFlags::approximate_size(true, None)), + ), + }, + ); + + Ok(()) + } } diff --git a/packages/rs-drive/src/drive/contract/moderation/fetch_contract_document_removals/mod.rs b/packages/rs-drive/src/drive/contract/moderation/fetch_contract_document_removals/mod.rs new file mode 100644 index 00000000000..2440462a6be --- /dev/null +++ b/packages/rs-drive/src/drive/contract/moderation/fetch_contract_document_removals/mod.rs @@ -0,0 +1,44 @@ +mod v0; + +use crate::drive::contract::moderation::types::{ + ContractDocumentRemovalEntry, ContractDocumentRemovalsQuery, +}; +use crate::drive::Drive; +use crate::error::drive::DriveError; +use crate::error::Error; +use dpp::identifier::Identifier; +use dpp::version::PlatformVersion; +use grovedb::TransactionArg; + +impl Drive { + /// The records of the documents a contract's moderators deleted, within one document type: + /// the ones of the ids named, or one page in document id order. A contract or a document + /// type that keeps no records reads as none. + pub fn fetch_contract_document_removals( + &self, + contract_id: Identifier, + query: &ContractDocumentRemovalsQuery, + transaction: TransactionArg, + platform_version: &PlatformVersion, + ) -> Result, Error> { + match platform_version + .drive + .methods + .contract + .moderation + .fetch_contract_document_removals + { + 0 => self.fetch_contract_document_removals_v0( + contract_id, + query, + transaction, + platform_version, + ), + version => Err(Error::Drive(DriveError::UnknownVersionMismatch { + method: "fetch_contract_document_removals".to_string(), + known_versions: vec![0], + received: version, + })), + } + } +} diff --git a/packages/rs-drive/src/drive/contract/moderation/fetch_contract_document_removals/v0/mod.rs b/packages/rs-drive/src/drive/contract/moderation/fetch_contract_document_removals/v0/mod.rs new file mode 100644 index 00000000000..39ab4529ae9 --- /dev/null +++ b/packages/rs-drive/src/drive/contract/moderation/fetch_contract_document_removals/v0/mod.rs @@ -0,0 +1,76 @@ +use crate::drive::contract::moderation::types::{ + ContractDocumentRemovalEntry, ContractDocumentRemovalsQuery, +}; +use crate::drive::contract::paths::contract_document_removals_path; +use crate::drive::Drive; +use crate::error::drive::DriveError; +use crate::error::Error; +use crate::util::grove_operations::DirectQueryType; +use dpp::identifier::Identifier; +use dpp::version::PlatformVersion; +use grovedb::query_result_type::QueryResultType; +use grovedb::TransactionArg; + +impl Drive { + #[inline(always)] + pub(super) fn fetch_contract_document_removals_v0( + &self, + contract_id: Identifier, + query: &ContractDocumentRemovalsQuery, + transaction: TransactionArg, + platform_version: &PlatformVersion, + ) -> Result, Error> { + Self::check_contract_document_removals_query(query, platform_version)?; + + // A path query over a missing tree is an error in GroveDB, so check first. The check + // itself reads under the contract's removals tree, which a contract that declares no + // moderation (or a contract id nobody has) does not have either: that reads as no + // record, like the absence of the document type's own tree. + let exists = match self.grove_has_raw( + (&contract_document_removals_path(contract_id.as_slice())).into(), + query.document_type_name.as_bytes(), + DirectQueryType::StatefulDirectQuery, + transaction, + &mut vec![], + &platform_version.drive, + ) { + Ok(exists) => exists, + Err(Error::GroveDB(error)) + if matches!( + *error, + grovedb::Error::PathParentLayerNotFound(_) | grovedb::Error::PathNotFound(_) + ) => + { + false + } + Err(error) => return Err(error), + }; + if !exists { + return Ok(vec![]); + } + + let path_query = Self::contract_document_removals_query(contract_id.to_buffer(), query); + let (results, _) = self.grove_get_raw_path_query( + &path_query, + transaction, + QueryResultType::QueryKeyElementPairResultType, + &mut vec![], + &platform_version.drive, + )?; + + results + .to_key_elements() + .into_iter() + .map(|(key, element)| { + ContractDocumentRemovalEntry::from_key_element(&key, &element).map_err( + |description| { + Error::Drive(DriveError::CorruptedDriveState(format!( + "contract {} {} document removal is malformed: {}", + contract_id, query.document_type_name, description + ))) + }, + ) + }) + .collect() + } +} diff --git a/packages/rs-drive/src/drive/contract/moderation/insert_contract_document_removal_trees/mod.rs b/packages/rs-drive/src/drive/contract/moderation/insert_contract_document_removal_trees/mod.rs new file mode 100644 index 00000000000..f25d9cf9b13 --- /dev/null +++ b/packages/rs-drive/src/drive/contract/moderation/insert_contract_document_removal_trees/mod.rs @@ -0,0 +1,63 @@ +mod v0; + +use crate::drive::Drive; +use crate::error::drive::DriveError; +use crate::error::Error; +use crate::fees::op::LowLevelDriveOperation; +use crate::util::storage_flags::StorageFlags; +use dpp::version::PlatformVersion; +use grovedb::batch::KeyInfoPath; +use grovedb::{EstimatedLayerInformation, TransactionArg}; +use std::collections::HashMap; + +impl Drive { + /// The operations creating the trees that hold the records of the documents a contract's + /// moderators deleted: the tree of all of them (`[64, id, 2, 16]`) when `with_root` is set, + /// and under it one tree per document type of `document_type_names`. + /// + /// A contract insertion calls it with the root and every document type that sets + /// `canBeDeletedByModerators`, when there is one. A contract update calls it for the + /// document types it adds that set the keyword, with the root when they are the + /// contract's first: an existing document type never changes the keyword, so whether the + /// root exists is read off the stored contract, and a type's tree is created exactly + /// once, with the type. A contract without such a document type has no root, so its other + /// tree keeps the shape it would have had. No tree is made lazily by the first removal. + #[allow(clippy::too_many_arguments)] + pub fn insert_contract_document_removal_trees_operations( + &self, + contract_id: [u8; 32], + with_root: bool, + document_type_names: &[&str], + storage_flags: Option<&StorageFlags>, + estimated_costs_only_with_layer_info: &mut Option< + HashMap, + >, + transaction: TransactionArg, + batch_operations: &mut Vec, + platform_version: &PlatformVersion, + ) -> Result<(), Error> { + match platform_version + .drive + .methods + .contract + .moderation + .insert_contract_document_removal_trees + { + 0 => self.insert_contract_document_removal_trees_operations_v0( + contract_id, + with_root, + document_type_names, + storage_flags, + estimated_costs_only_with_layer_info, + transaction, + batch_operations, + platform_version, + ), + version => Err(Error::Drive(DriveError::UnknownVersionMismatch { + method: "insert_contract_document_removal_trees_operations".to_string(), + known_versions: vec![0], + received: version, + })), + } + } +} diff --git a/packages/rs-drive/src/drive/contract/moderation/insert_contract_document_removal_trees/v0/mod.rs b/packages/rs-drive/src/drive/contract/moderation/insert_contract_document_removal_trees/v0/mod.rs new file mode 100644 index 00000000000..f39c2815113 --- /dev/null +++ b/packages/rs-drive/src/drive/contract/moderation/insert_contract_document_removal_trees/v0/mod.rs @@ -0,0 +1,63 @@ +use crate::drive::contract::paths::{ + contract_document_removals_path, contract_other_path, CONTRACT_DOCUMENT_REMOVALS_KEY, +}; +use crate::drive::Drive; +use crate::error::Error; +use crate::fees::op::LowLevelDriveOperation; +use crate::util::object_size_info::DriveKeyInfo; +use crate::util::storage_flags::StorageFlags; +use dpp::version::PlatformVersion; +use grovedb::batch::KeyInfoPath; +use grovedb::{EstimatedLayerInformation, TransactionArg}; +use std::collections::HashMap; + +impl Drive { + #[inline(always)] + #[allow(clippy::too_many_arguments)] + pub(super) fn insert_contract_document_removal_trees_operations_v0( + &self, + contract_id: [u8; 32], + with_root: bool, + document_type_names: &[&str], + storage_flags: Option<&StorageFlags>, + estimated_costs_only_with_layer_info: &mut Option< + HashMap, + >, + _transaction: TransactionArg, + batch_operations: &mut Vec, + platform_version: &PlatformVersion, + ) -> Result<(), Error> { + if let Some(estimated_costs_only_with_layer_info) = estimated_costs_only_with_layer_info { + Drive::add_estimation_costs_for_contract_document_removal_trees( + contract_id, + estimated_costs_only_with_layer_info, + &platform_version.drive, + )?; + } + + // Unconditional, like the list trees: an insertion (re)creates the contract's root + // subtree in the same batch, and an update only names document types the stored + // contract does not have, whose trees can not exist. + if with_root { + self.batch_insert_empty_tree( + contract_other_path(&contract_id), + DriveKeyInfo::KeyRef(&[CONTRACT_DOCUMENT_REMOVALS_KEY]), + storage_flags, + batch_operations, + &platform_version.drive, + )?; + } + + for document_type_name in document_type_names { + self.batch_insert_empty_tree( + contract_document_removals_path(&contract_id), + DriveKeyInfo::KeyRef(document_type_name.as_bytes()), + storage_flags, + batch_operations, + &platform_version.drive, + )?; + } + + Ok(()) + } +} diff --git a/packages/rs-drive/src/drive/contract/moderation/mod.rs b/packages/rs-drive/src/drive/contract/moderation/mod.rs index e5ae271ccaa..b9dd67737b7 100644 --- a/packages/rs-drive/src/drive/contract/moderation/mod.rs +++ b/packages/rs-drive/src/drive/contract/moderation/mod.rs @@ -12,6 +12,19 @@ //! └── [192] suspensions -> -> Item(until ‖ reason) (when declared) //! ``` //! +//! and the records of the documents the contract's moderators deleted, under the same other +//! tree at key `16` (when the contract has a document type that says so): +//! +//! ```text +//! [16] document removals +//! └── (a type that sets `canBeDeletedByModerators`) +//! └── -> Item(document owner id ‖ moderator id ‖ removed at ‖ reason) +//! ``` +//! +//! `removed at` is a u64 of block time in milliseconds, big-endian: see +//! [`types::encode_document_removal`]. The moderator pays for the record and nothing ever +//! deletes it; the deleted document's own storage refund goes to nobody. +//! //! `until` is a u64 of block time in milliseconds, big-endian. A reason is a tag byte (`0`: no //! code, `1`: a code), the code as a big-endian u16 when tagged, and the text as UTF-8 up to //! the end of the value: see [`types::encode_ban`] and [`types::encode_suspension`]. @@ -24,16 +37,24 @@ #[cfg(feature = "server")] mod add_contract_ban; #[cfg(feature = "server")] +mod add_contract_document_removal; +#[cfg(feature = "server")] mod add_contract_suspension; #[cfg(feature = "server")] mod estimated_costs; #[cfg(feature = "server")] +mod fetch_contract_document_removals; +#[cfg(feature = "server")] mod fetch_contract_moderation_entries; #[cfg(feature = "server")] mod fetch_contract_moderation_status; #[cfg(feature = "server")] +mod insert_contract_document_removal_trees; +#[cfg(feature = "server")] mod insert_contract_moderation_trees; #[cfg(feature = "server")] +mod prove_contract_document_removals; +#[cfg(feature = "server")] mod prove_contract_moderation_entries; #[cfg(feature = "server")] mod prove_contract_moderation_status; @@ -45,6 +66,9 @@ mod remove_contract_suspension; /// Query and result types shared by the fetch and verify sides. pub mod types; +#[cfg(test)] +#[cfg(feature = "server")] +mod document_removal_tests; #[cfg(test)] #[cfg(feature = "server")] mod tests; diff --git a/packages/rs-drive/src/drive/contract/moderation/prove_contract_document_removals/mod.rs b/packages/rs-drive/src/drive/contract/moderation/prove_contract_document_removals/mod.rs new file mode 100644 index 00000000000..d07199d061c --- /dev/null +++ b/packages/rs-drive/src/drive/contract/moderation/prove_contract_document_removals/mod.rs @@ -0,0 +1,43 @@ +mod v0; + +use crate::drive::contract::moderation::types::ContractDocumentRemovalsQuery; +use crate::drive::Drive; +use crate::error::drive::DriveError; +use crate::error::Error; +use dpp::identifier::Identifier; +use dpp::version::PlatformVersion; +use grovedb::TransactionArg; + +impl Drive { + /// Proves the records of the documents a contract's moderators deleted, within one + /// document type: the ones of the ids named (an id with no record is proved absent), or + /// one page in document id order. The document type must be one whose removal tree + /// exists; the caller checks that against the contract. + pub fn prove_contract_document_removals( + &self, + contract_id: Identifier, + query: &ContractDocumentRemovalsQuery, + transaction: TransactionArg, + platform_version: &PlatformVersion, + ) -> Result, Error> { + match platform_version + .drive + .methods + .contract + .moderation + .prove_contract_document_removals + { + 0 => self.prove_contract_document_removals_v0( + contract_id, + query, + transaction, + platform_version, + ), + version => Err(Error::Drive(DriveError::UnknownVersionMismatch { + method: "prove_contract_document_removals".to_string(), + known_versions: vec![0], + received: version, + })), + } + } +} diff --git a/packages/rs-drive/src/drive/contract/moderation/prove_contract_document_removals/v0/mod.rs b/packages/rs-drive/src/drive/contract/moderation/prove_contract_document_removals/v0/mod.rs new file mode 100644 index 00000000000..dbde26ec430 --- /dev/null +++ b/packages/rs-drive/src/drive/contract/moderation/prove_contract_document_removals/v0/mod.rs @@ -0,0 +1,26 @@ +use crate::drive::contract::moderation::types::ContractDocumentRemovalsQuery; +use crate::drive::Drive; +use crate::error::Error; +use dpp::identifier::Identifier; +use dpp::version::PlatformVersion; +use grovedb::TransactionArg; + +impl Drive { + #[inline(always)] + pub(super) fn prove_contract_document_removals_v0( + &self, + contract_id: Identifier, + query: &ContractDocumentRemovalsQuery, + transaction: TransactionArg, + platform_version: &PlatformVersion, + ) -> Result, Error> { + Self::check_contract_document_removals_query(query, platform_version)?; + let path_query = Self::contract_document_removals_query(contract_id.to_buffer(), query); + self.grove_get_proved_path_query( + &path_query, + transaction, + &mut vec![], + &platform_version.drive, + ) + } +} diff --git a/packages/rs-drive/src/drive/contract/moderation/queries.rs b/packages/rs-drive/src/drive/contract/moderation/queries.rs index 3be82fdd4a5..88bb96cc23e 100644 --- a/packages/rs-drive/src/drive/contract/moderation/queries.rs +++ b/packages/rs-drive/src/drive/contract/moderation/queries.rs @@ -1,9 +1,16 @@ -use crate::drive::contract::moderation::types::ContractModerationEntriesQuery; -use crate::drive::contract::paths::contract_moderation_list_path_vec; +use crate::drive::contract::moderation::types::{ + ContractDocumentRemovalsQuery, ContractDocumentRemovalsSelection, + ContractModerationEntriesQuery, +}; +use crate::drive::contract::paths::{ + contract_document_type_removals_path_vec, contract_moderation_list_path_vec, +}; use crate::drive::Drive; +use crate::error::query::QuerySyntaxError; use crate::error::Error; use crate::query::{Query, QueryItem}; use dpp::data_contract::config::moderation::ContractModerationList; +use dpp::version::PlatformVersion; use grovedb::{PathQuery, SizedQuery}; use grovedb_version::version::GroveVersion; use std::ops::RangeFull; @@ -67,4 +74,79 @@ impl Drive { }, } } + + /// The query for the records of the documents a contract's moderators deleted, within one + /// document type: the ids named, each proved present with its record or absent, or one + /// page in document id order continuing after the cursor. The limit of an id read is the + /// number of ids, so the prover and the verifier bound the proof alike. + pub fn contract_document_removals_query( + contract_id: [u8; 32], + removals_query: &ContractDocumentRemovalsQuery, + ) -> PathQuery { + let mut query = Query::new_with_direction(true); + match &removals_query.selection { + ContractDocumentRemovalsSelection::DocumentIds(ids) => { + for id in ids { + query.insert_item(QueryItem::Key(id.to_vec())); + } + } + ContractDocumentRemovalsSelection::Page { + start_after: None, .. + } => query.insert_item(QueryItem::RangeFull(RangeFull)), + ContractDocumentRemovalsSelection::Page { + start_after: Some(document_id), + .. + } => query.insert_item(QueryItem::RangeAfter(document_id.to_vec()..)), + } + PathQuery { + path: contract_document_type_removals_path_vec( + &contract_id, + &removals_query.document_type_name, + ), + query: SizedQuery { + query, + limit: Some(removals_query.limit()), + offset: None, + }, + } + } + + /// A read names at least one and at most `max_returned_elements` records, whether by id or + /// as a page, and no id twice: what bounds the proof the verifier accepts. The one place the + /// bounds are written: Drive, the node's query handler and the proof verifier all call it, + /// so a request the node refuses is one the verifier refuses. + pub fn check_contract_document_removals_query( + query: &ContractDocumentRemovalsQuery, + platform_version: &PlatformVersion, + ) -> Result<(), Error> { + let max_limit = platform_version.drive_abci.query.max_returned_elements; + match &query.selection { + ContractDocumentRemovalsSelection::DocumentIds(ids) => { + if ids.is_empty() || ids.len() > max_limit as usize { + return Err(Error::Query(QuerySyntaxError::InvalidLimit(format!( + "contract document removals must name between 1 and {} document ids, got {}", + max_limit, + ids.len() + )))); + } + let mut sorted = ids.clone(); + sorted.sort_unstable(); + sorted.dedup(); + if sorted.len() != ids.len() { + return Err(Error::Query(QuerySyntaxError::InvalidParameter( + "contract document removals name a document id twice".to_string(), + ))); + } + } + ContractDocumentRemovalsSelection::Page { limit, .. } => { + if *limit == 0 || *limit > max_limit { + return Err(Error::Query(QuerySyntaxError::InvalidLimit(format!( + "contract document removals limit must be between 1 and {}, got {}", + max_limit, limit + )))); + } + } + } + Ok(()) + } } diff --git a/packages/rs-drive/src/drive/contract/moderation/types.rs b/packages/rs-drive/src/drive/contract/moderation/types.rs index eac19a11e2b..a70578bfb8d 100644 --- a/packages/rs-drive/src/drive/contract/moderation/types.rs +++ b/packages/rs-drive/src/drive/contract/moderation/types.rs @@ -1,5 +1,6 @@ use dpp::data_contract::config::moderation::{ - ContractBan, ContractModerationList, ContractModerationReason, ContractSuspension, + ContractBan, ContractDocumentRemoval, ContractModerationList, ContractModerationReason, + ContractSuspension, }; use dpp::identity::TimestampMillis; use dpp::platform_value::Identifier; @@ -85,6 +86,118 @@ pub fn estimated_entry_value_size(list: ContractModerationList) -> u32 { + ESTIMATED_CONTRACT_MODERATION_REASON_TEXT_SIZE } +/// Which removal records of one document type to read. +#[derive(Debug, Clone, PartialEq, Eq)] +pub enum ContractDocumentRemovalsSelection { + /// The records of these document ids. An id with no record is proved absent. + DocumentIds(Vec), + /// One page: at most `limit` records in document id order, continuing after + /// `start_after`. A page shorter than the limit is the last one. + Page { + /// Continue after this document id. + start_after: Option, + /// At most this many records. + limit: u16, + }, +} + +/// A read of the records of the documents a contract's moderators deleted, within one document +/// type. +#[derive(Debug, Clone, PartialEq, Eq)] +pub struct ContractDocumentRemovalsQuery { + /// The document type the documents belonged to. + pub document_type_name: String, + /// Which records. + pub selection: ContractDocumentRemovalsSelection, +} + +impl ContractDocumentRemovalsQuery { + /// The most records the read can return: what bounds its proof. + pub fn limit(&self) -> u16 { + match &self.selection { + ContractDocumentRemovalsSelection::DocumentIds(ids) => { + ids.len().min(u16::MAX as usize) as u16 + } + ContractDocumentRemovalsSelection::Page { limit, .. } => *limit, + } + } +} + +/// The record of one document a moderator deleted. +#[derive(Debug, Clone, PartialEq, Eq)] +pub struct ContractDocumentRemovalEntry { + /// The id the document had. + pub document_id: Identifier, + /// Whose it was, who removed it, why and when. + pub removal: ContractDocumentRemoval, +} + +impl ContractDocumentRemovalEntry { + /// Decodes one stored record: see [`encode_document_removal`]. + pub fn from_key_element(key: &[u8], element: &Element) -> Result { + let document_id = Identifier::from_bytes(key) + .map_err(|_| format!("document removal key is not a document id: {:?}", key))?; + let Element::Item(value, _) = element else { + return Err("document removal is not an item".to_string()); + }; + Ok(Self { + document_id, + removal: decode_document_removal(value)?, + }) + } +} + +/// The stored size of what a document removal starts with: the document owner's id, the +/// moderator's id and the removal time as a u64. +pub const CONTRACT_DOCUMENT_REMOVAL_FIXED_SIZE: usize = 32 + 32 + 8; + +/// The size a document removal record is estimated at when its value is not known: the +/// records a write walks past, sized like a list entry's typical reason. A record being +/// written is priced by its own size. +pub fn estimated_document_removal_value_size() -> u32 { + CONTRACT_DOCUMENT_REMOVAL_FIXED_SIZE as u32 + + CONTRACT_MODERATION_REASON_CODE_MAX_SIZE + + ESTIMATED_CONTRACT_MODERATION_REASON_TEXT_SIZE +} + +/// Encodes a document removal record: the document owner's id, the moderator's id, the removal +/// time as eight big-endian bytes, then the reason as in [`encode_ban`]. +pub fn encode_document_removal(removal: &ContractDocumentRemoval) -> Vec { + let mut value = Vec::with_capacity( + CONTRACT_DOCUMENT_REMOVAL_FIXED_SIZE + reason_encoded_size(&removal.reason), + ); + value.extend_from_slice(removal.document_owner_id.as_slice()); + value.extend_from_slice(removal.moderator_id.as_slice()); + value.extend_from_slice(&removal.removed_at.to_be_bytes()); + encode_reason_into(&removal.reason, &mut value); + value +} + +/// Decodes a document removal record. +pub fn decode_document_removal(value: &[u8]) -> Result { + let cut_short = || { + format!( + "document removal holds {} bytes, expected at least {}", + value.len(), + CONTRACT_DOCUMENT_REMOVAL_FIXED_SIZE + ) + }; + let (document_owner_id, rest) = value.split_first_chunk::<32>().ok_or_else(cut_short)?; + let (moderator_id, rest) = rest.split_first_chunk::<32>().ok_or_else(cut_short)?; + let (removed_at, reason) = rest.split_first_chunk::<8>().ok_or_else(cut_short)?; + // A list entry with no reason bytes is one written before entries carried a reason. No + // record was ever written without one, so here the same bytes are a record cut short. + if reason.is_empty() { + return Err("document removal holds no reason".to_string()); + } + Ok(ContractDocumentRemoval { + document_owner_id: Identifier::from(*document_owner_id), + moderator_id: Identifier::from(*moderator_id), + reason: decode_reason(reason)?, + removed_at: TimestampMillis::from_be_bytes(*removed_at), + }) +} + const REASON_WITHOUT_CODE: u8 = 0; const REASON_WITH_CODE: u8 = 1; @@ -210,6 +323,60 @@ mod tests { ); } + #[test] + fn should_round_trip_a_document_removal() { + let removal = ContractDocumentRemoval { + document_owner_id: Identifier::from([1; 32]), + moderator_id: Identifier::from([2; 32]), + reason: ContractModerationReason { + code: Some(3), + text: "spam".to_string(), + }, + removed_at: 1_700_000_000_123, + }; + let value = encode_document_removal(&removal); + assert_eq!(&value[..32], &[1; 32]); + assert_eq!(&value[32..64], &[2; 32]); + assert_eq!(&value[64..72], &1_700_000_000_123u64.to_be_bytes()); + assert_eq!(&value[72..], [&[1u8, 0, 3][..], b"spam"].concat()); + assert_eq!(decode_document_removal(&value).expect("decode"), removal); + + // No code and no text: what a moderator that gives no reason leaves. + let bare = ContractDocumentRemoval { + reason: ContractModerationReason::default(), + ..removal + }; + let value = encode_document_removal(&bare); + assert_eq!(value.len(), CONTRACT_DOCUMENT_REMOVAL_FIXED_SIZE + 1); + assert_eq!(decode_document_removal(&value).expect("decode"), bare); + + let id = Identifier::from([9; 32]); + assert_eq!( + ContractDocumentRemovalEntry::from_key_element( + id.as_slice(), + &Element::new_item(value) + ) + .expect("decode"), + ContractDocumentRemovalEntry { + document_id: id, + removal: bare, + } + ); + } + + #[test] + fn should_refuse_a_malformed_document_removal() { + decode_document_removal(&[0; 71]).expect_err("cut short"); + decode_document_removal(&[0; 72]).expect_err("no reason"); + let mut unknown_tag = vec![0; 72]; + unknown_tag.push(7); + decode_document_removal(&unknown_tag).expect_err("unknown tag"); + ContractDocumentRemovalEntry::from_key_element(&[1, 2, 3], &Element::new_item(vec![0; 73])) + .expect_err("key is not an id"); + ContractDocumentRemovalEntry::from_key_element(&[4; 32], &Element::empty_tree()) + .expect_err("not an item"); + } + #[test] fn should_refuse_a_malformed_entry() { decode_ban(&[2, b'x']).expect_err("unknown tag"); diff --git a/packages/rs-drive/src/drive/contract/paths.rs b/packages/rs-drive/src/drive/contract/paths.rs index 7472d5e0ae9..c44c599f77f 100644 --- a/packages/rs-drive/src/drive/contract/paths.rs +++ b/packages/rs-drive/src/drive/contract/paths.rs @@ -197,6 +197,15 @@ pub const CONTRACT_BANLIST_KEY: u8 = 128; /// suspension list. pub const CONTRACT_SUSPENSIONS_KEY: u8 = 192; +/// The key under a contract's other tree (`[64, id, 2]`) of the records of the documents the +/// contract's moderators deleted (protocol version 14): `document type name -> document id -> +/// Item(document owner id, moderator id, removed at, reason)`. Present when the contract has a +/// document type that sets `canBeDeletedByModerators`, with one subtree per such type, +/// created with the type. Written by a moderator's document deletion and read by clients, +/// never by a document transition, so it sorts below `128`: created together with both lists +/// it leaves the banlist on top. +pub const CONTRACT_DOCUMENT_REMOVALS_KEY: u8 = 16; + /// `[64, contract id, 2]`: the contract's other tree. pub fn contract_other_path(contract_id: &[u8]) -> [&[u8]; 3] { [ @@ -303,3 +312,53 @@ pub fn contract_last_fee_claim_key(pot: ContractFeePot) -> &'static [u8; 1] { ContractFeePot::Moderators => &[CONTRACT_LAST_MODERATORS_FEE_CLAIM_KEY], } } + +/// `[64, contract id, 2, 16]`: the tree of the contract's document removal records, one subtree +/// per document type moderators may delete documents of. +pub fn contract_document_removals_path(contract_id: &[u8]) -> [&[u8]; 4] { + [ + Into::<&[u8; 1]>::into(RootTree::DataContractDocuments), + contract_id, + &[CONTRACT_OTHER_KEY], + &[CONTRACT_DOCUMENT_REMOVALS_KEY], + ] +} + +/// `[64, contract id, 2, 16]`: the tree of the contract's document removal records. +pub fn contract_document_removals_path_vec(contract_id: &[u8]) -> Vec> { + vec![ + Into::<&[u8; 1]>::into(RootTree::DataContractDocuments).to_vec(), + contract_id.to_vec(), + vec![CONTRACT_OTHER_KEY], + vec![CONTRACT_DOCUMENT_REMOVALS_KEY], + ] +} + +/// `[64, contract id, 2, 16, document type name]`: the removal records of one document type, +/// keyed by document id. +pub fn contract_document_type_removals_path<'a>( + contract_id: &'a [u8], + document_type_name: &'a str, +) -> [&'a [u8]; 5] { + [ + Into::<&[u8; 1]>::into(RootTree::DataContractDocuments), + contract_id, + &[CONTRACT_OTHER_KEY], + &[CONTRACT_DOCUMENT_REMOVALS_KEY], + document_type_name.as_bytes(), + ] +} + +/// `[64, contract id, 2, 16, document type name]`: the removal records of one document type. +pub fn contract_document_type_removals_path_vec( + contract_id: &[u8], + document_type_name: &str, +) -> Vec> { + vec![ + Into::<&[u8; 1]>::into(RootTree::DataContractDocuments).to_vec(), + contract_id.to_vec(), + vec![CONTRACT_OTHER_KEY], + vec![CONTRACT_DOCUMENT_REMOVALS_KEY], + document_type_name.as_bytes().to_vec(), + ] +} diff --git a/packages/rs-drive/src/drive/contract/structure.rs b/packages/rs-drive/src/drive/contract/structure.rs index 286b197503f..e1ea8bf3831 100644 --- a/packages/rs-drive/src/drive/contract/structure.rs +++ b/packages/rs-drive/src/drive/contract/structure.rs @@ -1,5 +1,5 @@ use crate::drive::contract::paths::{ - CONTRACT_BANLIST_KEY, CONTRACT_LAST_MODERATORS_FEE_CLAIM_KEY, + CONTRACT_BANLIST_KEY, CONTRACT_DOCUMENT_REMOVALS_KEY, CONTRACT_LAST_MODERATORS_FEE_CLAIM_KEY, CONTRACT_LAST_OWNER_FEE_CLAIM_KEY, CONTRACT_OTHER_KEY, CONTRACT_SUSPENSIONS_KEY, CONTRACT_VERSION_KEY, }; @@ -11,6 +11,9 @@ const SOURCE: &str = "packages/rs-drive/src/drive/contract/paths.rs"; const CONTRACT_FLAGS: &str = "The owner is the contract owner, and the epoch the one the contract was \ created in. System contracts created at genesis carry no flags."; +const REMOVAL_FLAGS: &str = + "The owner is the moderator who deleted the document. They pay for the record, \ + which nothing deletes or replaces."; const MODERATOR_FLAGS: &str = "The owner is the moderator who added the entry. They pay for it, and are \ refunded when it is removed. A suspension replaced with a longer reason \ @@ -91,6 +94,59 @@ pub(crate) fn structure() -> StructureNode { with the most read one, the banlist, in the middle.", ) .children(vec![ + StructureNode::fixed( + "document_removals", + &[CONTRACT_DOCUMENT_REMOVALS_KEY], + "DocumentRemovals", + "CONTRACT_DOCUMENT_REMOVALS_KEY", + ) + .kind(ElementKind::Tree) + .lazy() + .flags(&[FlagsKind::EpochOwned, FlagsKind::None], CONTRACT_FLAGS) + .describe( + "The records of the documents the contract's moderators \ + deleted. Created with the first document type that \ + sets canBeDeletedByModerators, by the contract's \ + creation or by an update. Read by clients, never by a \ + document transition, so it sorts below the rest.", + ) + .child( + StructureNode::dynamic( + "document_type", + "document_type_name", + KeyMatcher::Any, + KeyEncoding::Utf8, + "The document type name", + ) + .kind(ElementKind::Tree) + .flags(&[FlagsKind::EpochOwned, FlagsKind::None], CONTRACT_FLAGS) + .describe( + "The removed documents of one document type that sets \ + canBeDeletedByModerators. Created with the document \ + type, by the contract's creation or by the update \ + that adds the type.", + ) + .child( + StructureNode::identifier( + "document", + "document_id", + "The id the removed document had", + ) + .kind(ElementKind::Item) + .flags(&[FlagsKind::EpochOwned], REMOVAL_FLAGS) + .value( + "the document owner's id, the moderator's id, the block \ + time in milliseconds of the removal as a u64 big \ + endian, then the moderator's reason as in a banlist \ + entry", + ) + .describe( + "One removal: whose document it was, who removed it, \ + when and why. Never deleted and never replaced: a \ + document id is produced at most once.", + ), + ), + ), StructureNode::fixed( "version", &[CONTRACT_VERSION_KEY], diff --git a/packages/rs-drive/src/drive/contract/update/update_contract/v2/mod.rs b/packages/rs-drive/src/drive/contract/update/update_contract/v2/mod.rs index 736ab0eb0fc..6cd928e574e 100644 --- a/packages/rs-drive/src/drive/contract/update/update_contract/v2/mod.rs +++ b/packages/rs-drive/src/drive/contract/update/update_contract/v2/mod.rs @@ -6,6 +6,7 @@ use crate::util::storage_flags::StorageFlags; use dpp::block::block_info::BlockInfo; use dpp::data_contract::accessors::v0::DataContractV0Getters; use dpp::data_contract::config::v0::DataContractConfigGettersV0; +use dpp::data_contract::document_type::accessors::DocumentTypeV2Getters; use dpp::data_contract::DataContract; use dpp::fee::fee_result::FeeResult; @@ -219,7 +220,9 @@ impl Drive { /// /// The moderation list trees need nothing here: which lists a contract keeps is fixed when /// it is created (`DataContractConfig::validate_update` v2), so `insert_contract` made - /// them and an update leaves them, and their entries, alone. + /// them and an update leaves them, and their entries, alone. A document type the update + /// adds may be one moderators can delete documents of, and then gets the tree its removal + /// records go in. #[allow(clippy::too_many_arguments)] fn update_contract_operations_v2( &self, @@ -326,6 +329,42 @@ impl Drive { } } + // The removal records tree of every document type the update adds that moderators may + // delete documents of, as `insert_contract` creates it for the types of a new + // contract. A document type the contract already had keeps the keyword it had, so its + // tree, if any, exists: a document type is new exactly once. The tree they all go + // under exists exactly when the stored contract already had such a document type, + // which the original contract says without a read: the first one creates it. + let added_document_type_names: Vec<&str> = contract + .document_types() + .iter() + .filter(|(name, document_type)| { + document_type.documents_can_be_deleted_by_moderators() + && !original_contract.document_types().contains_key(*name) + }) + .map(|(name, _)| name.as_str()) + .collect(); + if !added_document_type_names.is_empty() { + let has_removals_tree = original_contract + .document_types() + .values() + .any(|document_type| document_type.documents_can_be_deleted_by_moderators()); + let storage_flags = StorageFlags::new_single_epoch( + block_info.epoch.index, + Some(contract.owner_id().to_buffer()), + ); + self.insert_contract_document_removal_trees_operations( + contract.id().to_buffer(), + !has_removals_tree, + &added_document_type_names, + Some(&storage_flags), + estimated_costs_only_with_layer_info, + transaction, + &mut batch_operations, + platform_version, + )?; + } + Ok(batch_operations) } diff --git a/packages/rs-drive/src/prove/prove_state_transition/v0/mod.rs b/packages/rs-drive/src/prove/prove_state_transition/v0/mod.rs index 6d4aee1b60a..9613c4443a8 100644 --- a/packages/rs-drive/src/prove/prove_state_transition/v0/mod.rs +++ b/packages/rs-drive/src/prove/prove_state_transition/v0/mod.rs @@ -1,5 +1,9 @@ +use crate::drive::contract::moderation::types::{ + ContractDocumentRemovalsQuery, ContractDocumentRemovalsSelection, +}; use crate::drive::identity::key::fetch::IdentityKeysRequest; use crate::drive::{Drive, RootTree}; +use crate::error::drive::DriveError; use crate::error::proof::ProofError; use crate::error::Error; use crate::prove::prove_state_transition::ProofCreationResult; @@ -252,43 +256,68 @@ impl Drive { // The lists the moderation touched: a ban also removes a suspension, so it proves // every list the contract keeps (the banlist entry present, the suspension absent); // an unban, a suspend and an unsuspend prove the one entry they edit. + // A document deletion proves the record it left: a document id is produced at most + // once, so the record is of that document and the document is gone. StateTransition::ContractUserModeration(st) => { let contract_id = st.data_contract_id(); - let lists = match st.action() { - ContractUserModerationAction::Ban { .. } => { - let Some(contract_fetch_info) = self.get_contract_with_fetch_info( - contract_id.to_buffer(), - false, - None, - platform_version, - )? - else { - return Err(Error::Proof(ProofError::UnknownContract(format!( - "unknown contract with id {} in contract moderation proving", - contract_id - )))); - }; - contract_fetch_info - .contract - .config() - .moderation() - .map(|moderation| moderation.lists().collect::>()) - .unwrap_or_else(|| vec![ContractModerationList::Banlist]) - } - ContractUserModerationAction::Unban { .. } => { - vec![ContractModerationList::Banlist] - } - ContractUserModerationAction::Suspend { .. } - | ContractUserModerationAction::Unsuspend { .. } => { - vec![ContractModerationList::Suspensions] - } - }; - Drive::contract_moderation_status_query( - contract_id.to_buffer(), - st.target_identity_id().to_buffer(), - &lists, - &platform_version.drive.grove_version, - )? + if let Some((document_type_name, document_id)) = st.action().document() { + // The query the verifier rebuilds from the transition. + Drive::contract_document_removals_query( + contract_id.to_buffer(), + &ContractDocumentRemovalsQuery { + document_type_name: document_type_name.to_string(), + selection: ContractDocumentRemovalsSelection::DocumentIds(vec![ + document_id, + ]), + }, + ) + } else { + let target_identity_id = st.target_identity_id().ok_or(Error::Drive( + DriveError::CorruptedCodeExecution( + "a moderation that names no document names an identity", + ), + ))?; + let lists = match st.action() { + ContractUserModerationAction::Ban { .. } => { + let Some(contract_fetch_info) = self.get_contract_with_fetch_info( + contract_id.to_buffer(), + false, + None, + platform_version, + )? + else { + return Err(Error::Proof(ProofError::UnknownContract(format!( + "unknown contract with id {} in contract moderation proving", + contract_id + )))); + }; + contract_fetch_info + .contract + .config() + .moderation() + .map(|moderation| moderation.lists().collect::>()) + .unwrap_or_else(|| vec![ContractModerationList::Banlist]) + } + ContractUserModerationAction::Unban { .. } => { + vec![ContractModerationList::Banlist] + } + ContractUserModerationAction::Suspend { .. } + | ContractUserModerationAction::Unsuspend { .. } => { + vec![ContractModerationList::Suspensions] + } + ContractUserModerationAction::DeleteDocument { .. } => { + return Err(Error::Drive(DriveError::CorruptedCodeExecution( + "a document deletion is proved by the arm above", + ))) + } + }; + Drive::contract_moderation_status_query( + contract_id.to_buffer(), + target_identity_id.to_buffer(), + &lists, + &platform_version.drive.grove_version, + )? + } } // The pot the claim paid out with its last claim (epoch, time, claimant), and the balance // of every identity a payout of that pot goes to. diff --git a/packages/rs-drive/src/state_transition_action/action_convert_to_operations/contract/contract_user_moderation_transition.rs b/packages/rs-drive/src/state_transition_action/action_convert_to_operations/contract/contract_user_moderation_transition.rs index d3d3a553d9c..bdb71f64abc 100644 --- a/packages/rs-drive/src/state_transition_action/action_convert_to_operations/contract/contract_user_moderation_transition.rs +++ b/packages/rs-drive/src/state_transition_action/action_convert_to_operations/contract/contract_user_moderation_transition.rs @@ -1,11 +1,18 @@ use crate::error::drive::DriveError; use crate::error::Error; use crate::state_transition_action::action_convert_to_operations::DriveHighLevelOperationConverter; +use crate::state_transition_action::contract::contract_user_moderation::v0::ContractDocumentDeletionContext; use crate::state_transition_action::contract::contract_user_moderation::v0::ContractUserModerationTransitionActionV0; use crate::state_transition_action::contract::contract_user_moderation::ContractUserModerationTransitionAction; -use crate::util::batch::DriveOperation::{ContractModerationOperation, IdentityOperation}; -use crate::util::batch::{ContractModerationOperationType, DriveOperation, IdentityOperationType}; +use crate::util::batch::DriveOperation::{ + ContractModerationOperation, DocumentOperation, IdentityOperation, +}; +use crate::util::batch::{ + ContractModerationOperationType, DocumentOperationType, DriveOperation, IdentityOperationType, +}; +use crate::util::object_size_info::{DataContractInfo, DocumentTypeInfo}; use dpp::block::epoch::Epoch; +use dpp::data_contract::config::moderation::ContractDocumentRemoval; use dpp::state_transition::contract_user_moderation_transition::ContractUserModerationAction; use dpp::version::PlatformVersion; @@ -30,6 +37,7 @@ impl DriveHighLevelOperationConverter for ContractUserModerationTransitionAction identity_contract_nonce, action, target_is_suspended, + document_deletion, .. }, ) = self; @@ -97,6 +105,53 @@ impl DriveHighLevelOperationConverter for ContractUserModerationTransitionAction }, )); } + ContractUserModerationAction::DeleteDocument { + document_type_name, + document_id, + reason, + } => { + let ContractDocumentDeletionContext { + data_contract_fetch_info, + document_owner_id, + removed_at, + } = + document_deletion + .ok_or(Error::Drive(DriveError::CorruptedCodeExecution( + "a document deletion action must carry what its validation read", + )))?; + // The deletion of the document, which keeps every index and aggregate + // of its type right and does not ask `canBeDeleted` (that is the + // owner's rule, not the moderators'), then its record. The marker makes + // the batch refund nobody: the document's owner forfeits the storage + // fee. + operations.push(DocumentOperation( + DocumentOperationType::DeleteDocumentByModerator { + document_id, + contract_info: DataContractInfo::DataContractFetchInfo( + data_contract_fetch_info, + ), + document_type_info: DocumentTypeInfo::DocumentTypeName( + document_type_name.clone(), + ), + }, + )); + operations.push(ContractModerationOperation( + ContractModerationOperationType::AddDocumentRemoval { + contract_id, + document_type_name, + document_id, + removal: ContractDocumentRemoval { + document_owner_id, + moderator_id, + reason, + removed_at, + }, + }, + )); + operations.push(ContractModerationOperation( + ContractModerationOperationType::ForfeitStorageRefunds, + )); + } } Ok(operations) @@ -127,6 +182,7 @@ mod tests { identity_contract_nonce: 4, action, target_is_suspended, + document_deletion: None, user_fee_increase: 0, }) } diff --git a/packages/rs-drive/src/state_transition_action/contract/contract_user_moderation/mod.rs b/packages/rs-drive/src/state_transition_action/contract/contract_user_moderation/mod.rs index 71ef39b3adf..e0d3bce7102 100644 --- a/packages/rs-drive/src/state_transition_action/contract/contract_user_moderation/mod.rs +++ b/packages/rs-drive/src/state_transition_action/contract/contract_user_moderation/mod.rs @@ -3,7 +3,9 @@ pub mod transformer; /// v0 pub mod v0; -use crate::state_transition_action::contract::contract_user_moderation::v0::ContractUserModerationTransitionActionV0; +use crate::state_transition_action::contract::contract_user_moderation::v0::{ + ContractDocumentDeletionContext, ContractUserModerationTransitionActionV0, +}; use derive_more::From; use dpp::platform_value::Identifier; use dpp::prelude::{IdentityNonce, UserFeeIncrease}; @@ -11,7 +13,7 @@ use dpp::state_transition::contract_user_moderation_transition::ContractUserMode /// The action of a contract user moderation transition: one edit of a moderated contract's /// banlist or suspension list, with the target's status as it was read when the transition was -/// validated. +/// validated, or the deletion of one document, with what was read about it. #[derive(Debug, Clone, From)] pub enum ContractUserModerationTransitionAction { /// v0 @@ -54,6 +56,14 @@ impl ContractUserModerationTransitionAction { } } + /// What a document deletion read when the transition was validated, `None` for an action + /// on an identity + pub fn document_deletion(&self) -> Option<&ContractDocumentDeletionContext> { + match self { + ContractUserModerationTransitionAction::V0(action) => action.document_deletion.as_ref(), + } + } + /// fee multiplier pub fn user_fee_increase(&self) -> UserFeeIncrease { match self { diff --git a/packages/rs-drive/src/state_transition_action/contract/contract_user_moderation/transformer.rs b/packages/rs-drive/src/state_transition_action/contract/contract_user_moderation/transformer.rs index c368059c14f..dd92eeed69d 100644 --- a/packages/rs-drive/src/state_transition_action/contract/contract_user_moderation/transformer.rs +++ b/packages/rs-drive/src/state_transition_action/contract/contract_user_moderation/transformer.rs @@ -1,4 +1,6 @@ -use crate::state_transition_action::contract::contract_user_moderation::v0::ContractUserModerationTransitionActionV0; +use crate::state_transition_action::contract::contract_user_moderation::v0::{ + ContractDocumentDeletionContext, ContractUserModerationTransitionActionV0, +}; use crate::state_transition_action::contract::contract_user_moderation::ContractUserModerationTransitionAction; use dpp::data_contract::config::moderation::ContractModerationStatus; use dpp::state_transition::contract_user_moderation_transition::ContractUserModerationTransition; @@ -20,4 +22,21 @@ impl ContractUserModerationTransitionAction { } } } + + /// The action of a borrowed transition that deletes a document, carrying what the + /// validation read about the contract, the document and its removal record + pub fn from_borrowed_transition_with_document_deletion( + value: &ContractUserModerationTransition, + document_deletion: ContractDocumentDeletionContext, + ) -> Self { + match value { + ContractUserModerationTransition::V0(v0) => { + ContractUserModerationTransitionActionV0::from_borrowed_transition_with_document_deletion( + v0, + document_deletion, + ) + .into() + } + } + } } diff --git a/packages/rs-drive/src/state_transition_action/contract/contract_user_moderation/v0/mod.rs b/packages/rs-drive/src/state_transition_action/contract/contract_user_moderation/v0/mod.rs index 1e5c6c0f1a3..83b5f15cff0 100644 --- a/packages/rs-drive/src/state_transition_action/contract/contract_user_moderation/v0/mod.rs +++ b/packages/rs-drive/src/state_transition_action/contract/contract_user_moderation/v0/mod.rs @@ -1,8 +1,11 @@ mod transformer; +use crate::drive::contract::DataContractFetchInfo; use dpp::identifier::Identifier; +use dpp::identity::TimestampMillis; use dpp::prelude::{IdentityNonce, UserFeeIncrease}; use dpp::state_transition::contract_user_moderation_transition::ContractUserModerationAction; +use std::sync::Arc; /// action v0 #[derive(Debug, Clone)] @@ -19,6 +22,21 @@ pub struct ContractUserModerationTransitionActionV0 { /// Drive knows whether a suspend replaces an entry and whether a ban also removes a /// suspension, without reading again. The status itself, with its reasons, stays behind. pub target_is_suspended: bool, + /// what a document deletion read when the transition was validated, `None` for an action + /// on an identity + pub document_deletion: Option, /// fee multiplier pub user_fee_increase: UserFeeIncrease, } + +/// What the validation of a document deletion read, so that Drive deletes the document and +/// writes its removal record without reading again. +#[derive(Debug, Clone)] +pub struct ContractDocumentDeletionContext { + /// the moderated contract, as fetched: the deletion resolves the document type from it + pub data_contract_fetch_info: Arc, + /// the owner of the document as stored + pub document_owner_id: Identifier, + /// the time of the block the deletion runs in, recorded as the removal time + pub removed_at: TimestampMillis, +} diff --git a/packages/rs-drive/src/state_transition_action/contract/contract_user_moderation/v0/transformer.rs b/packages/rs-drive/src/state_transition_action/contract/contract_user_moderation/v0/transformer.rs index 0b17cee9ca9..7f0f1f4bc99 100644 --- a/packages/rs-drive/src/state_transition_action/contract/contract_user_moderation/v0/transformer.rs +++ b/packages/rs-drive/src/state_transition_action/contract/contract_user_moderation/v0/transformer.rs @@ -1,4 +1,6 @@ -use crate::state_transition_action::contract::contract_user_moderation::v0::ContractUserModerationTransitionActionV0; +use crate::state_transition_action::contract::contract_user_moderation::v0::{ + ContractDocumentDeletionContext, ContractUserModerationTransitionActionV0, +}; use dpp::data_contract::config::moderation::ContractModerationStatus; use dpp::state_transition::contract_user_moderation_transition::v0::ContractUserModerationTransitionV0; @@ -23,7 +25,20 @@ impl ContractUserModerationTransitionActionV0 { identity_contract_nonce: *identity_contract_nonce, action: action.clone(), target_is_suspended: current_status.suspension.is_some(), + document_deletion: None, user_fee_increase: *user_fee_increase, } } + + /// The action of a borrowed transition that deletes a document, carrying what the + /// validation read about the contract, the document and its removal record + pub fn from_borrowed_transition_with_document_deletion( + value: &ContractUserModerationTransitionV0, + document_deletion: ContractDocumentDeletionContext, + ) -> Self { + let mut action = + Self::from_borrowed_transition_with_status(value, &ContractModerationStatus::default()); + action.document_deletion = Some(document_deletion); + action + } } diff --git a/packages/rs-drive/src/structure/tests.rs b/packages/rs-drive/src/structure/tests.rs index 809ea48d2b6..32c0a4e2495 100644 --- a/packages/rs-drive/src/structure/tests.rs +++ b/packages/rs-drive/src/structure/tests.rs @@ -282,6 +282,7 @@ mod fixtures { AddressFundsOperationType, ContractFeePotOperationType, }; use crate::util::batch::grovedb_op_batch::GroveDbOpBatchV0Methods; + use crate::util::batch::ContractModerationOperationType; use crate::util::batch::DriveOperation; use crate::util::batch::GroveDbOpBatch; use crate::util::object_size_info::DocumentInfo::DocumentRefInfo; @@ -320,7 +321,8 @@ mod fixtures { use dpp::data_contract::associated_token::token_pre_programmed_distribution::v0::TokenPreProgrammedDistributionV0; use dpp::data_contract::associated_token::token_pre_programmed_distribution::TokenPreProgrammedDistribution; use dpp::data_contract::config::moderation::{ - ContractModerationConfig, ContractModerationReason, ContractModerators, + ContractDocumentRemoval, ContractModerationConfig, ContractModerationReason, + ContractModerators, }; use dpp::data_contract::config::v0::{DataContractConfigSettersV0, DataContractConfigV0}; use dpp::data_contract::config::DataContractConfig; @@ -328,6 +330,7 @@ mod fixtures { use dpp::data_contract::document_type::random_document::CreateRandomDocument; use dpp::data_contract::group::v0::GroupV0; use dpp::data_contract::group::Group; + use dpp::data_contract::schema::DataContractSchemaMethodsV0; use dpp::data_contract::storage_requirements::keys_for_document_type::StorageKeyRequirements; use dpp::data_contract::v1::DataContractV1; use dpp::data_contract::DataContract; @@ -342,6 +345,7 @@ mod fixtures { use dpp::identity::identity_public_key::v1::IdentityPublicKeyV1; use dpp::identity::Identity; use dpp::identity::{IdentityPublicKey, KeyID, KeyType, Purpose, SecurityLevel}; + use dpp::platform_value::platform_value; use dpp::platform_value::BinaryData; use dpp::platform_value::Value; use dpp::tests::fixtures::get_dashpay_contract_fixture; @@ -658,6 +662,71 @@ mod fixtures { conformance_of(&drive, "contracts_with_documents", run); } + /// A contract whose moderators only delete documents: no list, one document type they can + /// delete from, one removal record. Kept apart from the contract with both lists, whose + /// other tree is the fullest one and the one whose shape is recorded. + fn contract_with_document_removals(run: &mut FixtureRun) { + let platform_version = PlatformVersion::latest(); + let drive = setup_drive_with_initial_state_structure(Some(platform_version)); + let contract = setup_contract( + &drive, + "tests/supporting_files/contract/family/family-contract.json", + Some([9; 32]), + None, + Some(|contract: &mut DataContract| { + contract.set_config(contract.config().clone().with_moderation(Some( + ContractModerationConfig { + banlist: false, + suspensions: false, + moderators: ContractModerators::ContractOwner, + }, + ))); + // After the config: the keyword is refused on a contract without moderation. + contract + .set_document_schema( + "post", + platform_value!({ + "type": "object", + "properties": { + "text": { "type": "string", "maxLength": 50, "position": 0 }, + }, + "additionalProperties": false, + "canBeDeletedByModerators": true, + }), + true, + &mut vec![], + PlatformVersion::latest(), + ) + .expect("expected to add a document type moderators can delete from"); + }), + None, + Some(platform_version), + ); + drive + .apply_drive_operations( + vec![DriveOperation::ContractModerationOperation( + ContractModerationOperationType::AddDocumentRemoval { + contract_id: contract.id(), + document_type_name: "post".to_string(), + document_id: Identifier::from([0x23; 32]), + removal: ContractDocumentRemoval { + document_owner_id: Identifier::from([0x24; 32]), + moderator_id: contract.owner_id(), + reason: ContractModerationReason::from_text("spam"), + removed_at: 1_000, + }, + }, + )], + true, + &BlockInfo::default(), + None, + platform_version, + None, + ) + .expect("expected to record a document removal"); + conformance_of(&drive, "contract_with_document_removals", run); + } + /// A contract that keeps both moderation lists, with one ban and one suspension fn moderated_contract(run: &mut FixtureRun) { let platform_version = PlatformVersion::latest(); @@ -1381,6 +1450,7 @@ mod fixtures { identities(&mut run); contracts_with_documents(&mut run); moderated_contract(&mut run); + contract_with_document_removals(&mut run); tokens_and_group_actions(&mut run); address_balances(&mut run); current_then_paid_epoch(&mut run); diff --git a/packages/rs-drive/src/util/batch/drive_op_batch/contract_moderation.rs b/packages/rs-drive/src/util/batch/drive_op_batch/contract_moderation.rs index 2bf86234483..7a91305f498 100644 --- a/packages/rs-drive/src/util/batch/drive_op_batch/contract_moderation.rs +++ b/packages/rs-drive/src/util/batch/drive_op_batch/contract_moderation.rs @@ -3,7 +3,7 @@ use crate::error::Error; use crate::fees::op::LowLevelDriveOperation; use crate::util::batch::drive_op_batch::DriveLowLevelOperationConverter; use dpp::block::block_info::BlockInfo; -use dpp::data_contract::config::moderation::ContractModerationReason; +use dpp::data_contract::config::moderation::{ContractDocumentRemoval, ContractModerationReason}; use dpp::identifier::Identifier; use dpp::identity::TimestampMillis; use grovedb::batch::KeyInfoPath; @@ -11,7 +11,7 @@ use grovedb::{EstimatedLayerInformation, TransactionArg}; use platform_version::version::PlatformVersion; use std::collections::HashMap; -/// Operations on a moderated contract's banlist and suspension list. +/// Operations on a moderated contract's banlist, suspension list and document removal records. #[derive(Clone, Debug)] pub enum ContractModerationOperationType { /// Puts an identity on the banlist. @@ -55,6 +55,23 @@ pub enum ContractModerationOperationType { /// The identity to unsuspend. identity_id: Identifier, }, + /// Records that a moderator deleted a document. The deletion itself is a document + /// operation of the same batch. A document id is produced at most once, so a record is + /// written once and never replaced. + AddDocumentRemoval { + /// The moderated contract. + contract_id: Identifier, + /// The document type the document belonged to. + document_type_name: String, + /// The id the document had. + document_id: Identifier, + /// Whose it was, who removed it (and pays for the record), why and when. + removal: ContractDocumentRemoval, + }, + /// Writes nothing: marks the batch it is in as one whose storage removals refund nobody + /// (`Drive::apply_drive_operations` generation 1). A moderator's document deletion carries + /// it, so the deleted document's owner gets no storage refund. + ForfeitStorageRefunds, } impl DriveLowLevelOperationConverter for ContractModerationOperationType { @@ -125,6 +142,22 @@ impl DriveLowLevelOperationConverter for ContractModerationOperationType { transaction, platform_version, ), + ContractModerationOperationType::AddDocumentRemoval { + contract_id, + document_type_name, + document_id, + removal, + } => drive.add_contract_document_removal_operations( + contract_id, + &document_type_name, + document_id, + &removal, + block_info, + estimated_costs_only_with_layer_info, + transaction, + platform_version, + ), + ContractModerationOperationType::ForfeitStorageRefunds => Ok(vec![]), } } } diff --git a/packages/rs-drive/src/util/batch/drive_op_batch/document.rs b/packages/rs-drive/src/util/batch/drive_op_batch/document.rs index 07d8e37fa0f..46164a98f3c 100644 --- a/packages/rs-drive/src/util/batch/drive_op_batch/document.rs +++ b/packages/rs-drive/src/util/batch/drive_op_batch/document.rs @@ -103,6 +103,18 @@ pub enum DocumentOperationType<'a> { /// Document type document_type_info: DocumentTypeInfo<'a>, }, + /// Deletes a document on behalf of the contract's moderators. `canBeDeleted` rules what a + /// document's own owner may do, so it is not consulted here: the caller has checked that + /// the document type sets `canBeDeletedByModerators`. A document type that keeps history + /// is still refused, as the keyword is on such a type. + DeleteDocumentByModerator { + /// The document id + document_id: Identifier, + /// Data Contract info to potentially be resolved if needed + contract_info: DataContractInfo<'a>, + /// Document type + document_type_info: DocumentTypeInfo<'a>, + }, /// Deletes an indexOnly document from its property values — there is /// no primary-storage row to fetch, so the values (plus the owner) /// are what every index entry is recomputed from. `$createdAt` may @@ -209,6 +221,11 @@ impl DocumentOperationType<'_> { document_type_info, .. } + | Self::DeleteDocumentByModerator { + contract_info, + document_type_info, + .. + } | Self::DeleteIndexOnlyDocument { contract_info, document_type_info, @@ -446,6 +463,34 @@ impl DocumentOperationType<'_> { platform_version, ) } + DocumentOperationType::DeleteDocumentByModerator { + document_id, + contract_info, + document_type_info, + } => { + let mut drive_operations: Vec = vec![]; + let contract_resolved_info = contract_info.resolve( + drive, + block_info, + transaction, + &mut drive_operations, + platform_version, + )?; + let contract = contract_resolved_info.as_ref(); + let document_type = document_type_info.resolve(contract)?; + + // The deletion a document's own owner runs, without its `canBeDeleted` guard. + drive.force_delete_document_for_contract_operations( + document_id, + contract, + document_type, + None, + estimated_costs_only_with_layer_info, + block_info.time_ms, + transaction, + platform_version, + ) + } DocumentOperationType::DeleteIndexOnlyDocument { document_id, owner_id, diff --git a/packages/rs-drive/src/util/batch/drive_op_batch/drive_methods/apply_drive_operations/mod.rs b/packages/rs-drive/src/util/batch/drive_op_batch/drive_methods/apply_drive_operations/mod.rs index ad7452524df..27b98d4a88c 100644 --- a/packages/rs-drive/src/util/batch/drive_op_batch/drive_methods/apply_drive_operations/mod.rs +++ b/packages/rs-drive/src/util/batch/drive_op_batch/drive_methods/apply_drive_operations/mod.rs @@ -1,4 +1,5 @@ mod v0; +mod v1; use crate::util::batch::DriveOperation; @@ -55,9 +56,17 @@ impl Drive { platform_version, previous_fee_versions, ), + 1 => self.apply_drive_operations_v1( + operations, + apply, + block_info, + transaction, + platform_version, + previous_fee_versions, + ), version => Err(Error::Drive(DriveError::UnknownVersionMismatch { method: "apply_drive_operations".to_string(), - known_versions: vec![0], + known_versions: vec![0, 1], received: version, })), } diff --git a/packages/rs-drive/src/util/batch/drive_op_batch/drive_methods/apply_drive_operations/v1/mod.rs b/packages/rs-drive/src/util/batch/drive_op_batch/drive_methods/apply_drive_operations/v1/mod.rs new file mode 100644 index 00000000000..72993a46739 --- /dev/null +++ b/packages/rs-drive/src/util/batch/drive_op_batch/drive_methods/apply_drive_operations/v1/mod.rs @@ -0,0 +1,214 @@ +use crate::util::batch::DriveOperation; + +use crate::drive::Drive; +use crate::error::Error; +use crate::fees::op::LowLevelDriveOperation; + +use dpp::block::block_info::BlockInfo; +use dpp::fee::fee_result::FeeResult; + +use grovedb::{EstimatedLayerInformation, TransactionArg}; + +use dpp::version::PlatformVersion; +use grovedb::batch::KeyInfoPath; +use grovedb_costs::storage_cost::removal::StorageRemovedBytes; + +use crate::util::batch::drive_op_batch::finalize_task::{ + DriveOperationFinalizationTasks, DriveOperationFinalizeTask, +}; +use dpp::fee::default_costs::CachedEpochIndexFeeVersions; +use std::collections::HashMap; + +impl Drive { + /// Applies a list of high level DriveOperations to the drive, and calculates the fee for them. + /// + /// # Arguments + /// + /// * `operations` - A vector of `DriveOperation`s to apply to the drive. + /// * `apply` - A boolean flag indicating whether to apply the changes or only estimate costs. + /// * `block_info` - A reference to information about the current block. + /// * `transaction` - Transaction arguments. + /// + /// # Returns + /// + /// Returns a `Result` containing the `FeeResult` if the operations are successfully applied, + /// otherwise an `Error`. + /// + /// If `apply` is set to true, it applies the low-level drive operations and updates side info accordingly. + /// If not, it only estimates the costs and updates estimated costs with layer info. + /// + /// Generation 1 (protocol version 14) is generation 0, and a batch that carries a storage + /// refund forfeiture ([`DriveOperation::forfeits_storage_refunds`], a moderator's document + /// deletion) refunds nobody: the bytes it removes still leave the system, but whoever paid + /// for them gets nothing back, and the credits stay in the storage pools they were + /// distributed to. An estimate carries no refund to begin with, so `check_tx` sees the + /// same fee with or without the forfeiture. + #[inline(always)] + pub(crate) fn apply_drive_operations_v1( + &self, + operations: Vec, + apply: bool, + block_info: &BlockInfo, + transaction: TransactionArg, + platform_version: &PlatformVersion, + previous_fee_versions: Option<&CachedEpochIndexFeeVersions>, + ) -> Result { + if operations.is_empty() { + return Ok(FeeResult::default()); + } + let forfeits_storage_refunds = operations + .iter() + .any(DriveOperation::forfeits_storage_refunds); + // With no caller transaction, TTL preparation (direct drainage + // writes), conversion reads, and the batch apply would each commit + // on their own, so a conversion error after preparation would leave + // drained buckets committed without the write. Span all of it with + // one owned transaction and commit only once the batch applied. + let caller_transaction = transaction; + let owned_transaction = + (apply && transaction.is_none()).then(|| self.grove.start_transaction()); + let transaction = owned_transaction.as_ref().or(caller_transaction); + if apply { + self.prepare_drive_operations_time_range_ttl( + &operations, + block_info, + transaction, + platform_version, + )?; + } + let mut low_level_operations = vec![]; + let mut estimated_costs_only_with_layer_info = if apply { + None::> + } else { + Some(HashMap::new()) + }; + + let mut finalize_tasks: Vec = Vec::new(); + + for drive_op in operations { + if let Some(tasks) = drive_op.finalization_tasks(platform_version)? { + finalize_tasks.extend(tasks); + } + + low_level_operations.append( + &mut drive_op.into_low_level_drive_operations_after_ttl_drain( + self, + &mut estimated_costs_only_with_layer_info, + block_info, + transaction, + platform_version, + )?, + ); + } + + let mut cost_operations = vec![]; + + self.apply_batch_low_level_drive_operations( + estimated_costs_only_with_layer_info, + transaction, + low_level_operations, + &mut cost_operations, + &platform_version.drive, + )?; + if let Some(owned_transaction) = owned_transaction { + self.commit_transaction(owned_transaction, &platform_version.drive)?; + } + + if forfeits_storage_refunds { + forfeit_storage_refunds(&mut cost_operations); + } + + // Execute drive operation callbacks after updating state. Nothing was written when + // only estimating, so there is nothing to finalize. The tasks read through the + // caller's transaction; an owned one was committed just above, and `caller_transaction` + // is `None` exactly then, so they read committed state. + if apply { + for task in finalize_tasks { + task.execute(self, caller_transaction, platform_version)?; + } + } + + Drive::calculate_fee( + None, + Some(cost_operations), + &block_info.epoch, + self.config.epochs_per_era, + platform_version, + previous_fee_versions, + ) + } +} + +/// Turns every removal attributed to an identity into a removal attributed to nobody: the same +/// bytes leave the system (`FeeResult::removed_bytes_from_system`), and no refund is computed +/// for them. The whole batch, which is exact: a moderator's deletion removes the document and +/// nothing else, since its removal record is written once (a document id is produced at most +/// once) and the nonce it bumps keeps its size. +fn forfeit_storage_refunds(cost_operations: &mut [LowLevelDriveOperation]) { + for operation in cost_operations.iter_mut() { + let LowLevelDriveOperation::CalculatedCostOperation(cost) = operation else { + continue; + }; + if let StorageRemovedBytes::SectionedStorageRemoval(_) = &cost.storage_cost.removed_bytes { + let removed_bytes = cost.storage_cost.removed_bytes.total_removed_bytes(); + cost.storage_cost.removed_bytes = + StorageRemovedBytes::BasicStorageRemoval(removed_bytes); + } + } +} + +#[cfg(test)] +mod tests { + use super::*; + use grovedb_costs::storage_cost::removal::StorageRemovalPerEpochByIdentifier; + use grovedb_costs::storage_cost::StorageCost; + use grovedb_costs::OperationCost; + use intmap::IntMap; + + #[test] + fn should_attribute_a_forfeited_removal_to_nobody() { + let mut per_epoch = IntMap::new(); + per_epoch.insert(0u16, 40u32); + per_epoch.insert(3u16, 2u32); + let mut removal = StorageRemovalPerEpochByIdentifier::default(); + removal.insert([7; 32], per_epoch); + + let mut cost_operations = vec![ + LowLevelDriveOperation::CalculatedCostOperation(OperationCost { + storage_cost: StorageCost { + added_bytes: 5, + replaced_bytes: 0, + removed_bytes: StorageRemovedBytes::SectionedStorageRemoval(removal), + }, + ..Default::default() + }), + LowLevelDriveOperation::CalculatedCostOperation(OperationCost { + storage_cost: StorageCost { + added_bytes: 0, + replaced_bytes: 0, + removed_bytes: StorageRemovedBytes::BasicStorageRemoval(9), + }, + ..Default::default() + }), + ]; + + forfeit_storage_refunds(&mut cost_operations); + + let removed: Vec<&StorageRemovedBytes> = cost_operations + .iter() + .map(|operation| match operation { + LowLevelDriveOperation::CalculatedCostOperation(cost) => { + &cost.storage_cost.removed_bytes + } + _ => unreachable!("only calculated costs were given"), + }) + .collect(); + assert_eq!( + removed, + vec![ + &StorageRemovedBytes::BasicStorageRemoval(42), + &StorageRemovedBytes::BasicStorageRemoval(9), + ] + ); + } +} diff --git a/packages/rs-drive/src/util/batch/drive_op_batch/mod.rs b/packages/rs-drive/src/util/batch/drive_op_batch/mod.rs index 2e3392dee59..cb812f09aa9 100644 --- a/packages/rs-drive/src/util/batch/drive_op_batch/mod.rs +++ b/packages/rs-drive/src/util/batch/drive_op_batch/mod.rs @@ -251,6 +251,17 @@ impl DriveLowLevelOperationConverter for DriveOperation<'_> { } impl DriveOperation<'_> { + /// Whether the batch this operation is in refunds nobody for the storage it removes: see + /// [`ContractModerationOperationType::ForfeitStorageRefunds`]. + pub fn forfeits_storage_refunds(&self) -> bool { + matches!( + self, + Self::ContractModerationOperation( + ContractModerationOperationType::ForfeitStorageRefunds + ) + ) + } + /// Convert a member of a batch whose document TTL cleanup is complete. pub(crate) fn into_low_level_drive_operations_after_ttl_drain( self, diff --git a/packages/rs-drive/src/verify/contract_moderation/mod.rs b/packages/rs-drive/src/verify/contract_moderation/mod.rs index 0dcc01b15e2..9bdc8e4f041 100644 --- a/packages/rs-drive/src/verify/contract_moderation/mod.rs +++ b/packages/rs-drive/src/verify/contract_moderation/mod.rs @@ -1,3 +1,4 @@ +mod verify_contract_document_removals; mod verify_contract_fee_pots; mod verify_contract_moderation_entries; mod verify_contract_moderation_status; diff --git a/packages/rs-drive/src/verify/contract_moderation/verify_contract_document_removals/mod.rs b/packages/rs-drive/src/verify/contract_moderation/verify_contract_document_removals/mod.rs new file mode 100644 index 00000000000..91639e6e963 --- /dev/null +++ b/packages/rs-drive/src/verify/contract_moderation/verify_contract_document_removals/mod.rs @@ -0,0 +1,47 @@ +mod v0; + +use crate::drive::contract::moderation::types::{ + ContractDocumentRemovalEntry, ContractDocumentRemovalsQuery, +}; +use crate::drive::Drive; +use crate::error::drive::DriveError; +use crate::error::Error; +use crate::verify::RootHash; +use dpp::identifier::Identifier; +use dpp::version::PlatformVersion; + +impl Drive { + /// Verifies a proof of the records of the documents a contract's moderators deleted, + /// within one document type, and returns the records the proof holds, in document id + /// order. + /// + /// The verifier rebuilds the path query from `query`, so a read by ids proves each id + /// named either present with its record or absent (an id the result does not hold has no + /// record), and a page proves the records after its cursor up to its limit. + pub fn verify_contract_document_removals( + proof: &[u8], + contract_id: Identifier, + query: &ContractDocumentRemovalsQuery, + platform_version: &PlatformVersion, + ) -> Result<(RootHash, Vec), Error> { + match platform_version + .drive + .methods + .verify + .contract_moderation + .verify_contract_document_removals + { + 0 => Self::verify_contract_document_removals_v0( + proof, + contract_id, + query, + platform_version, + ), + version => Err(Error::Drive(DriveError::UnknownVersionMismatch { + method: "verify_contract_document_removals".to_string(), + known_versions: vec![0], + received: version, + })), + } + } +} diff --git a/packages/rs-drive/src/verify/contract_moderation/verify_contract_document_removals/v0/mod.rs b/packages/rs-drive/src/verify/contract_moderation/verify_contract_document_removals/v0/mod.rs new file mode 100644 index 00000000000..b65fc36d9ea --- /dev/null +++ b/packages/rs-drive/src/verify/contract_moderation/verify_contract_document_removals/v0/mod.rs @@ -0,0 +1,40 @@ +use crate::drive::contract::moderation::types::{ + ContractDocumentRemovalEntry, ContractDocumentRemovalsQuery, +}; +use crate::drive::Drive; +use crate::error::proof::ProofError; +use crate::error::Error; +use crate::verify::RootHash; +use dpp::identifier::Identifier; +use dpp::version::PlatformVersion; +use grovedb::GroveDb; + +impl Drive { + pub(super) fn verify_contract_document_removals_v0( + proof: &[u8], + contract_id: Identifier, + query: &ContractDocumentRemovalsQuery, + platform_version: &PlatformVersion, + ) -> Result<(RootHash, Vec), Error> { + let path_query = Self::contract_document_removals_query(contract_id.to_buffer(), query); + let (root_hash, proved_key_values) = + GroveDb::verify_query(proof, &path_query, &platform_version.drive.grove_version)?; + + let entries = proved_key_values + .into_iter() + .filter_map(|(_path, key, element)| element.map(|element| (key, element))) + .map(|(key, element)| { + ContractDocumentRemovalEntry::from_key_element(&key, &element).map_err( + |description| { + Error::Proof(ProofError::CorruptedProof(format!( + "contract document removals proof is malformed: {}", + description + ))) + }, + ) + }) + .collect::, Error>>()?; + + Ok((root_hash, entries)) + } +} diff --git a/packages/rs-drive/src/verify/state_transition/verify_state_transition_was_executed_with_proof/v0/mod.rs b/packages/rs-drive/src/verify/state_transition/verify_state_transition_was_executed_with_proof/v0/mod.rs index c38555b03de..f67243a89ba 100644 --- a/packages/rs-drive/src/verify/state_transition/verify_state_transition_was_executed_with_proof/v0/mod.rs +++ b/packages/rs-drive/src/verify/state_transition/verify_state_transition_was_executed_with_proof/v0/mod.rs @@ -32,11 +32,16 @@ use dpp::identity::identity_public_key::accessors::v1::IdentityPublicKeyGettersV use dpp::data_contract::config::v2::DataContractConfigGettersV2; use dpp::data_contract::config::moderation::ContractModerationList; use dpp::state_transition::contract_fee_claim_transition::accessors::ContractFeeClaimTransitionAccessorsV0; +use crate::drive::contract::moderation::types::{ + ContractDocumentRemovalsQuery, ContractDocumentRemovalsSelection, +}; use dpp::state_transition::contract_user_moderation_transition::accessors::ContractUserModerationTransitionAccessorsV0; use dpp::state_transition::contract_user_moderation_transition::ContractUserModerationAction; use dpp::state_transition::identity_key_limits_update_transition::accessors::IdentityKeyLimitsUpdateTransitionAccessorsV0; use dpp::state_transition::identity_update_transition::accessors::IdentityUpdateTransitionAccessorsV0; use dpp::state_transition::{StateTransition, StateTransitionOwned, StateTransitionWitnessSigned}; +use dpp::state_transition::contract_user_moderation_transition::ContractUserModerationTransition; +use dpp::state_transition::proof_result::StateTransitionProofResult; use dpp::state_transition::batch_transition::document_base_transition::document_base_transition_trait::DocumentBaseTransitionAccessors; use dpp::state_transition::batch_transition::document_create_transition::DocumentFromCreateTransition; use dpp::state_transition::batch_transition::document_replace_transition::DocumentFromReplaceTransition; @@ -55,7 +60,7 @@ use dpp::state_transition::identity_credit_withdrawal_transition::accessors::Ide use dpp::state_transition::identity_topup_transition::accessors::IdentityTopUpTransitionAccessorsV0; use dpp::state_transition::masternode_vote_transition::accessors::MasternodeVoteTransitionAccessorsV0; use dpp::state_transition::proof_result::StateTransitionProofOutcome; -use dpp::state_transition::proof_result::StateTransitionProofResult::{VerifiedAddressInfos, VerifiedContractFeeClaim, VerifiedContractModerationListStatuses, VerifiedBalanceTransfer, VerifiedDataContract, VerifiedDocuments, VerifiedIdentity, VerifiedIdentityFullWithAddressInfos, VerifiedIdentityWithAddressInfos, VerifiedMasternodeVote, VerifiedPartialIdentity, VerifiedTokenActionWithDocument, VerifiedTokenBalance, VerifiedTokenGroupActionWithDocument, VerifiedTokenGroupActionWithTokenBalance, VerifiedTokenGroupActionWithTokenIdentityInfo, VerifiedTokenGroupActionWithTokenPricingSchedule, VerifiedTokenIdentitiesBalances, VerifiedTokenIdentityInfo, VerifiedTokenPricingSchedule}; +use dpp::state_transition::proof_result::StateTransitionProofResult::{VerifiedAddressInfos, VerifiedContractDocumentRemoval, VerifiedContractFeeClaim, VerifiedContractModerationListStatuses, VerifiedBalanceTransfer, VerifiedDataContract, VerifiedDocuments, VerifiedIdentity, VerifiedIdentityFullWithAddressInfos, VerifiedIdentityWithAddressInfos, VerifiedMasternodeVote, VerifiedPartialIdentity, VerifiedTokenActionWithDocument, VerifiedTokenBalance, VerifiedTokenGroupActionWithDocument, VerifiedTokenGroupActionWithTokenBalance, VerifiedTokenGroupActionWithTokenIdentityInfo, VerifiedTokenGroupActionWithTokenPricingSchedule, VerifiedTokenIdentitiesBalances, VerifiedTokenIdentityInfo, VerifiedTokenPricingSchedule}; use dpp::system_data_contracts::{load_system_data_contract, SystemDataContract}; use dpp::tokens::info::v0::IdentityTokenInfoV0Accessors; use dpp::voting::vote_polls::VotePoll; @@ -1149,12 +1154,21 @@ impl Drive { } Ok((root_hash, VerifiedPartialIdentity(identity))) } + StateTransition::ContractUserModeration(transition) + if transition.action().document().is_some() => + { + verify_contract_document_deletion_execution(proof, transition, platform_version) + } StateTransition::ContractUserModeration(transition) => { // The proof holds the entries of the lists the moderation touched, present or // absent, and nothing more. A ban touched both lists the contract keeps (it // removes a suspension too), so the contract's config says which to expect. let contract_id = transition.data_contract_id(); - let identity_id = transition.target_identity_id(); + let identity_id = transition.target_identity_id().ok_or(Error::Proof( + ProofError::CorruptedProof( + "a moderation that names no document names an identity".to_string(), + ), + ))?; let lists = match transition.action() { ContractUserModerationAction::Ban { .. } => { let contract = known_contracts_provider_fn(&contract_id)?.ok_or( @@ -1176,6 +1190,11 @@ impl Drive { | ContractUserModerationAction::Unsuspend { .. } => { vec![ContractModerationList::Suspensions] } + ContractUserModerationAction::DeleteDocument { .. } => { + return Err(Error::Proof(ProofError::CorruptedProof( + "a document deletion is verified above".to_string(), + ))) + } }; // Only `lists` are proved: the verifier says nothing about the rest. let (root_hash, statuses) = Drive::verify_contract_moderation_status( @@ -1205,6 +1224,7 @@ impl Drive { ContractUserModerationAction::Unsuspend { .. } => { statuses.suspended_until() == Some(None) } + ContractUserModerationAction::DeleteDocument { .. } => false, }; if !as_expected { return Err(Error::Proof(ProofError::IncorrectProof(format!( @@ -2692,7 +2712,60 @@ impl Drive { } } -#[cfg(feature = "server")] +/// A moderator's document deletion is proved by the record it left: the one of the document +/// named, saying that the transition's signer removed it for the transition's reason. When is +/// the block's to say, and whose the document was only the record knows. A document id is +/// produced at most once, so the record is of that document and of no other. +fn verify_contract_document_deletion_execution( + proof: &[u8], + transition: &ContractUserModerationTransition, + platform_version: &PlatformVersion, +) -> Result<(RootHash, StateTransitionProofResult), Error> { + let contract_id = transition.data_contract_id(); + let ContractUserModerationAction::DeleteDocument { + document_type_name, + document_id, + reason, + } = transition.action() + else { + return Err(Error::Proof(ProofError::CorruptedProof( + "only a document deletion is verified by its removal record".to_string(), + ))); + }; + let (root_hash, mut entries) = Drive::verify_contract_document_removals( + proof, + contract_id, + &ContractDocumentRemovalsQuery { + document_type_name: document_type_name.clone(), + selection: ContractDocumentRemovalsSelection::DocumentIds(vec![*document_id]), + }, + platform_version, + )?; + match (entries.pop(), entries.is_empty()) { + (Some(entry), true) + if entry.document_id == *document_id + && entry.removal.moderator_id == transition.owner_id() + && entry.removal.reason == *reason => + { + Ok(( + root_hash, + VerifiedContractDocumentRemoval( + contract_id, + document_type_name.clone(), + *document_id, + entry.removal, + ), + )) + } + _ => Err(Error::Proof(ProofError::IncorrectProof(format!( + "proof of state transition execution does not show the {} on contract {} by {}", + transition.action(), + contract_id, + transition.owner_id() + )))), + } +} + #[cfg(test)] mod tests { use super::*; diff --git a/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_query_versions/mod.rs b/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_query_versions/mod.rs index a2177f2d92f..17483a5b79c 100644 --- a/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_query_versions/mod.rs +++ b/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_query_versions/mod.rs @@ -96,6 +96,7 @@ pub struct DriveAbciQueryGroupVersions { pub struct DriveAbciQueryContractModerationVersions { pub contract_moderation_status: FeatureVersionBounds, pub contract_moderation_entries: FeatureVersionBounds, + pub contract_document_removals: FeatureVersionBounds, /// The two fee pots a contract's document action fees collect in pub contract_fee_pots: FeatureVersionBounds, } diff --git a/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_query_versions/v0.rs b/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_query_versions/v0.rs index 244ce4d9e2f..0be52acdb4a 100644 --- a/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_query_versions/v0.rs +++ b/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_query_versions/v0.rs @@ -309,6 +309,11 @@ pub const DRIVE_ABCI_QUERY_VERSIONS_V0: DriveAbciQueryVersions = DriveAbciQueryV max_version: 0, default_current_version: 0, }, + contract_document_removals: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, contract_fee_pots: FeatureVersionBounds { min_version: 0, max_version: 0, diff --git a/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_query_versions/v1.rs b/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_query_versions/v1.rs index 620f434b6f6..394dcb510c6 100644 --- a/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_query_versions/v1.rs +++ b/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_query_versions/v1.rs @@ -311,6 +311,11 @@ pub const DRIVE_ABCI_QUERY_VERSIONS_V1: DriveAbciQueryVersions = DriveAbciQueryV max_version: 0, default_current_version: 0, }, + contract_document_removals: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, contract_fee_pots: FeatureVersionBounds { min_version: 0, max_version: 0, diff --git a/packages/rs-platform-version/src/version/drive_versions/drive_contract_method_versions/mod.rs b/packages/rs-platform-version/src/version/drive_versions/drive_contract_method_versions/mod.rs index b52f19ea2d6..64340526f77 100644 --- a/packages/rs-platform-version/src/version/drive_versions/drive_contract_method_versions/mod.rs +++ b/packages/rs-platform-version/src/version/drive_versions/drive_contract_method_versions/mod.rs @@ -32,6 +32,11 @@ pub struct DriveContractModerationMethodVersions { pub insert_contract_moderation_trees: FeatureVersion, pub add_estimation_costs_for_contract_moderation_trees: FeatureVersion, pub add_estimation_costs_for_contract_moderation_entry: FeatureVersion, + pub add_contract_document_removal: FeatureVersion, + pub fetch_contract_document_removals: FeatureVersion, + pub prove_contract_document_removals: FeatureVersion, + pub insert_contract_document_removal_trees: FeatureVersion, + pub add_estimation_costs_for_contract_document_removal: FeatureVersion, } /// Drive methods for the two fee pots a contract's document action fees accumulate in diff --git a/packages/rs-platform-version/src/version/drive_versions/drive_contract_method_versions/v1.rs b/packages/rs-platform-version/src/version/drive_versions/drive_contract_method_versions/v1.rs index e726006dcde..e356391adc0 100644 --- a/packages/rs-platform-version/src/version/drive_versions/drive_contract_method_versions/v1.rs +++ b/packages/rs-platform-version/src/version/drive_versions/drive_contract_method_versions/v1.rs @@ -56,6 +56,11 @@ pub const DRIVE_CONTRACT_METHOD_VERSIONS_V1: DriveContractMethodVersions = insert_contract_moderation_trees: 0, add_estimation_costs_for_contract_moderation_trees: 0, add_estimation_costs_for_contract_moderation_entry: 0, + add_contract_document_removal: 0, + fetch_contract_document_removals: 0, + prove_contract_document_removals: 0, + insert_contract_document_removal_trees: 0, + add_estimation_costs_for_contract_document_removal: 0, }, fee_pots: DriveContractFeePotMethodVersions { insert_contract_fee_pot_trees: 0, diff --git a/packages/rs-platform-version/src/version/drive_versions/drive_contract_method_versions/v2.rs b/packages/rs-platform-version/src/version/drive_versions/drive_contract_method_versions/v2.rs index 811afedd006..d4845641828 100644 --- a/packages/rs-platform-version/src/version/drive_versions/drive_contract_method_versions/v2.rs +++ b/packages/rs-platform-version/src/version/drive_versions/drive_contract_method_versions/v2.rs @@ -56,6 +56,11 @@ pub const DRIVE_CONTRACT_METHOD_VERSIONS_V2: DriveContractMethodVersions = insert_contract_moderation_trees: 0, add_estimation_costs_for_contract_moderation_trees: 0, add_estimation_costs_for_contract_moderation_entry: 0, + add_contract_document_removal: 0, + fetch_contract_document_removals: 0, + prove_contract_document_removals: 0, + insert_contract_document_removal_trees: 0, + add_estimation_costs_for_contract_document_removal: 0, }, fee_pots: DriveContractFeePotMethodVersions { insert_contract_fee_pot_trees: 0, diff --git a/packages/rs-platform-version/src/version/drive_versions/drive_contract_method_versions/v3.rs b/packages/rs-platform-version/src/version/drive_versions/drive_contract_method_versions/v3.rs index 0f778446ccb..67339d948ca 100644 --- a/packages/rs-platform-version/src/version/drive_versions/drive_contract_method_versions/v3.rs +++ b/packages/rs-platform-version/src/version/drive_versions/drive_contract_method_versions/v3.rs @@ -67,6 +67,11 @@ pub const DRIVE_CONTRACT_METHOD_VERSIONS_V3: DriveContractMethodVersions = insert_contract_moderation_trees: 0, add_estimation_costs_for_contract_moderation_trees: 0, add_estimation_costs_for_contract_moderation_entry: 0, + add_contract_document_removal: 0, + fetch_contract_document_removals: 0, + prove_contract_document_removals: 0, + insert_contract_document_removal_trees: 0, + add_estimation_costs_for_contract_document_removal: 0, }, fee_pots: DriveContractFeePotMethodVersions { insert_contract_fee_pot_trees: 0, diff --git a/packages/rs-platform-version/src/version/drive_versions/drive_contract_method_versions/v4.rs b/packages/rs-platform-version/src/version/drive_versions/drive_contract_method_versions/v4.rs index 4c95a3289ff..df2aa494407 100644 --- a/packages/rs-platform-version/src/version/drive_versions/drive_contract_method_versions/v4.rs +++ b/packages/rs-platform-version/src/version/drive_versions/drive_contract_method_versions/v4.rs @@ -54,6 +54,11 @@ pub const DRIVE_CONTRACT_METHOD_VERSIONS_V4: DriveContractMethodVersions = insert_contract_moderation_trees: 0, add_estimation_costs_for_contract_moderation_trees: 0, add_estimation_costs_for_contract_moderation_entry: 0, + add_contract_document_removal: 0, + fetch_contract_document_removals: 0, + prove_contract_document_removals: 0, + insert_contract_document_removal_trees: 0, + add_estimation_costs_for_contract_document_removal: 0, }, ..DRIVE_CONTRACT_METHOD_VERSIONS_V3 }; diff --git a/packages/rs-platform-version/src/version/drive_versions/drive_verify_method_versions/mod.rs b/packages/rs-platform-version/src/version/drive_versions/drive_verify_method_versions/mod.rs index 170720f185c..06bc07e5544 100644 --- a/packages/rs-platform-version/src/version/drive_versions/drive_verify_method_versions/mod.rs +++ b/packages/rs-platform-version/src/version/drive_versions/drive_verify_method_versions/mod.rs @@ -41,6 +41,7 @@ pub struct DriveVerifyContractModerationMethodVersions { pub verify_contract_moderation_status: FeatureVersion, pub verify_contract_moderation_entries: FeatureVersion, pub verify_contract_fee_pots: FeatureVersion, + pub verify_contract_document_removals: FeatureVersion, } #[derive(Clone, Debug, Default)] diff --git a/packages/rs-platform-version/src/version/drive_versions/drive_verify_method_versions/v1.rs b/packages/rs-platform-version/src/version/drive_versions/drive_verify_method_versions/v1.rs index 460c545daa2..312f4c22275 100644 --- a/packages/rs-platform-version/src/version/drive_versions/drive_verify_method_versions/v1.rs +++ b/packages/rs-platform-version/src/version/drive_versions/drive_verify_method_versions/v1.rs @@ -87,6 +87,7 @@ pub const DRIVE_VERIFY_METHOD_VERSIONS_V1: DriveVerifyMethodVersions = DriveVeri verify_contract_moderation_status: 0, verify_contract_moderation_entries: 0, verify_contract_fee_pots: 0, + verify_contract_document_removals: 0, }, token: DriveVerifyTokenMethodVersions { verify_token_balances_for_identity_ids: 0, diff --git a/packages/rs-platform-version/src/version/drive_versions/v9.rs b/packages/rs-platform-version/src/version/drive_versions/v9.rs index 7fca887f026..db9faa198ef 100644 --- a/packages/rs-platform-version/src/version/drive_versions/v9.rs +++ b/packages/rs-platform-version/src/version/drive_versions/v9.rs @@ -119,7 +119,7 @@ pub const DRIVE_VERSION_V9: DriveVersion = DriveVersion { state_transitions: DRIVE_STATE_TRANSITION_METHOD_VERSIONS_V4, // changed: document_from_action generation 1 stamps built documents with the contract version (create assigns, replace re-assigns; paired with document serialization format 3) batch_operations: DriveBatchOperationsMethodVersion { convert_drive_operations_to_grove_operations: 0, - apply_drive_operations: 0, + apply_drive_operations: 1, // changed: a batch carrying a storage refund forfeiture (a moderator's document deletion) refunds nobody }, platform_state: DrivePlatformStateMethodVersions { fetch_platform_state_bytes: 0, diff --git a/packages/rs-platform-version/src/version/mocks/v2_test.rs b/packages/rs-platform-version/src/version/mocks/v2_test.rs index 827175473f4..bd989215e95 100644 --- a/packages/rs-platform-version/src/version/mocks/v2_test.rs +++ b/packages/rs-platform-version/src/version/mocks/v2_test.rs @@ -466,6 +466,11 @@ pub const TEST_PLATFORM_V2: PlatformVersion = PlatformVersion { max_version: 0, default_current_version: 0, }, + contract_document_removals: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, contract_fee_pots: FeatureVersionBounds { min_version: 0, max_version: 0, diff --git a/packages/rs-platform-version/src/version/v14.rs b/packages/rs-platform-version/src/version/v14.rs index 3f7075f7c19..4c8722ca6f2 100644 --- a/packages/rs-platform-version/src/version/v14.rs +++ b/packages/rs-platform-version/src/version/v14.rs @@ -405,6 +405,31 @@ pub const PROTOCOL_VERSION_14: ProtocolVersion = 14; /// only id has every create rejected with /// `InvalidDocumentTransitionIdError`. /// +/// 19. **Document deletion by moderators**: a document type of a contract +/// that declares moderation may set `canBeDeletedByModerators` (meta-schema +/// v3, fixed when the type is created, refused on a type that keeps +/// history, is indexOnly or restricts creation; for references such a type +/// is deletable, so a permanentDocument reference refuses it and a +/// deletableDocument reference accepts it). A moderation declaration may then keep +/// no list at all. `ContractUserModeration` gains the `DeleteDocument` +/// action: the owner or a moderator deletes a document of such a type, +/// except the owner's and the moderators' own, with a reason like a +/// ban's. The deletion leaves a record under the contract +/// (`[64, contract, 2] / 16 / / `: the +/// document's owner, the moderator, the block time and the reason), paid +/// for by the moderator and never deleted; `insert_contract` 2 creates +/// the records tree of each such document type, `update_contract` 2 the +/// tree of one an update adds, and either the tree above them with the +/// contract's first. The deleted document's +/// owner gets no storage refund: `apply_drive_operations = 1` +/// (`DRIVE_VERSION_V9`) attributes the removal of a batch that carries +/// the forfeiture to nobody, so the credits stay in the storage pools. +/// A record is final, since a document id is produced at most once (18). +/// Neither the type's deletion token cost nor its `actionFees` deletion +/// fee is charged. +/// The moderation method table, the verify table and the query table gain +/// the document removal methods (`getContractDocumentRemovals`). +/// /// * `ShieldFromIdentity` (state transition type 21) activates: /// `SHIELD_FROM_IDENTITY_INITIAL_PROTOCOL_VERSION = 14` gates it in /// `is_allowed`, and `DRIVE_ABCI_VALIDATION_VERSIONS_V10` is the first @@ -461,7 +486,7 @@ pub const PROTOCOL_VERSION_14: ProtocolVersion = 14; /// its gates on; Drive identity methods v2 rewrite the key and raise the remaining budget). pub const PLATFORM_V14: PlatformVersion = PlatformVersion { protocol_version: PROTOCOL_VERSION_14, - drive: DRIVE_VERSION_V9, // changed: drive document method versions v4 — v2 index walkers (shared-prefix aggregate indexes become insertable) + the detect_ranked_mode slot; contract method versions v4: the moderation list trees and the moderation method table + drive: DRIVE_VERSION_V9, // changed: drive document method versions v4 — v2 index walkers (shared-prefix aggregate indexes become insertable) + the detect_ranked_mode slot; contract method versions v4: the moderation list trees, the document removal record trees and the moderation method table; apply_drive_operations 1 (a moderator's document deletion refunds nobody) drive_abci: DriveAbciVersion { structs: DRIVE_ABCI_STRUCTURE_VERSIONS_V2, // changed: saved platform state structure 1 keeps masternodes and validator sets as one aux entry each methods: DRIVE_ABCI_METHOD_VERSIONS_V10, // changed: records the per-block total credits history for the daily withdrawal limit diff --git a/packages/rs-sdk/src/mock/requests.rs b/packages/rs-sdk/src/mock/requests.rs index c4fd7f9c231..e3ef6b11ee0 100644 --- a/packages/rs-sdk/src/mock/requests.rs +++ b/packages/rs-sdk/src/mock/requests.rs @@ -27,7 +27,9 @@ use dpp::{ use drive::grovedb::Element; use drive_proof_verifier::types::identity_keys_remaining_budgets::IdentityKeysRemainingBudgets; use drive_proof_verifier::types::contract_moderation::{ - ContractFeePotLastClaim, ContractFeePotState, ContractFeePots, ContractModerationEntries, ContractModerationEntry, ContractModerationListStatus, + ContractDocumentRemoval, ContractDocumentRemovalEntry, ContractDocumentRemovals, + ContractFeePotLastClaim, ContractFeePotState, ContractFeePots, ContractModerationEntries, + ContractModerationEntry, ContractModerationListStatus, ContractModerationListStatuses, ContractModerationReason, }; use drive_proof_verifier::types::contract_groups::{ @@ -465,6 +467,62 @@ impl MockResponse for ContractModerationEntries { } } +/// One removal record as a fixture holds it: the document id, its owner, the moderator, when +/// the removal happened and why. `ContractDocumentRemoval` has no bincode encoding of its own. +type EncodedContractDocumentRemoval = ( + Identifier, + Identifier, + Identifier, + u64, + ContractModerationReason, +); + +impl MockResponse for ContractDocumentRemovals { + fn mock_serialize(&self, _sdk: &MockDashPlatformSdk) -> Vec { + let removals: Vec = self + .removals() + .iter() + .map(|entry| { + ( + entry.document_id, + entry.removal.document_owner_id, + entry.removal.moderator_id, + entry.removal.removed_at, + entry.removal.reason.clone(), + ) + }) + .collect(); + bincode::encode_to_vec(removals, BINCODE_CONFIG).expect("encode ContractDocumentRemovals") + } + + fn mock_deserialize(_sdk: &MockDashPlatformSdk, buf: &[u8]) -> Self + where + Self: Sized, + { + let (removals, _): (Vec, _) = + bincode::decode_from_slice(buf, BINCODE_CONFIG) + .expect("decode ContractDocumentRemovals"); + ContractDocumentRemovals( + removals + .into_iter() + .map( + |(document_id, document_owner_id, moderator_id, removed_at, reason)| { + ContractDocumentRemovalEntry { + document_id, + removal: ContractDocumentRemoval { + document_owner_id, + moderator_id, + reason, + removed_at, + }, + } + }, + ) + .collect(), + ) + } +} + impl MockResponse for ContractGroupMembersPage { fn mock_serialize(&self, _sdk: &MockDashPlatformSdk) -> Vec { let (kind, entries) = match self { diff --git a/packages/rs-sdk/src/mock/sdk.rs b/packages/rs-sdk/src/mock/sdk.rs index 3998589be30..7f13aeb991c 100644 --- a/packages/rs-sdk/src/mock/sdk.rs +++ b/packages/rs-sdk/src/mock/sdk.rs @@ -180,6 +180,9 @@ impl MockDashPlatformSdk { "GetContractModerationEntriesRequest" => load_expectation::< proto::GetContractModerationEntriesRequest, >(&mut dapi, filename)?, + "GetContractDocumentRemovalsRequest" => load_expectation::< + proto::GetContractDocumentRemovalsRequest, + >(&mut dapi, filename)?, "GetContractFeePotsRequest" => { load_expectation::(&mut dapi, filename)? } diff --git a/packages/rs-sdk/src/platform/contract_moderation.rs b/packages/rs-sdk/src/platform/contract_moderation.rs index 1d823c120ce..ce38a7a143a 100644 --- a/packages/rs-sdk/src/platform/contract_moderation.rs +++ b/packages/rs-sdk/src/platform/contract_moderation.rs @@ -1,6 +1,7 @@ //! Contract moderation queries: one identity's status on a moderated contract -//! (`getContractModerationStatus`) and one page of a contract's banlist or suspension list -//! (`getContractModerationEntries`). +//! (`getContractModerationStatus`), one page of a contract's banlist or suspension list +//! (`getContractModerationEntries`) and the records of the documents its moderators deleted +//! (`getContractDocumentRemovals`). //! //! A moderated contract declares in its config which lists it keeps //! (`DataContractConfig::moderation`). A status query names the lists to read, and each must be @@ -13,15 +14,25 @@ //! * [`ContractModerationEntries::fetch`] with a [`ContractModerationEntriesPageQuery`] returns //! one page of a list in identity id order; the page's //! [`next_query`](ContractModerationEntries::next_query) is the cursor of the next page. +//! * [`ContractDocumentRemovals::fetch`] with a [`ContractDocumentRemovalsPageQuery`] returns +//! the records of the documents the moderators deleted within one document type, either one +//! page in document id order or the records of the ids named. The document type must be one +//! that sets `canBeDeletedByModerators`: no other keeps records, and the node refuses a query +//! over a tree that does not exist. //! -//! Both types also implement [`FetchUnproved`] for the unverified fast path. +//! Every type also implements [`FetchUnproved`] for the unverified fast path. use crate::platform::{Fetch, FetchUnproved, Identifier, Query, QuerySettings}; use crate::Error; +use dapi_grpc::platform::v0::get_contract_document_removals_request::get_contract_document_removals_request_v0::Selection; +use dapi_grpc::platform::v0::get_contract_document_removals_request::{ + DocumentIds, GetContractDocumentRemovalsRequestV0, Page, +}; use dapi_grpc::platform::v0::get_contract_moderation_entries_request::GetContractModerationEntriesRequestV0; use dapi_grpc::platform::v0::get_contract_moderation_status_request::GetContractModerationStatusRequestV0; use dapi_grpc::platform::v0::{ - get_contract_moderation_entries_request, get_contract_moderation_status_request, + get_contract_document_removals_request, get_contract_moderation_entries_request, + get_contract_moderation_status_request, GetContractDocumentRemovalsRequest, GetContractModerationEntriesRequest, GetContractModerationStatusRequest, }; use dpp::data_contract::accessors::v0::DataContractV0Getters; @@ -29,9 +40,11 @@ use dpp::data_contract::config::v2::DataContractConfigGettersV2; use dpp::data_contract::DataContract; use dpp::version::PlatformVersion; pub use drive_proof_verifier::types::contract_moderation::{ - default_contract_moderation_entries_limit, list_to_request, ContractModerationEntries, - ContractModerationEntriesQuery, ContractModerationEntry, ContractModerationList, - ContractModerationListStatus, ContractModerationListStatuses, + default_contract_document_removals_limit, default_contract_moderation_entries_limit, + list_to_request, ContractDocumentRemoval, ContractDocumentRemovalEntry, + ContractDocumentRemovals, ContractDocumentRemovalsQuery, ContractDocumentRemovalsSelection, + ContractModerationEntries, ContractModerationEntriesQuery, ContractModerationEntry, + ContractModerationList, ContractModerationListStatus, ContractModerationListStatuses, }; /// Query for one identity's status on a moderated contract. @@ -159,3 +172,112 @@ impl Fetch for ContractModerationEntries { impl FetchUnproved for ContractModerationEntries { type Request = GetContractModerationEntriesRequest; } + +/// Query for the removal records a moderated contract keeps for one of its document types: +/// one page of them, or the records of the document ids named. +#[derive(Debug, Clone, PartialEq, Eq)] +pub struct ContractDocumentRemovalsPageQuery { + /// The moderated contract. + pub contract_id: Identifier, + /// The document type, and which of its records to read. + pub query: ContractDocumentRemovalsQuery, +} + +impl ContractDocumentRemovalsPageQuery { + /// The first page of the records of `document_type_name`, up to the page cap of + /// `platform_version`: the version of the network queried (`Sdk::version`), whose cap is + /// the one the node enforces. + pub fn new( + contract_id: Identifier, + document_type_name: String, + platform_version: &PlatformVersion, + ) -> Self { + Self { + contract_id, + query: ContractDocumentRemovalsQuery { + document_type_name, + selection: ContractDocumentRemovalsSelection::Page { + start_after: None, + limit: default_contract_document_removals_limit(platform_version), + }, + }, + } + } + + /// The records of `document_ids` alone, from one to the page cap of the network queried. + /// A document with no record is left out of the answer rather than refused. + pub fn for_document_ids( + contract_id: Identifier, + document_type_name: String, + document_ids: Vec, + ) -> Self { + Self { + contract_id, + query: ContractDocumentRemovalsQuery { + document_type_name, + selection: ContractDocumentRemovalsSelection::DocumentIds(document_ids), + }, + } + } + + /// Bounds the page to `limit` records, leaving a read by ids as it is: it is already + /// bounded by the ids it names. + pub fn with_limit(mut self, limit: u16) -> Self { + if let ContractDocumentRemovalsSelection::Page { start_after, .. } = &self.query.selection { + self.query.selection = ContractDocumentRemovalsSelection::Page { + start_after: *start_after, + limit, + }; + } + self + } + + /// The query for the page after `page`, or `None` when `page` holds fewer records than the + /// limit and so was the last. A read by ids has no page after it. + pub fn after(&self, page: &ContractDocumentRemovals) -> Option { + page.next_query(&self.query).map(|query| Self { + contract_id: self.contract_id, + query, + }) + } +} + +impl Query for ContractDocumentRemovalsPageQuery { + fn query( + &self, + settings: &QuerySettings<'_>, + ) -> Result { + let selection = match &self.query.selection { + ContractDocumentRemovalsSelection::DocumentIds(document_ids) => { + Selection::DocumentIds(DocumentIds { + document_ids: document_ids.iter().map(|id| id.to_vec()).collect(), + }) + } + ContractDocumentRemovalsSelection::Page { start_after, limit } => { + Selection::Page(Page { + start_after: start_after.map(|id| id.to_vec()), + limit: Some(u32::from(*limit)), + }) + } + }; + Ok(GetContractDocumentRemovalsRequest { + version: Some(get_contract_document_removals_request::Version::V0( + GetContractDocumentRemovalsRequestV0 { + contract_id: self.contract_id.to_vec(), + document_type_name: self.query.document_type_name.clone(), + selection: Some(selection), + prove: settings.prove, + }, + )), + }) + } +} + +impl Fetch for ContractDocumentRemovals { + type Query = GetContractDocumentRemovalsRequest; + type Request = GetContractDocumentRemovalsRequest; +} + +impl FetchUnproved for ContractDocumentRemovals { + type Request = GetContractDocumentRemovalsRequest; +} diff --git a/packages/rs-sdk/src/platform/query.rs b/packages/rs-sdk/src/platform/query.rs index cd4ece4f978..8854cc7d934 100644 --- a/packages/rs-sdk/src/platform/query.rs +++ b/packages/rs-sdk/src/platform/query.rs @@ -156,6 +156,7 @@ impl_wire_query!( proto::GetContestedResourceVoteStateRequest, proto::GetContestedResourceVotersForIdentityRequest, proto::GetContestedResourcesRequest, + proto::GetContractDocumentRemovalsRequest, proto::GetContractFeePotsRequest, proto::GetContractGroupInfoRequest, proto::GetContractGroupMembersRequest, diff --git a/packages/rs-sdk/src/platform/transition/contract_user_moderation.rs b/packages/rs-sdk/src/platform/transition/contract_user_moderation.rs index 62f4e38fc27..d77c337d7ad 100644 --- a/packages/rs-sdk/src/platform/transition/contract_user_moderation.rs +++ b/packages/rs-sdk/src/platform/transition/contract_user_moderation.rs @@ -1,22 +1,31 @@ -//! Ban, unban, suspend and unsuspend identities on a moderated data contract (protocol -//! version 14). +//! Ban, unban, suspend and unsuspend identities on a moderated data contract, and delete +//! documents of the document types that let moderators do so (protocol version 14). //! //! A contract whose config declares moderation keeps a banlist and/or a suspension list. The //! contract owner, or a moderator the config names, edits them with a //! [`ContractUserModerationTransition`] signed by a CRITICAL authentication key. A banned or //! suspended identity cannot act on the contract at the document level. //! +//! The same transition deletes one document of a document type that sets +//! `canBeDeletedByModerators`, whoever owns it, and leaves a record of the deletion under the +//! contract. +//! //! ```ignore //! let reason = ContractModerationReason::from_text("spam"); //! let status = moderator_identity -//! .ban_contract_user(&sdk, contract_id, user_id, reason, None, signer, None) +//! .ban_contract_user(&sdk, contract_id, user_id, reason.clone(), None, &signer, None) +//! .await?; +//! let removal = moderator_identity +//! .delete_contract_document( +//! &sdk, contract_id, "post".to_string(), document_id, reason, None, &signer, None, +//! ) //! .await?; //! ``` use crate::platform::Fetch; use dash_context_provider::ContextProvider; use dpp::data_contract::config::moderation::{ - ContractModerationListStatuses, ContractModerationReason, + ContractDocumentRemoval, ContractModerationListStatuses, ContractModerationReason, }; use dpp::data_contract::DataContract; use dpp::identity::accessors::IdentityGettersV0; @@ -74,6 +83,26 @@ impl TryFrom for ModeratedUserStatus { } } +/// The record a document deletion left under the contract, as its proof shows it. The proof +/// binds the record to the transition that wrote it, so only the record itself is kept here: +/// the contract, the document type and the document id are the caller's own arguments. +struct VerifiedDocumentRemoval(ContractDocumentRemoval); + +impl TryFrom for VerifiedDocumentRemoval { + type Error = Error; + + fn try_from(value: StateTransitionProofResult) -> Result { + match value { + StateTransitionProofResult::VerifiedContractDocumentRemoval(_, _, _, removal) => { + Ok(Self(removal)) + } + other => Err(Error::Generic(format!( + "expected a contract document removal proof result, got {other}" + ))), + } + } +} + #[async_trait::async_trait] pub trait ModerateContractUser: Waitable { /// Sends one moderation `action` for `contract_id`, signed by this identity, and resolves @@ -191,6 +220,26 @@ pub trait ModerateContractUser: Waitable { ) .await } + + /// Deletes document `document_id` of `document_type_name` on `contract_id`, whoever owns + /// it, for `reason` (as for a ban). The document type must set + /// `canBeDeletedByModerators`. Resolves with the record the deletion left under the + /// contract: whose the document was, who removed it, why and when. + /// + /// The document's owner gets no storage refund, and nothing ever deletes the record, so + /// the author may create the same document id again without the record going away. + #[allow(clippy::too_many_arguments)] + async fn delete_contract_document + Send>( + &self, + sdk: &Sdk, + contract_id: Identifier, + document_type_name: String, + document_id: Identifier, + reason: ContractModerationReason, + signing_key_to_use: Option<&IdentityPublicKey>, + signer: S, + settings: Option, + ) -> Result; } #[async_trait::async_trait] @@ -204,42 +253,54 @@ impl ModerateContractUser for Identity { signer: S, settings: Option, ) -> Result { - let signing_key_id = match signing_key_to_use { - Some(key) => key.id(), - None => signing_key_for_moderation(self, &signer)?, - }; - - // The proof of a ban covers every list the contract keeps, which the verifier reads - // from the contract through the context provider. A provider that can not resolve the - // contract would refuse a result the network already accepted, so before the nonce is - // taken and anything is signed or paid for, the provider is asked, and only when it - // does not have the contract (the lists never change, so whatever copy it holds will - // do) is the contract fetched and registered with it. - if matches!(action, ContractUserModerationAction::Ban { .. }) { - ensure_provider_resolves_contract(sdk, contract_id, false).await?; + // A document deletion is proved by its removal record, not by a status. Refused before + // the nonce is taken: sent from here it would execute, be paid for, and then fail to + // read its own result. + if matches!(action, ContractUserModerationAction::DeleteDocument { .. }) { + return Err(Error::Generic( + "a document deletion names no identity to report a status of: send it with \ + `delete_contract_document`, which returns the removal record" + .to_string(), + )); } - - let identity_contract_nonce = sdk - .get_identity_contract_nonce(self.id(), contract_id, true, settings) - .await?; - let user_fee_increase = settings.and_then(|settings| settings.user_fee_increase); - let state_transition = ContractUserModerationTransition::try_from_identity_with_signer( + broadcast_moderation( self, - &signing_key_id, + sdk, contract_id, action, - identity_contract_nonce, - user_fee_increase.unwrap_or_default(), - &signer, - sdk.version(), - None, + signing_key_to_use, + signer, + settings, ) - .await?; - ensure_valid_state_transition_structure(&state_transition, sdk.version())?; + .await + } - state_transition - .broadcast_and_wait_for_affected_state(sdk, settings) - .await + async fn delete_contract_document + Send>( + &self, + sdk: &Sdk, + contract_id: Identifier, + document_type_name: String, + document_id: Identifier, + reason: ContractModerationReason, + signing_key_to_use: Option<&IdentityPublicKey>, + signer: S, + settings: Option, + ) -> Result { + let VerifiedDocumentRemoval(removal) = broadcast_moderation( + self, + sdk, + contract_id, + ContractUserModerationAction::DeleteDocument { + document_type_name, + document_id, + reason, + }, + signing_key_to_use, + signer, + settings, + ) + .await?; + Ok(removal) } } @@ -273,6 +334,60 @@ pub(super) async fn ensure_provider_resolves_contract( Ok(()) } +/// Signs `action` for `contract_id` with an identity's CRITICAL authentication key, broadcasts +/// it and waits for the state it affected: what every moderation of the trait does, whatever +/// its proof shows. +async fn broadcast_moderation + Send, R>( + identity: &Identity, + sdk: &Sdk, + contract_id: Identifier, + action: ContractUserModerationAction, + signing_key_to_use: Option<&IdentityPublicKey>, + signer: S, + settings: Option, +) -> Result +where + R: TryFrom + Send, +{ + let signing_key_id = match signing_key_to_use { + Some(key) => key.id(), + None => signing_key_for_moderation(identity, &signer)?, + }; + + // The proof of a ban covers every list the contract keeps, which the verifier reads from + // the contract through the context provider. A provider that can not resolve the contract + // would refuse a result the network already accepted, so before the nonce is taken and + // anything is signed or paid for, the provider is asked, and only when it does not have + // the contract (the lists never change, so whatever copy it holds will do) is the contract + // fetched and registered with it. A document deletion is proved by its own removal record + // and needs no contract. + if matches!(action, ContractUserModerationAction::Ban { .. }) { + ensure_provider_resolves_contract(sdk, contract_id, false).await?; + } + + let identity_contract_nonce = sdk + .get_identity_contract_nonce(identity.id(), contract_id, true, settings) + .await?; + let user_fee_increase = settings.and_then(|settings| settings.user_fee_increase); + let state_transition = ContractUserModerationTransition::try_from_identity_with_signer( + identity, + &signing_key_id, + contract_id, + action, + identity_contract_nonce, + user_fee_increase.unwrap_or_default(), + &signer, + sdk.version(), + None, + ) + .await?; + ensure_valid_state_transition_structure(&state_transition, sdk.version())?; + + state_transition + .broadcast_and_wait_for_affected_state(sdk, settings) + .await +} + /// The first enabled CRITICAL authentication key without contract bounds (a bound key may /// only sign batches) that the signer can sign with. pub(super) fn signing_key_for_moderation>( diff --git a/packages/wasm-dpp/src/errors/consensus/consensus_error.rs b/packages/wasm-dpp/src/errors/consensus/consensus_error.rs index d08e5eb1ad0..86a89b7a457 100644 --- a/packages/wasm-dpp/src/errors/consensus/consensus_error.rs +++ b/packages/wasm-dpp/src/errors/consensus/consensus_error.rs @@ -103,7 +103,8 @@ use dpp::consensus::state::contract_moderation::{ ContractModeratorIdentityNotFoundError, ContractSuspensionNotInFutureError, ContractUserAlreadyBannedError, ContractUserBannedError, ContractUserNotBannedError, - ContractUserNotSuspendedError, ContractUserSuspendedError, IdentityNotContractModeratorError, + ContractUserNotSuspendedError, ContractUserSuspendedError, + DocumentTypeNotDeletableByModeratorsError, IdentityNotContractModeratorError, }; use dpp::consensus::state::contract_group::{ ContractGroupAdminNotFoundError, ContractGroupAlreadyExistsError, ContractGroupNotFoundError, @@ -636,6 +637,9 @@ pub fn from_state_error(state_error: &StateError) -> JsValue { StateError::ReferencedDocumentTypeNotDeletableError(e) => { generic_consensus_error!(ReferencedDocumentTypeNotDeletableError, e).into() } + StateError::DocumentTypeNotDeletableByModeratorsError(e) => { + generic_consensus_error!(DocumentTypeNotDeletableByModeratorsError, e).into() + } } } diff --git a/packages/wasm-dpp2/src/data_contract/mod.rs b/packages/wasm-dpp2/src/data_contract/mod.rs index 0de257becd7..eb036e22e2d 100644 --- a/packages/wasm-dpp2/src/data_contract/mod.rs +++ b/packages/wasm-dpp2/src/data_contract/mod.rs @@ -20,6 +20,6 @@ pub use transitions::create::DataContractCreateTransitionWasm; pub use transitions::fee_claim::{ContractFeeClaimWasm, contract_fee_pot_from_str}; pub use transitions::update::DataContractUpdateTransitionWasm; pub use transitions::user_moderation::{ - ContractModerationReasonJs, ContractUserModerationWasm, moderation_action_from_parts, - moderation_reason_to_js, + ContractModerationReasonJs, ContractUserModerationActionParts, ContractUserModerationWasm, + moderation_action_from_parts, moderation_reason_to_js, }; diff --git a/packages/wasm-dpp2/src/data_contract/model.rs b/packages/wasm-dpp2/src/data_contract/model.rs index 3ab31c02660..17614a53c9a 100644 --- a/packages/wasm-dpp2/src/data_contract/model.rs +++ b/packages/wasm-dpp2/src/data_contract/model.rs @@ -130,8 +130,9 @@ export type ContractModerators = | { $type: "appointedModerators"; identities: string[] }; /** - * The moderation a data contract declares. At least one list must be kept, and a list that is - * kept can never be turned off by a contract update. + * The moderation a data contract declares. At least one list must be kept, unless a document + * type sets `canBeDeletedByModerators`: moderators that only delete documents need no list. A + * list that is kept can never be turned off by a contract update. */ export interface ContractModerationConfig { banlist: boolean; diff --git a/packages/wasm-dpp2/src/data_contract/transitions/user_moderation.rs b/packages/wasm-dpp2/src/data_contract/transitions/user_moderation.rs index 9544fed2daa..5736565ae4b 100644 --- a/packages/wasm-dpp2/src/data_contract/transitions/user_moderation.rs +++ b/packages/wasm-dpp2/src/data_contract/transitions/user_moderation.rs @@ -3,12 +3,14 @@ use crate::identifier::{IdentifierLikeJs, IdentifierWasm}; use crate::impl_wasm_conversions_inner; use crate::impl_wasm_type_info; use crate::state_transitions::StateTransitionWasm; -use crate::utils::{try_from_options, try_to_u16, try_to_u32, try_to_u64}; +use crate::utils::{ + try_from_options, try_from_options_optional, try_to_u16, try_to_u32, try_to_u64, +}; use dpp::data_contract::config::moderation::ContractModerationReason; use dpp::platform_value::BinaryData; use dpp::platform_value::string_encoding::Encoding::{Base64, Hex}; use dpp::platform_value::string_encoding::{decode, encode}; -use dpp::prelude::UserFeeIncrease; +use dpp::prelude::{Identifier, UserFeeIncrease}; use dpp::serialization::{PlatformDeserializableUntrusted, PlatformSerializable}; use dpp::state_transition::contract_user_moderation_transition::ContractUserModerationTransition; use dpp::state_transition::contract_user_moderation_transition::accessors::ContractUserModerationTransitionAccessorsV0; @@ -26,8 +28,9 @@ use wasm_bindgen::prelude::wasm_bindgen; #[wasm_bindgen(typescript_custom_section)] const CONTRACT_USER_MODERATION_TS: &str = r#" /** - * Why a moderator banned or suspended an identity. Every ban and every suspension carries - * one, and it is stored with the entry. Nothing checks what a moderator writes. + * Why a moderator banned or suspended an identity, or deleted a document. Every ban, every + * suspension and every document deletion carries one, and it is stored with the entry or the + * removal record. Nothing checks what a moderator writes. */ export interface ContractModerationReason { /** @@ -41,18 +44,20 @@ export interface ContractModerationReason { } /** - * What a moderation transition does to one identity on a contract. The wire shape of the - * action, as the transition's `action` field carries it. + * What a moderation transition does on a contract, to one identity or to one document. The + * wire shape of the action, as the transition's `action` field carries it. */ export type ContractUserModerationActionJSON = | { $type: "ban"; identityId: string; reason: ContractModerationReason } | { $type: "unban"; identityId: string } | { $type: "suspend"; identityId: string; until: number | string; reason: ContractModerationReason } - | { $type: "unsuspend"; identityId: string }; + | { $type: "unsuspend"; identityId: string } + | { $type: "deleteDocument"; documentTypeName: string; documentId: string; reason: ContractModerationReason }; /** - * Bans, unbans, suspends or unsuspends one identity on a moderated data contract (protocol - * version 14). Signed by the contract owner or a moderator its config names, with a CRITICAL + * Bans, unbans, suspends or unsuspends one identity on a moderated data contract, or deletes + * one document of a document type that sets `canBeDeletedByModerators` (protocol version 14). + * Signed by the contract owner or a moderator its config names, with a CRITICAL * authentication key, under the signer's contract-scoped nonce. */ export interface ContractUserModerationTransitionOptions { @@ -63,12 +68,22 @@ export interface ContractUserModerationTransitionOptions { /** The signer's nonce for the contract */ identityContractNonce: bigint; /** What is done */ - action: "ban" | "unban" | "suspend" | "unsuspend"; - /** The identity the action targets */ - identityId: IdentifierLike; + action: "ban" | "unban" | "suspend" | "unsuspend" | "deleteDocument"; + /** + * The identity the action targets. Needed by every action but a deleteDocument, which + * names a document instead and refuses it. + */ + identityId?: IdentifierLike; + /** For a deleteDocument, which needs it: the document type of the document. Refused beside another action. */ + documentTypeName?: string; + /** For a deleteDocument, which needs it: the document. Refused beside another action. */ + documentId?: IdentifierLike; /** For a suspend: the block time, in milliseconds, at which the suspension lapses */ until?: bigint; - /** For a ban and a suspend, which both need one: why. Refused beside another action. */ + /** + * Why. A ban and a suspend both need one. A deleteDocument may leave it out, which stores + * no code and an empty text. Refused beside an unban or an unsuspend. + */ reason?: ContractModerationReason; userFeeIncrease?: number; } @@ -82,7 +97,9 @@ export interface ContractUserModerationObject { identityContractNonce: bigint; action: { $type: string; - identityId: Uint8Array; + identityId?: Uint8Array; + documentTypeName?: string; + documentId?: Uint8Array; until?: bigint; reason?: ContractModerationReason; }; @@ -139,6 +156,8 @@ struct ContractUserModerationOptionsInput { identity_contract_nonce: u64, action: String, #[serde(default)] + document_type_name: Option, + #[serde(default)] until: Option, #[serde(default)] reason: Option, @@ -164,14 +183,37 @@ impl From for ContractUserModerationTransition { } } -/// The action for a name and a target, `until` given for a suspend and `reason` for a ban and -/// a suspend. +/// What a moderation action is made of, as the options of the JavaScript surfaces carry it. +/// Which parts an action needs and which it refuses is decided by +/// [`moderation_action_from_parts`]. +#[derive(Default)] +pub struct ContractUserModerationActionParts { + /// The identity a ban, an unban, a suspend or an unsuspend targets + pub identity_id: Option, + /// The document type of the document a deleteDocument targets + pub document_type_name: Option, + /// The document a deleteDocument targets + pub document_id: Option, + /// The end of a suspend + pub until: Option, + /// Why: needed by a ban and a suspend, optional for a deleteDocument + pub reason: Option, +} + +/// The action for a name and its parts: an identity for the actions on an identity, with +/// `until` for a suspend and `reason` for a ban and a suspend, and a document type name and a +/// document id for a deleteDocument, with or without a `reason`. pub fn moderation_action_from_parts( action: &str, - identity_id: dpp::prelude::Identifier, - until: Option, - reason: Option, + parts: ContractUserModerationActionParts, ) -> WasmDppResult { + let ContractUserModerationActionParts { + identity_id, + document_type_name, + document_id, + until, + reason, + } = parts; // Only a suspension ends: an `until` beside another action is refused rather than dropped, // or a caller asking for a timed ban would sign a permanent one. if until.is_some() && action != "suspend" { @@ -179,37 +221,56 @@ pub fn moderation_action_from_parts( "`until` is only valid for a suspend action, not for `{action}`" ))); } - // The same goes for a reason: only an action that adds an entry stores one, and both - // need it. - let adds_an_entry = matches!(action, "ban" | "suspend"); - if reason.is_some() && !adds_an_entry { + // The same goes for a reason: only an action that adds an entry or a removal record stores + // one. + let stores_a_reason = matches!(action, "ban" | "suspend" | "deleteDocument"); + if reason.is_some() && !stores_a_reason { return Err(WasmDppError::invalid_argument(format!( - "`reason` is only valid for a ban or a suspend action, not for `{action}`" + "`reason` is only valid for a ban, a suspend or a deleteDocument action, not for `{action}`" ))); } - let reason = |action: &str| { - reason.ok_or_else(|| { - WasmDppError::invalid_argument(format!("a {action} action needs a `reason`")) - }) - }; + // And for the target: a deletion names a document and every other action an identity. A + // target of the other kind is refused rather than dropped, or a caller that mixed the two + // up would sign something it did not mean. + if action == "deleteDocument" { + if identity_id.is_some() { + return Err(WasmDppError::invalid_argument( + "`identityId` is not valid for a deleteDocument action, which names a document", + )); + } + } else if document_type_name.is_some() || document_id.is_some() { + return Err(WasmDppError::invalid_argument(format!( + "`documentTypeName` and `documentId` are only valid for a deleteDocument action, not for `{action}`" + ))); + } + // What an action that lacks one of its parts is refused with. + let needs = + |part: &str| WasmDppError::invalid_argument(format!("a {action} action needs {part}")); match action { "ban" => Ok(ContractUserModerationAction::Ban { - identity_id, - reason: reason("ban")?, + identity_id: identity_id.ok_or_else(|| needs("an `identityId`"))?, + reason: reason.ok_or_else(|| needs("a `reason`"))?, + }), + "unban" => Ok(ContractUserModerationAction::Unban { + identity_id: identity_id.ok_or_else(|| needs("an `identityId`"))?, + }), + "suspend" => Ok(ContractUserModerationAction::Suspend { + identity_id: identity_id.ok_or_else(|| needs("an `identityId`"))?, + until: until.ok_or_else(|| needs("`until`"))?, + reason: reason.ok_or_else(|| needs("a `reason`"))?, + }), + "unsuspend" => Ok(ContractUserModerationAction::Unsuspend { + identity_id: identity_id.ok_or_else(|| needs("an `identityId`"))?, + }), + "deleteDocument" => Ok(ContractUserModerationAction::DeleteDocument { + document_type_name: document_type_name.ok_or_else(|| needs("a `documentTypeName`"))?, + document_id: document_id.ok_or_else(|| needs("a `documentId`"))?, + // Both parts of a deletion's reason are optional, and so is the reason itself: + // left out, the removal record stores no code and an empty text. + reason: reason.unwrap_or_default(), }), - "unban" => Ok(ContractUserModerationAction::Unban { identity_id }), - "suspend" => { - let until = until - .ok_or_else(|| WasmDppError::invalid_argument("a suspend action needs `until`"))?; - Ok(ContractUserModerationAction::Suspend { - identity_id, - until, - reason: reason("suspend")?, - }) - } - "unsuspend" => Ok(ContractUserModerationAction::Unsuspend { identity_id }), other => Err(WasmDppError::invalid_argument(format!( - "unknown moderation action `{other}`: expected ban, unban, suspend or unsuspend" + "unknown moderation action `{other}`: expected ban, unban, suspend, unsuspend or deleteDocument" ))), } } @@ -223,7 +284,10 @@ impl ContractUserModerationWasm { // Extract complex types first (borrows &options) let owner_id: IdentifierWasm = try_from_options(&options, "ownerId")?; let data_contract_id: IdentifierWasm = try_from_options(&options, "dataContractId")?; - let identity_id: IdentifierWasm = try_from_options(&options, "identityId")?; + let identity_id: Option = + try_from_options_optional(&options, "identityId")?; + let document_id: Option = + try_from_options_optional(&options, "documentId")?; // Deserialize primitive fields via serde last (consumes options) let input: ContractUserModerationOptionsInput = @@ -232,9 +296,13 @@ impl ContractUserModerationWasm { let action = moderation_action_from_parts( &input.action, - identity_id.into(), - input.until, - input.reason, + ContractUserModerationActionParts { + identity_id: identity_id.map(Into::into), + document_type_name: input.document_type_name, + document_id: document_id.map(Into::into), + until: input.until, + reason: input.reason, + }, )?; Ok(ContractUserModerationWasm( @@ -361,16 +429,35 @@ impl ContractUserModerationWasm { self.0.identity_contract_nonce() } - /// The action's name: ban, unban, suspend or unsuspend + /// The action's name: ban, unban, suspend, unsuspend or deleteDocument #[wasm_bindgen(getter = "action")] pub fn action(&self) -> String { self.0.action().name().to_string() } - /// The identity the action targets + /// The identity the action targets, undefined for a deleteDocument: it names a document, + /// and whose it is is only known once the document is read #[wasm_bindgen(getter = "identityId")] - pub fn identity_id(&self) -> IdentifierWasm { - self.0.target_identity_id().into() + pub fn identity_id(&self) -> Option { + self.0.target_identity_id().map(Into::into) + } + + /// For a deleteDocument, the document type of the document it deletes + #[wasm_bindgen(getter = "documentTypeName")] + pub fn document_type_name(&self) -> Option { + self.0 + .action() + .document() + .map(|(document_type_name, _)| document_type_name.to_string()) + } + + /// For a deleteDocument, the document it deletes + #[wasm_bindgen(getter = "documentId")] + pub fn document_id(&self) -> Option { + self.0 + .action() + .document() + .map(|(_, document_id)| document_id.into()) } /// For a suspend, the block time in milliseconds at which the suspension lapses @@ -379,7 +466,7 @@ impl ContractUserModerationWasm { self.0.action().until() } - /// For a ban and a suspend, why + /// For a ban, a suspend and a deleteDocument, why #[wasm_bindgen(getter = "reason")] pub fn reason(&self) -> Option { self.0 diff --git a/packages/wasm-dpp2/src/state_transitions/proof_result/convert.rs b/packages/wasm-dpp2/src/state_transitions/proof_result/convert.rs index ea2d2ca2569..d93d490b5c3 100644 --- a/packages/wasm-dpp2/src/state_transitions/proof_result/convert.rs +++ b/packages/wasm-dpp2/src/state_transitions/proof_result/convert.rs @@ -7,8 +7,8 @@ use super::address_funds::{ VerifiedIdentityWithAddressInfosWasm, }; use super::data_contract::{ - VerifiedContractFeeClaimWasm, VerifiedContractModerationListStatusesWasm, - VerifiedDataContractWasm, + VerifiedContractDocumentRemovalWasm, VerifiedContractFeeClaimWasm, + VerifiedContractModerationListStatusesWasm, VerifiedDataContractWasm, }; use super::document::VerifiedDocumentsWasm; use super::helpers::{ @@ -75,7 +75,8 @@ export type StateTransitionProofResultType = | VerifiedShieldedNullifiersWithWithdrawalDocument | VerifiedIdentityWithShieldedNullifiers | VerifiedContractModerationListStatuses - | VerifiedContractFeeClaim; + | VerifiedContractFeeClaim + | VerifiedContractDocumentRemoval; "#; #[wasm_bindgen] @@ -387,6 +388,21 @@ pub fn convert_proof_result( } .into() } + StateTransitionProofResult::VerifiedContractDocumentRemoval( + contract_id, + document_type_name, + document_id, + removal, + ) => VerifiedContractDocumentRemovalWasm { + contract_id: contract_id.into(), + document_type_name, + document_id: document_id.into(), + document_owner_id: removal.document_owner_id.into(), + moderator_id: removal.moderator_id.into(), + reason: removal.reason, + removed_at: removal.removed_at, + } + .into(), }; Ok(js_value.into()) diff --git a/packages/wasm-dpp2/src/state_transitions/proof_result/data_contract.rs b/packages/wasm-dpp2/src/state_transitions/proof_result/data_contract.rs index 2f00414ea24..c1f34c4cf01 100644 --- a/packages/wasm-dpp2/src/state_transitions/proof_result/data_contract.rs +++ b/packages/wasm-dpp2/src/state_transitions/proof_result/data_contract.rs @@ -322,3 +322,89 @@ fn json_safe_credits(credits: u64) -> JsValue { } impl_wasm_type_info!(VerifiedContractFeeClaimWasm, VerifiedContractFeeClaim); + +/// `VerifiedContractDocumentRemoval` proof-result wrapper: the record a moderator's document +/// deletion left under the contract. The document itself is gone; the record says whose it +/// was, who removed it, why and when. +#[wasm_bindgen(js_name = "VerifiedContractDocumentRemoval")] +#[derive(Clone)] +pub struct VerifiedContractDocumentRemovalWasm { + #[wasm_bindgen(getter_with_clone, js_name = "contractId")] + pub contract_id: IdentifierWasm, + #[wasm_bindgen(getter_with_clone, js_name = "documentTypeName")] + pub document_type_name: String, + #[wasm_bindgen(getter_with_clone, js_name = "documentId")] + pub document_id: IdentifierWasm, + /// The identity that owned the document when it was removed + #[wasm_bindgen(getter_with_clone, js_name = "documentOwnerId")] + pub document_owner_id: IdentifierWasm, + /// The contract owner or moderator that removed it + #[wasm_bindgen(getter_with_clone, js_name = "moderatorId")] + pub moderator_id: IdentifierWasm, + #[wasm_bindgen(skip)] + pub reason: ContractModerationReason, + /// The time of the block that removed it, in milliseconds + #[wasm_bindgen(js_name = "removedAt")] + pub removed_at: u64, +} + +#[wasm_bindgen(js_class = VerifiedContractDocumentRemoval)] +impl VerifiedContractDocumentRemovalWasm { + /// Why the moderator removed the document: the text may be empty + #[wasm_bindgen(getter = "reason")] + pub fn reason(&self) -> ContractModerationReasonJs { + moderation_reason_to_js(&self.reason).into() + } + + #[wasm_bindgen(js_name = toObject)] + pub fn to_object(&self) -> WasmDppResult { + Ok(js_obj(&[ + ("contractId", self.contract_id.into()), + ( + "documentTypeName", + JsValue::from_str(&self.document_type_name), + ), + ("documentId", self.document_id.into()), + ("documentOwnerId", self.document_owner_id.into()), + ("moderatorId", self.moderator_id.into()), + ("reason", moderation_reason_to_js(&self.reason)), + ( + "removedAt", + JsValue::from(js_sys::BigInt::from(self.removed_at)), + ), + ])) + } + + #[wasm_bindgen(js_name = toJSON)] + pub fn to_json(&self) -> WasmDppResult { + Ok(js_obj(&[ + ( + "contractId", + JsValue::from_str(&self.contract_id.to_base58()), + ), + ( + "documentTypeName", + JsValue::from_str(&self.document_type_name), + ), + ( + "documentId", + JsValue::from_str(&self.document_id.to_base58()), + ), + ( + "documentOwnerId", + JsValue::from_str(&self.document_owner_id.to_base58()), + ), + ( + "moderatorId", + JsValue::from_str(&self.moderator_id.to_base58()), + ), + ("reason", moderation_reason_to_js(&self.reason)), + ("removedAt", JsValue::from_f64(self.removed_at as f64)), + ])) + } +} + +impl_wasm_type_info!( + VerifiedContractDocumentRemovalWasm, + VerifiedContractDocumentRemoval +); diff --git a/packages/wasm-dpp2/tests/unit/ContractUserModerationTransition.spec.ts b/packages/wasm-dpp2/tests/unit/ContractUserModerationTransition.spec.ts index e344ee28888..88bdc1d14ca 100644 --- a/packages/wasm-dpp2/tests/unit/ContractUserModerationTransition.spec.ts +++ b/packages/wasm-dpp2/tests/unit/ContractUserModerationTransition.spec.ts @@ -8,9 +8,17 @@ before(async () => { const OWNER_ID = '11111111111111111111111111111111'; const CONTRACT_ID = 'H2pb35GtKpjLinncBYeMsXkdDYXCbsFzzVmssce6pSJ1'; const TARGET_ID = '2QjL594djCH2NyDsn45vd6yQjEDHupMKo7CEGVTHtQxU'; +const DOCUMENT_ID = 'GWRSAVFMjXx8HpQFaNJMqBV7MBgMK4br5UESsB4S31Ec'; +const DOCUMENT_TYPE_NAME = 'post'; interface ModerationOptions { - action?: 'ban' | 'unban' | 'suspend' | 'unsuspend'; + action?: 'ban' | 'unban' | 'suspend' | 'unsuspend' | 'deleteDocument'; + /** `null` leaves the identity out; left undefined, every action but a deleteDocument gets `TARGET_ID` */ + identityId?: string | null; + /** `null` leaves it out; left undefined, a deleteDocument gets `DOCUMENT_TYPE_NAME` */ + documentTypeName?: string | null; + /** `null` leaves it out; left undefined, a deleteDocument gets `DOCUMENT_ID` */ + documentId?: string | null; until?: bigint; /** `null` leaves the reason out; left undefined, a ban and a suspend get `REASON` */ reason?: { code?: number; text: string } | null; @@ -27,13 +35,27 @@ function createTransition(options: ModerationOptions = {}) { if (reason === undefined && addsAnEntry) { reason = REASON; } + // A deletion names a document and every other action an identity. + const deletesADocument = action === 'deleteDocument'; + let { identityId, documentTypeName, documentId } = options; + if (identityId === undefined && !deletesADocument) { + identityId = TARGET_ID; + } + if (documentTypeName === undefined && deletesADocument) { + documentTypeName = DOCUMENT_TYPE_NAME; + } + if (documentId === undefined && deletesADocument) { + documentId = DOCUMENT_ID; + } return new wasm.ContractUserModeration({ ownerId: OWNER_ID, dataContractId: CONTRACT_ID, identityContractNonce: options.identityContractNonce ?? BigInt(7), action, - identityId: TARGET_ID, + identityId: identityId ?? undefined, + documentTypeName: documentTypeName ?? undefined, + documentId: documentId ?? undefined, until: options.until, reason: reason ?? undefined, userFeeIncrease: options.userFeeIncrease, @@ -49,13 +71,69 @@ describe('ContractUserModeration', () => { expect(transition.action).to.equal('ban'); expect(transition.ownerId.toString()).to.equal(OWNER_ID); expect(transition.dataContractId.toString()).to.equal(CONTRACT_ID); - expect(transition.identityId.toString()).to.equal(TARGET_ID); + expect(transition.identityId?.toString()).to.equal(TARGET_ID); + expect(transition.documentTypeName).to.equal(undefined); + expect(transition.documentId).to.equal(undefined); expect(transition.identityContractNonce).to.equal(BigInt(7)); expect(transition.until).to.equal(undefined); expect(transition.reason).to.deep.equal({ code: null, text: 'spam' }); expect(transition.userFeeIncrease).to.equal(0); }); + it('should create a document deletion, which names a document and no identity', () => { + const transition = createTransition({ + action: 'deleteDocument', + reason: { code: 2, text: 'spam' }, + }); + + expect(transition.action).to.equal('deleteDocument'); + expect(transition.documentTypeName).to.equal(DOCUMENT_TYPE_NAME); + expect(transition.documentId?.toString()).to.equal(DOCUMENT_ID); + expect(transition.identityId).to.equal(undefined); + expect(transition.until).to.equal(undefined); + expect(transition.reason).to.deep.equal({ code: 2, text: 'spam' }); + }); + + it('should create a document deletion without a reason, stored as no code and an empty text', () => { + const transition = createTransition({ action: 'deleteDocument' }); + + expect(transition.reason).to.deep.equal({ code: null, text: '' }); + // Left out or written empty, the reason signed is the same. + expect(transition.toBytes()).to.deep.equal( + createTransition({ action: 'deleteDocument', reason: { text: '' } }).toBytes(), + ); + }); + + it('should refuse a document deletion without its document type or its document', () => { + expect(() => createTransition({ action: 'deleteDocument', documentTypeName: null })).to.throw(); + expect(() => createTransition({ action: 'deleteDocument', documentId: null })).to.throw(); + }); + + it('should refuse an identity or an end on a document deletion', () => { + expect(() => createTransition({ action: 'deleteDocument', identityId: TARGET_ID })).to.throw(); + expect(() => createTransition({ action: 'deleteDocument', until: BigInt(5) })).to.throw(); + }); + + it('should refuse a document on an action that targets an identity', () => { + (['ban', 'unban', 'unsuspend'] as const).forEach((action) => { + expect(() => createTransition({ action, documentTypeName: DOCUMENT_TYPE_NAME })).to.throw(); + expect(() => createTransition({ action, documentId: DOCUMENT_ID })).to.throw(); + }); + expect(() => createTransition({ + action: 'suspend', + until: BigInt(5), + documentTypeName: DOCUMENT_TYPE_NAME, + documentId: DOCUMENT_ID, + })).to.throw(); + }); + + it('should refuse an action on an identity without the identity', () => { + (['ban', 'unban', 'unsuspend'] as const).forEach((action) => { + expect(() => createTransition({ action, identityId: null })).to.throw(); + }); + expect(() => createTransition({ action: 'suspend', until: BigInt(5), identityId: null })).to.throw(); + }); + it('should keep a reason code as written, and an empty text', () => { const transition = createTransition({ reason: { code: 65535, text: '' } }); @@ -114,6 +192,8 @@ describe('ContractUserModeration', () => { createTransition({ action: 'unban' }), createTransition({ action: 'suspend', until: BigInt(5) }), createTransition({ action: 'unsuspend', userFeeIncrease: 3 }), + createTransition({ action: 'deleteDocument', reason: { code: 9, text: 'spam' } }), + createTransition({ action: 'deleteDocument' }), ]) { const bytes = transition.toBytes(); expect(wasm.ContractUserModeration.fromBytes(bytes).toBytes()).to.deep.equal(bytes); @@ -159,6 +239,17 @@ describe('ContractUserModeration', () => { expect(json.signature).to.equal(''); expect(json.signaturePublicKeyId).to.equal(0); }); + + it('should tag a document deletion and name its document', () => { + const json = createTransition({ action: 'deleteDocument', reason: { code: 2, text: 'spam' } }).toJSON(); + + expect(json.action).to.deep.equal({ + $type: 'deleteDocument', + documentTypeName: DOCUMENT_TYPE_NAME, + documentId: DOCUMENT_ID, + reason: { code: 2, text: 'spam' }, + }); + }); }); describe('fromJSON()', () => { @@ -169,11 +260,24 @@ describe('ContractUserModeration', () => { expect(restored.reason).to.equal(undefined); expect(restored.action).to.equal('unban'); - expect(restored.identityId.toString()).to.equal(TARGET_ID); + expect(restored.identityId?.toString()).to.equal(TARGET_ID); expect(restored.identityContractNonce).to.equal(BigInt(7)); expect(restored.userFeeIncrease).to.equal(4); expect(restored.toBytes()).to.deep.equal(transition.toBytes()); }); + + it('should restore a document deletion from JSON', () => { + const transition = createTransition({ action: 'deleteDocument', reason: { text: 'spam' } }); + + const restored = wasm.ContractUserModeration.fromJSON(transition.toJSON()); + + expect(restored.action).to.equal('deleteDocument'); + expect(restored.documentTypeName).to.equal(DOCUMENT_TYPE_NAME); + expect(restored.documentId?.toString()).to.equal(DOCUMENT_ID); + expect(restored.identityId).to.equal(undefined); + expect(restored.reason).to.deep.equal({ code: null, text: 'spam' }); + expect(restored.toBytes()).to.deep.equal(transition.toBytes()); + }); }); describe('toObject() / fromObject()', () => { @@ -199,6 +303,20 @@ describe('ContractUserModeration', () => { expect(restored.reason).to.deep.equal({ code: 3, text: 'flooding' }); expect(restored.toBytes()).to.deep.equal(transition.toBytes()); }); + + it('should round trip a document deletion through a plain object', () => { + const transition = createTransition({ action: 'deleteDocument', reason: { code: 3, text: 'spam' } }); + + const obj = transition.toObject(); + expect(obj.action.$type).to.equal('deleteDocument'); + expect(obj.action.documentTypeName).to.equal(DOCUMENT_TYPE_NAME); + expect(obj.action.documentId).to.be.instanceOf(Uint8Array); + expect(obj.action.identityId).to.equal(undefined); + expect(obj.action.reason).to.deep.equal({ code: 3, text: 'spam' }); + + const restored = wasm.ContractUserModeration.fromObject(obj); + expect(restored.toBytes()).to.deep.equal(transition.toBytes()); + }); }); describe('toStateTransition() / fromStateTransition()', () => { diff --git a/packages/wasm-sdk/src/queries/contract_moderation.rs b/packages/wasm-sdk/src/queries/contract_moderation.rs index b80ae0c8674..e76cc3f3b01 100644 --- a/packages/wasm-sdk/src/queries/contract_moderation.rs +++ b/packages/wasm-sdk/src/queries/contract_moderation.rs @@ -1,15 +1,20 @@ //! Contract moderation queries: one identity's status on a moderated contract -//! (`getContractModerationStatus`) and one page of a contract's banlist or suspension list -//! (`getContractModerationEntries`). +//! (`getContractModerationStatus`), one page of a contract's banlist or suspension list +//! (`getContractModerationEntries`) and the records of the documents its moderators deleted +//! (`getContractDocumentRemovals`). use crate::error::WasmSdkError; use crate::queries::utils::deserialize_required_query; use crate::queries::ProofMetadataResponseWasm; use crate::sdk::WasmSdk; +use dash_sdk::dpp::data_contract::accessors::v0::DataContractV0Getters; +use dash_sdk::dpp::data_contract::config::v2::DataContractConfigGettersV2; use dash_sdk::dpp::version::PlatformVersion; use dash_sdk::platform::contract_moderation::{ - ContractModerationEntries, ContractModerationEntriesPageQuery, ContractModerationList, - ContractModerationListStatus, ContractModerationListStatuses, ContractModerationStatusQuery, + ContractDocumentRemoval, ContractDocumentRemovals, ContractDocumentRemovalsPageQuery, + ContractDocumentRemovalsSelection, ContractModerationEntries, + ContractModerationEntriesPageQuery, ContractModerationList, ContractModerationListStatus, + ContractModerationListStatuses, ContractModerationStatusQuery, }; use dash_sdk::platform::{DataContract, Fetch, Identifier}; use js_sys::Array; @@ -98,6 +103,56 @@ export interface ContractModerationEntriesPage { entries: ContractModerationEntry[]; nextStartAfter?: string; } + +/** + * Query parameters for the records of the documents a contract's moderators deleted within one + * document type (`getContractDocumentRemovals`): the records of the documents `documentIds` + * names, or else one page of them all. + */ +export interface ContractDocumentRemovalsQuery { + /** The moderated contract. */ + contractId: IdentifierLike; + /** The document type; it must set `canBeDeletedByModerators`, as no other keeps records. */ + documentTypeName: string; + /** + * Read the records of these documents alone, 1 to 100 distinct ids. A document with no + * record is left out of the answer. Refused beside `startAfter` or `limit`. + */ + documentIds?: IdentifierLike[]; + /** Continue after this document; omit for the first page. Use the page's `nextStartAfter`. */ + startAfter?: IdentifierLike; + /** + * Maximum number of records to return, 1 to 100. + * @default 100 + */ + limit?: number; +} + +/** + * The record a contract keeps of one document a moderator deleted. It is final: a document id + * is produced at most once, so the removed id can not be created again. + */ +export interface ContractDocumentRemovalEntry { + documentId: string; + /** The identity that owned the document when it was removed. */ + documentOwnerId: string; + /** The contract owner or moderator that removed it. */ + moderatorId: string; + /** Why, as the moderator wrote it: the text may be empty. */ + reason: ContractModerationReason; + /** The time of the block that removed it, in milliseconds. */ + removedAt: bigint; +} + +/** + * Removal records in document id order. For a page, `nextStartAfter` is the cursor of the next + * page and is absent when this page holds fewer records than the limit, which makes it the + * last one. A read by `documentIds` never carries one. + */ +export interface ContractDocumentRemovalsPage { + removals: ContractDocumentRemovalEntry[]; + nextStartAfter?: string; +} "#; #[wasm_bindgen] @@ -107,6 +162,9 @@ extern "C" { #[wasm_bindgen(typescript_type = "ContractModerationEntriesQuery")] pub type ContractModerationEntriesQueryJs; + + #[wasm_bindgen(typescript_type = "ContractDocumentRemovalsQuery")] + pub type ContractDocumentRemovalsQueryJs; } #[derive(Deserialize, Clone, Copy)] @@ -145,6 +203,19 @@ struct ContractModerationEntriesQueryInput { limit: Option, } +#[derive(Deserialize)] +#[serde(rename_all = "camelCase")] +struct ContractDocumentRemovalsQueryInput { + contract_id: IdentifierWasm, + document_type_name: String, + #[serde(default)] + document_ids: Option>, + #[serde(default)] + start_after: Option, + #[serde(default)] + limit: Option, +} + impl WasmSdk { /// The status query for `query`. Without `lists`, the contract is fetched and every list /// it keeps is read, because the node refuses a list the contract does not keep. @@ -172,7 +243,14 @@ impl WasmSdk { .await? .ok_or_else(|| WasmSdkError::not_found(format!("contract {contract_id} not found")))?; ContractModerationStatusQuery::for_contract(&contract, identity_id).ok_or_else(|| { - WasmSdkError::invalid_argument(format!("contract {contract_id} is not moderated")) + // A moderated contract may keep no list at all, when its moderators only delete + // documents: there is then no status to read, which is not the same as no + // moderation. + let reason = match contract.config().moderation() { + Some(_) => "keeps no moderation list, so no identity has a status on it", + None => "is not moderated", + }; + WasmSdkError::invalid_argument(format!("contract {contract_id} {reason}")) }) } } @@ -201,6 +279,57 @@ fn parse_entries_query( Ok(page_query) } +fn parse_removals_query( + query: ContractDocumentRemovalsQueryJs, + platform_version: &PlatformVersion, +) -> Result { + let input: ContractDocumentRemovalsQueryInput = deserialize_required_query( + query, + "Query object is required", + "contract document removals query", + )?; + let contract_id = Identifier::from(input.contract_id); + + if let Some(document_ids) = input.document_ids { + // A read by ids is not paged: a cursor or a limit beside it is refused rather than + // dropped, or a caller expecting a page would read something else. + if input.start_after.is_some() || input.limit.is_some() { + return Err(WasmSdkError::invalid_argument( + "`startAfter` and `limit` page through every record and are not valid beside `documentIds`", + )); + } + // No id named is not a page of every record either, and the node refuses it. + if document_ids.is_empty() { + return Err(WasmSdkError::invalid_argument( + "`documentIds` must name at least one document", + )); + } + return Ok(ContractDocumentRemovalsPageQuery::for_document_ids( + contract_id, + input.document_type_name, + document_ids.into_iter().map(Identifier::from).collect(), + )); + } + + let mut page_query = ContractDocumentRemovalsPageQuery::new( + contract_id, + input.document_type_name, + platform_version, + ); + if let Some(limit) = input.limit { + let limit = u16::try_from(limit).map_err(|_| { + WasmSdkError::invalid_argument(format!("limit {limit} exceeds maximum of {}", u16::MAX)) + })?; + page_query = page_query.with_limit(limit); + } + if let ContractDocumentRemovalsSelection::Page { start_after, .. } = + &mut page_query.query.selection + { + *start_after = input.start_after.map(Identifier::from); + } + Ok(page_query) +} + /// Sets `lists`, and `banned` and `suspendedUntil` for the lists read, each with the reason of /// the entry found, on `target`. Only the /// lists read are reported: the field of a list that was not read stays undefined (unknown) @@ -284,6 +413,58 @@ fn entries_to_js( Ok(result.into()) } +/// Sets `documentOwnerId`, `moderatorId`, `reason` and `removedAt` on `target`. The removals +/// query and the result of a deletion carry the same record, so they share this. Each writes +/// identifiers its own way, which `id_to_js` decides: base58 strings in a query answer, as the +/// entries of a moderation list are, and `Identifier`s in the result of a transition. +pub(crate) fn set_removal_fields( + target: &js_sys::Object, + removal: &ContractDocumentRemoval, + id_to_js: impl Fn(Identifier) -> JsValue, +) -> Result<(), WasmSdkError> { + let set = |key: &str, value: JsValue| { + js_sys::Reflect::set(target, &key.into(), &value) + .map(|_| ()) + .map_err(|_| WasmSdkError::generic(format!("failed to set `{key}` on the removal"))) + }; + set("documentOwnerId", id_to_js(removal.document_owner_id))?; + set("moderatorId", id_to_js(removal.moderator_id))?; + set("reason", moderation_reason_to_js(&removal.reason))?; + set("removedAt", js_sys::BigInt::from(removal.removed_at).into()) +} + +fn removals_to_js( + page: ContractDocumentRemovals, + query: &ContractDocumentRemovalsPageQuery, +) -> Result { + let result = js_sys::Object::new(); + let set = |target: &js_sys::Object, key: &str, value: JsValue| { + js_sys::Reflect::set(target, &key.into(), &value) + .map_err(|_| WasmSdkError::generic(format!("failed to set `{key}` on the page"))) + }; + let id_to_js = |id: Identifier| JsValue::from_str(&IdentifierWasm::from(id).to_base58()); + let removals = Array::new(); + for entry in page.removals() { + let js_entry = js_sys::Object::new(); + set(&js_entry, "documentId", id_to_js(entry.document_id))?; + set_removal_fields(&js_entry, &entry.removal, id_to_js)?; + removals.push(&js_entry); + } + set(&result, "removals", removals.into())?; + // A page shorter than the limit is the last one, and a read by ids has no page after it: + // neither carries a cursor. + let next_start_after = query + .after(&page) + .and_then(|next| match next.query.selection { + ContractDocumentRemovalsSelection::Page { start_after, .. } => start_after, + ContractDocumentRemovalsSelection::DocumentIds(_) => None, + }); + if let Some(start_after) = next_start_after { + set(&result, "nextStartAfter", id_to_js(start_after))?; + } + Ok(result.into()) +} + #[wasm_bindgen] impl WasmSdk { /// One identity's status on a moderated contract: whether it is banned, and until when it @@ -382,4 +563,53 @@ impl WasmSdk { proof, )) } + + /// The records of the documents a contract's moderators deleted within one document type, + /// in document id order: the records of the `documentIds` named, where a document with no + /// record is left out, or else one page of them all. Pass a page's `nextStartAfter` as the + /// next query's `startAfter`; a page without one is the last. The document type must set + /// `canBeDeletedByModerators`: no other keeps records, and the node refuses the query. + /// + /// # Example + /// ```javascript + /// const { removals } = await sdk.getContractDocumentRemovals({ contractId, documentTypeName: 'post', documentIds: [documentId] }); + /// if (removals.length) console.log('removed by', removals[0].moderatorId); + /// ``` + #[wasm_bindgen( + js_name = "getContractDocumentRemovals", + unchecked_return_type = "ContractDocumentRemovalsPage" + )] + pub async fn get_contract_document_removals( + &self, + query: ContractDocumentRemovalsQueryJs, + ) -> Result { + let query = parse_removals_query(query, self.inner_sdk().version())?; + let page = ContractDocumentRemovals::fetch(self.as_ref(), query.clone()) + .await? + .unwrap_or_default(); + removals_to_js(page, &query) + } + + /// The removal records of a document type together with their proof and metadata. + #[wasm_bindgen( + js_name = "getContractDocumentRemovalsWithProofInfo", + unchecked_return_type = "ProofMetadataResponseTyped" + )] + pub async fn get_contract_document_removals_with_proof_info( + &self, + query: ContractDocumentRemovalsQueryJs, + ) -> Result { + let query = parse_removals_query(query, self.inner_sdk().version())?; + let (page, metadata, proof) = ContractDocumentRemovals::fetch_with_metadata_and_proof( + self.as_ref(), + query.clone(), + None, + ) + .await?; + Ok(ProofMetadataResponseWasm::from_sdk_parts( + removals_to_js(page.unwrap_or_default(), &query)?, + metadata, + proof, + )) + } } diff --git a/packages/wasm-sdk/src/state_transitions/broadcast.rs b/packages/wasm-sdk/src/state_transitions/broadcast.rs index f3dd32343b9..7f42ee7fab8 100644 --- a/packages/wasm-sdk/src/state_transitions/broadcast.rs +++ b/packages/wasm-sdk/src/state_transitions/broadcast.rs @@ -29,7 +29,8 @@ fn referenced_contract_ids(state_transition: &StateTransition) -> BTreeSet, } +#[derive(serde::Deserialize)] +#[serde(rename_all = "camelCase")] +struct ContractDeleteDocumentOptionsInput { + document_type_name: String, + #[serde(default)] + reason: Option, +} + impl WasmSdk { async fn moderate_contract_user( &self, options: ContractModerationOptionsJs, action: &str, ) -> Result { - use dash_sdk::dpp::state_transition::contract_user_moderation_transition::ContractUserModerationAction; - use dash_sdk::platform::transition::contract_user_moderation::ModerateContractUser; - use wasm_dpp2::data_contract::moderation_action_from_parts; - use wasm_dpp2::identity::IdentityWasm; - use wasm_dpp2::IdentifierWasm; - // Extract complex types first (borrows &options) - let identity: dash_sdk::dpp::identity::Identity = - IdentityWasm::try_from_options(&options, "identity")?.into(); + let identity: Identity = IdentityWasm::try_from_options(&options, "identity")?.into(); let contract_id: Identifier = IdentifierWasm::try_from_options(&options, "contractId")?.into(); let identity_id: Identifier = @@ -354,15 +412,22 @@ impl WasmSdk { try_from_options_optional::(&options, "settings")?.map(Into::into); // Deserialize simple fields last (consumes options) - let parsed: ContractModerationOptionsInput = - crate::queries::utils::deserialize_required_query( - options, - "Options object is required", - "contract moderation options", - )?; + let parsed: ContractModerationOptionsInput = deserialize_required_query( + options, + "Options object is required", + "contract moderation options", + )?; - let action = moderation_action_from_parts(action, identity_id, parsed.until, parsed.reason) - .map_err(|e| WasmSdkError::invalid_argument(e.to_string()))?; + let action = moderation_action_from_parts( + action, + ContractUserModerationActionParts { + identity_id: Some(identity_id), + until: parsed.until, + reason: parsed.reason, + ..Default::default() + }, + ) + .map_err(|e| WasmSdkError::invalid_argument(e.to_string()))?; // The proof of a ban covers every list the contract keeps, which the verifier reads // from the contract, so the contract is resolved and cached before anything is paid @@ -457,6 +522,68 @@ impl WasmSdk { ) -> Result { self.moderate_contract_user(options, "unsuspend").await } + + /// Deletes one document on a moderated contract as a moderator, whoever owns it, except + /// the contract owner and the moderators. The document type must set + /// `canBeDeletedByModerators`. The document's owner gets no storage refund, and a record + /// of the deletion stays under the contract, which `getContractDocumentRemovals` reads. + /// + /// @param options - The moderating identity, the contract, the document type, the document, an optional `reason` and the signer + /// @returns The record the deletion left under the contract, proved + #[wasm_bindgen(js_name = "contractDeleteDocument")] + pub async fn contract_delete_document( + &self, + options: ContractDeleteDocumentOptionsJs, + ) -> Result { + // Extract complex types first (borrows &options) + let identity: Identity = IdentityWasm::try_from_options(&options, "identity")?.into(); + let contract_id: Identifier = + IdentifierWasm::try_from_options(&options, "contractId")?.into(); + let document_id: Identifier = + IdentifierWasm::try_from_options(&options, "documentId")?.into(); + let signer = IdentitySignerWasm::try_from_options(&options, "signer")?; + let settings = + try_from_options_optional::(&options, "settings")?.map(Into::into); + + // Deserialize simple fields last (consumes options) + let parsed: ContractDeleteDocumentOptionsInput = deserialize_required_query( + options, + "Options object is required", + "contract document deletion options", + )?; + + // A deletion is proved by the removal record it wrote, which the verifier reads without + // the contract, so unlike a ban nothing is resolved before anything is paid for. + let removal = identity + .delete_contract_document( + self.inner_sdk(), + contract_id, + parsed.document_type_name.clone(), + document_id, + // Both parts of a deletion's reason are optional, and so is the reason itself. + parsed.reason.unwrap_or_default(), + None, + signer, + settings, + ) + .await?; + + let result = js_sys::Object::new(); + let set = |key: &str, value: JsValue| { + js_sys::Reflect::set(&result, &key.into(), &value).map_err(|_| { + WasmSdkError::generic(format!("failed to set `{key}` on the removal result")) + }) + }; + set("contractId", IdentifierWasm::from(contract_id).into())?; + set( + "documentTypeName", + JsValue::from_str(&parsed.document_type_name), + )?; + set("documentId", IdentifierWasm::from(document_id).into())?; + // The record, with the fields `getContractDocumentRemovals` answers with. + set_removal_fields(&result, &removal, |id| IdentifierWasm::from(id).into())?; + Ok(JsValue::from(result).into()) + } } // ============================================================================